There was already some logic for that, but it didn't handle the case of content-addressed outputs, so extend it a bit for that
There was already some logic for that, but it didn't handle the case of content-addressed outputs, so extend it a bit for that