From d50fbd4c5b4bc72415854d582cedf94541a46983 Mon Sep 17 00:00:00 2001
From: glozow <gloriajzhao@gmail.com>
Date: Thu, 21 Oct 2021 16:15:01 +0100
Subject: create explicit GenTxid::{Txid, Wtxid} ctors

---
 src/primitives/transaction.h | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src/primitives')

diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h
index 46db39f8db..d7a85015ef 100644
--- a/src/primitives/transaction.h
+++ b/src/primitives/transaction.h
@@ -393,6 +393,8 @@ class GenTxid
     uint256 m_hash;
 public:
     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; }
     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; }
-- 
cgit v1.2.3