diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-04-09 19:16:24 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-05-04 17:55:12 -0400 |
commit | fac1223a568fa1ad6dd602350598eed278d115e8 (patch) | |
tree | 66c5077c8be0a0146387aea0968baace97603d14 /src/primitives/transaction.h | |
parent | faab55fbb17f2ea5080bf02bc59eeef5ca746f07 (diff) |
Cache witness hash in CTransaction
Diffstat (limited to 'src/primitives/transaction.h')
-rw-r--r-- | src/primitives/transaction.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 692b553928..1c846d38ec 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -286,8 +286,10 @@ public: private: /** Memory only. */ const uint256 hash; + const uint256 m_witness_hash; uint256 ComputeHash() const; + uint256 ComputeWitnessHash() const; public: /** Construct a CTransaction that qualifies as IsNull() */ @@ -311,12 +313,8 @@ public: return vin.empty() && vout.empty(); } - const uint256& GetHash() const { - return hash; - } - - // Compute a hash that includes both transaction and witness data - uint256 GetWitnessHash() const; + const uint256& GetHash() const { return hash; } + const uint256& GetWitnessHash() const { return m_witness_hash; }; // Return sum of txouts. CAmount GetValueOut() const; |