Yeah the inv should match the peer’s wtxid relay setting. The announcements are converted to GenTxids in ProcessMessage
and that’s what’s passed into AddTxAnnouncement
and used throughout txdownloadman_impl
and txrequest
.
I would prefer to keep it all in this PR, as I don’t want both the old GenTxid class and the new variant in master. But I agree it’s a bit iffy to have to manually ensure that we didn’t miss a place where a previous uint256
comparison is now suddenly a GenTxid
comparison. The patch I provide at the top should catch anywhere that I might’ve missed.
Yes, with this PR’s change, we would have be intentional about when we’re comparing GenTxid objects (type first, then hash) and when we’re comparing only the underlying hash. Another option would be to make the patch an actual part of the code, deleting the GenTxid comparators and having custom comparators wherever GenTxids are involved. This felt like overkill to me though, and I think the point of this type safety refactor is to, from now on, differentiate between the transaction identifiers and the underlying transaction hash. In that case, it makes sense to me to have a standard way to compare GenTxids and then make the conversion to uint256
explicit if comparison of the hash is needed.