mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-21 22:31:21 +02:00
create explicit GenTxid::{Txid, Wtxid} ctors
This commit is contained in:
parent
f9ad4d51e3
commit
d50fbd4c5b
@ -393,6 +393,8 @@ class GenTxid
|
|||||||
uint256 m_hash;
|
uint256 m_hash;
|
||||||
public:
|
public:
|
||||||
GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
|
GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
|
||||||
|
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; }
|
bool IsWtxid() const { return m_is_wtxid; }
|
||||||
const uint256& GetHash() const { return m_hash; }
|
const uint256& GetHash() const { 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 a.m_is_wtxid == b.m_is_wtxid && a.m_hash == b.m_hash; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user