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 144 Lines • Show Last 20 Lines |