From c8ba1995986323cd9e76097acc1f15eed7c60943 Mon Sep 17 00:00:00 2001 From: marcofleon Date: Tue, 1 Apr 2025 11:59:19 +0100 Subject: [PATCH] Remove old GenTxid class --- src/primitives/transaction.h | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index adadb2a3e74..78ddebcbd48 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -423,34 +423,4 @@ struct CMutableTransaction typedef std::shared_ptr CTransactionRef; template static inline CTransactionRef MakeTransactionRef(Tx&& txIn) { return std::make_shared(std::forward(txIn)); } -/** A generic txid reference (txid or wtxid). */ -class GenTxid -{ - bool m_is_wtxid; - uint256 m_hash; - GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {} - -public: - static GenTxid Txid(const uint256& hash) { return GenTxid{false, hash}; } - static GenTxid Wtxid(const uint256& hash) { return GenTxid{true, hash}; } - bool IsWtxid() const { return m_is_wtxid; } - const uint256& GetHash() const LIFETIMEBOUND { return m_hash; } - friend bool operator==(const GenTxid& a, const GenTxid& b) { return a.m_is_wtxid == b.m_is_wtxid && a.m_hash == b.m_hash; } - friend bool operator<(const GenTxid& a, const GenTxid& b) { return std::tie(a.m_is_wtxid, a.m_hash) < std::tie(b.m_is_wtxid, b.m_hash); } - - GenTxidVariant ToVariant() const - { - return m_is_wtxid ? - GenTxidVariant{Wtxid::FromUint256(m_hash)} : - GenTxidVariant{Txid::FromUint256(m_hash)}; - } - - static GenTxid FromVariant(const GenTxidVariant& variant) - { - return GenTxid{ - std::holds_alternative<::Wtxid>(variant), - variant.ToUint256()}; - } -}; - #endif // BITCOIN_PRIMITIVES_TRANSACTION_H