diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-10 17:26:00 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-19 17:51:09 -0800 |
commit | 1662b437b33b7ec5a1723f6ae6187d3bdd06f593 (patch) | |
tree | 00b734409ca0ff817c36c000deae676df3cf16e2 /src/blockencodings.h | |
parent | da60506fc80f6a78f1b271a9a53b956b49b37234 (diff) |
Make CBlock::vtx a vector of shared_ptr<CTransaction>
Diffstat (limited to 'src/blockencodings.h')
-rw-r--r-- | src/blockencodings.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockencodings.h b/src/blockencodings.h index 1f9491867a..ffe189a940 100644 --- a/src/blockencodings.h +++ b/src/blockencodings.h @@ -14,9 +14,9 @@ class CTxMemPool; // Dumb helper to handle CTransaction compression at serialize-time struct TransactionCompressor { private: - CTransaction& tx; + std::shared_ptr<const CTransaction>& tx; public: - TransactionCompressor(CTransaction& txIn) : tx(txIn) {} + TransactionCompressor(std::shared_ptr<const CTransaction>& txIn) : tx(txIn) {} ADD_SERIALIZE_METHODS; @@ -72,7 +72,7 @@ class BlockTransactions { public: // A BlockTransactions message uint256 blockhash; - std::vector<CTransaction> txn; + std::vector<std::shared_ptr<const CTransaction>> txn; BlockTransactions() {} BlockTransactions(const BlockTransactionsRequest& req) : @@ -104,7 +104,7 @@ struct PrefilledTransaction { // Used as an offset since last prefilled tx in CBlockHeaderAndShortTxIDs, // as a proper transaction-in-block-index in PartiallyDownloadedBlock uint16_t index; - CTransaction tx; + std::shared_ptr<const CTransaction> tx; ADD_SERIALIZE_METHODS; @@ -202,7 +202,7 @@ public: ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock); bool IsTxAvailable(size_t index) const; - ReadStatus FillBlock(CBlock& block, const std::vector<CTransaction>& vtx_missing) const; + ReadStatus FillBlock(CBlock& block, const std::vector<std::shared_ptr<const CTransaction>>& vtx_missing) const; }; #endif |