Skip to content

Commit c8ba199

Browse files
committed
Remove old GenTxid class
1 parent 072a198 commit c8ba199

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/primitives/transaction.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -423,34 +423,4 @@ struct CMutableTransaction
423423
typedef std::shared_ptr<const CTransaction> CTransactionRef;
424424
template <typename Tx> static inline CTransactionRef MakeTransactionRef(Tx&& txIn) { return std::make_shared<const CTransaction>(std::forward<Tx>(txIn)); }
425425

426-
/** A generic txid reference (txid or wtxid). */
427-
class GenTxid
428-
{
429-
bool m_is_wtxid;
430-
uint256 m_hash;
431-
GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
432-
433-
public:
434-
static GenTxid Txid(const uint256& hash) { return GenTxid{false, hash}; }
435-
static GenTxid Wtxid(const uint256& hash) { return GenTxid{true, hash}; }
436-
bool IsWtxid() const { return m_is_wtxid; }
437-
const uint256& GetHash() const LIFETIMEBOUND { return m_hash; }
438-
friend bool operator==(const GenTxid& a, const GenTxid& b) { return a.m_is_wtxid == b.m_is_wtxid && a.m_hash == b.m_hash; }
439-
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); }
440-
441-
GenTxidVariant ToVariant() const
442-
{
443-
return m_is_wtxid ?
444-
GenTxidVariant{Wtxid::FromUint256(m_hash)} :
445-
GenTxidVariant{Txid::FromUint256(m_hash)};
446-
}
447-
448-
static GenTxid FromVariant(const GenTxidVariant& variant)
449-
{
450-
return GenTxid{
451-
std::holds_alternative<::Wtxid>(variant),
452-
variant.ToUint256()};
453-
}
454-
};
455-
456426
#endif // BITCOIN_PRIMITIVES_TRANSACTION_H

0 commit comments

Comments
 (0)