Skip to content

Commit d50fbd4

Browse files
committed
create explicit GenTxid::{Txid, Wtxid} ctors
1 parent f9ad4d5 commit d50fbd4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/primitives/transaction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ class GenTxid
393393
uint256 m_hash;
394394
public:
395395
GenTxid(bool is_wtxid, const uint256& hash) : m_is_wtxid(is_wtxid), m_hash(hash) {}
396+
static GenTxid Txid(const uint256& hash) { return GenTxid{false, hash}; }
397+
static GenTxid Wtxid(const uint256& hash) { return GenTxid{true, hash}; }
396398
bool IsWtxid() const { return m_is_wtxid; }
397399
const uint256& GetHash() const { return m_hash; }
398400
friend bool operator==(const GenTxid& a, const GenTxid& b) { return a.m_is_wtxid == b.m_is_wtxid && a.m_hash == b.m_hash; }

0 commit comments

Comments
 (0)