429 | @@ -430,8 +430,8 @@ class GenTxid
430 | GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
431 |
432 | public:
433 | - static GenTxid Txid(const uint256& hash) { return GenTxid{false, hash}; }
434 | - static GenTxid Wtxid(const uint256& hash) { return GenTxid{true, hash}; }
Should GenTxid just become a std::variant<Txid,Wtxid> at this point? cf #28107 (comment)
In either case, these should be explicit GenTxid(const Txid& txid) constructors, afaics.
Could DRY it as
template<bool has_witness>
explicit GenTxid(const transaction_identifier<has_witness>& id) m_is_wtxid{has_witness}, m_hash{id.ToUint256()} {}
We could go the "whole way", would just change quite a bit of code. If that's what we want to do, sure.
I don't think explicit GenTxid(...) requires changing a bunch of code. It is simply a constructor that can be used by new code, and old code can (for now) use the old methods to create the object.
Should be fine to add and use it, maybe as part of one of the follow-ups to convert more code?