Changeset View
Changeset View
Standalone View
Standalone View
src/blockencodings.h
Show All 12 Lines | |||||
class CTxMemPool; | class CTxMemPool; | ||||
// Dumb helper to handle CTransaction compression at serialize-time | // Dumb helper to handle CTransaction compression at serialize-time | ||||
struct TransactionCompressor { | struct TransactionCompressor { | ||||
private: | private: | ||||
CTransactionRef &tx; | CTransactionRef &tx; | ||||
public: | public: | ||||
TransactionCompressor(CTransactionRef &txIn) : tx(txIn) {} | explicit TransactionCompressor(CTransactionRef &txIn) : tx(txIn) {} | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
// TODO: Compress tx encoding | // TODO: Compress tx encoding | ||||
READWRITE(tx); | READWRITE(tx); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
class BlockTransactions { | class BlockTransactions { | ||||
public: | public: | ||||
// A BlockTransactions message | // A BlockTransactions message | ||||
uint256 blockhash; | uint256 blockhash; | ||||
std::vector<CTransactionRef> txn; | std::vector<CTransactionRef> txn; | ||||
BlockTransactions() {} | BlockTransactions() {} | ||||
BlockTransactions(const BlockTransactionsRequest &req) | explicit BlockTransactions(const BlockTransactionsRequest &req) | ||||
: blockhash(req.blockhash), txn(req.indices.size()) {} | : blockhash(req.blockhash), txn(req.indices.size()) {} | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(blockhash); | READWRITE(blockhash); | ||||
uint64_t txn_size = (uint64_t)txn.size(); | uint64_t txn_size = (uint64_t)txn.size(); | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
protected: | protected: | ||||
std::vector<CTransactionRef> txns_available; | std::vector<CTransactionRef> txns_available; | ||||
size_t prefilled_count = 0, mempool_count = 0, extra_count = 0; | size_t prefilled_count = 0, mempool_count = 0, extra_count = 0; | ||||
CTxMemPool *pool; | CTxMemPool *pool; | ||||
const Config *config; | const Config *config; | ||||
public: | public: | ||||
CBlockHeader header; | CBlockHeader header; | ||||
PartiallyDownloadedBlock(const Config &configIn, CTxMemPool *poolIn) | PartiallyDownloadedBlock(const Config &configIn, CTxMemPool *poolIn) | ||||
jasonbcox: Missed one | |||||
FabienAuthorUnsubmitted Done Inline ActionsThis backport is only about single argument constructors Fabien: This backport is only about single argument constructors | |||||
: pool(poolIn), config(&configIn) {} | : pool(poolIn), config(&configIn) {} | ||||
// extra_txn is a list of extra transactions to look at, in <txhash, | // extra_txn is a list of extra transactions to look at, in <txhash, | ||||
// reference> form. | // reference> form. | ||||
ReadStatus | ReadStatus | ||||
InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, | InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, | ||||
const std::vector<std::pair<uint256, CTransactionRef>> &extra_txn); | const std::vector<std::pair<uint256, CTransactionRef>> &extra_txn); | ||||
bool IsTxAvailable(size_t index) const; | bool IsTxAvailable(size_t index) const; | ||||
ReadStatus FillBlock(CBlock &block, | ReadStatus FillBlock(CBlock &block, | ||||
const std::vector<CTransactionRef> &vtx_missing); | const std::vector<CTransactionRef> &vtx_missing); | ||||
}; | }; | ||||
#endif | #endif |
Missed one