🚨🚨 UNDER NO CIRCUMSTANCES SHOULD THIS BE MERGED!! 🚨🚨
This is the full Txid type safety refactor. Any transaction that was using uint256 should now be either a Txid, Wtxid, or GenTxid. The implicit conversion in transaction_identifier.h
from the transaction types to uint256 is removed and any conversions are now explicit, using FromUint256
or ToUint256()
. In general, I try to only convert a transaction to uint256 in contexts where the type information isn’t preserved. Examples would be bloom filters or the txid hasher.
The GenTxid class changes to a variant, which holds both Txids and Wtxids. This provides compile-time type safety and eliminates the manual type check (bool m_is_wtxid
). Variables that can be either type now use GenTxid, instead of uint256.
I’ll be splitting this up into a few smaller PRs, but any feedback on the approach or questions about specifics are welcome here.