aboutsummaryrefslogtreecommitdiff
path: root/src/blockencodings.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-11-10 17:34:17 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-11-19 17:53:23 -0800
commitb4e4ba475a5679e09f279aaf2a83dcf93c632bdb (patch)
tree31f4d8edd5134e92bf133ee3dfd52651c14ed21e /src/blockencodings.h
parent1662b437b33b7ec5a1723f6ae6187d3bdd06f593 (diff)
Introduce convenience type CTransactionRef
Diffstat (limited to 'src/blockencodings.h')
-rw-r--r--src/blockencodings.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blockencodings.h b/src/blockencodings.h
index ffe189a940..27baf1f8f8 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:
- std::shared_ptr<const CTransaction>& tx;
+ CTransactionRef& tx;
public:
- TransactionCompressor(std::shared_ptr<const CTransaction>& txIn) : tx(txIn) {}
+ TransactionCompressor(CTransactionRef& txIn) : tx(txIn) {}
ADD_SERIALIZE_METHODS;
@@ -72,7 +72,7 @@ class BlockTransactions {
public:
// A BlockTransactions message
uint256 blockhash;
- std::vector<std::shared_ptr<const CTransaction>> txn;
+ std::vector<CTransactionRef> 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;
- std::shared_ptr<const CTransaction> tx;
+ CTransactionRef tx;
ADD_SERIALIZE_METHODS;
@@ -193,7 +193,7 @@ public:
class PartiallyDownloadedBlock {
protected:
- std::vector<std::shared_ptr<const CTransaction> > txn_available;
+ std::vector<CTransactionRef> txn_available;
size_t prefilled_count = 0, mempool_count = 0;
CTxMemPool* pool;
public:
@@ -202,7 +202,7 @@ public:
ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock);
bool IsTxAvailable(size_t index) const;
- ReadStatus FillBlock(CBlock& block, const std::vector<std::shared_ptr<const CTransaction>>& vtx_missing) const;
+ ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing) const;
};
#endif