5#ifndef BITCOIN_BLOCKENCODINGS_H
6#define BITCOIN_BLOCKENCODINGS_H
45 std::vector<CTransactionRef>
txn;
64 template <
typename Stream>
void SerData(Stream &s) { s <<
tx; }
65 template <
typename Stream>
void UnserData(Stream &s) { s >>
tx; }
112 const uint64_t
nonce);
122 obj.header, obj.nonce,
128 if (ser_action.ForRead()) {
129 if (obj.prefilledtxn.size() > 0) {
133 uint64_t highestPrefilledIndex = obj.prefilledtxn.back().index;
136 if (highestPrefilledIndex + obj.shorttxids.size() >
137 std::numeric_limits<uint32_t>::max()) {
138 throw std::ios_base::failure(
"indexes overflowed 32 bits");
144 if (highestPrefilledIndex >= obj.BlockTxCount()) {
145 throw std::ios_base::failure(
"non contiguous indexes");
151 obj.FillShortTxIDSelector();
160 return lhs->GetHash() == rhs->GetHash();
192 const std::vector<CTransactionRef> &extra_txn);
195 const std::vector<CTransactionRef> &vtx_missing);
enum ReadStatus_t ReadStatus
std::vector< CTransactionRef > txn
BlockTransactions(const BlockTransactionsRequest &req)
BlockTransactions()=default
SERIALIZE_METHODS(BlockTransactions, obj)
std::vector< uint32_t > indices
SERIALIZE_METHODS(BlockTransactionsRequest, obj)
size_t BlockTxCount() const
uint64_t GetShortID(const TxHash &txhash) const
CBlockHeaderAndShortTxIDs()=default
Dummy for deserialization.
void FillShortTxIDSelector() const
SERIALIZE_METHODS(CBlockHeaderAndShortTxIDs, obj)
std::vector< PrefilledTransaction > prefilledtxn
static constexpr int SHORTTXIDS_LENGTH
std::vector< uint64_t > shorttxids
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
std::function< bool(const CBlock &)> IsBlockMutatedFn
IsBlockMutatedFn m_check_block_mutated_mock
ReadStatus InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, const std::vector< CTransactionRef > &extra_txn)
bool IsTxAvailable(size_t index) const
ReadStatus FillBlock(CBlock &block, const std::vector< CTransactionRef > &vtx_missing)
PartiallyDownloadedBlock(const Config &configIn, CTxMemPool *poolIn)
std::shared_ptr< TransactionShortIdProcessor > shortidProcessor
std::shared_ptr< const CTransaction > CTransactionRef
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
A BlockHash is a unqiue identifier for a block.
Parameters that influence chain consensus.
bool operator()(const CTransactionRef &lhs, const CTransactionRef &rhs) const
void UnserData(Stream &s)
uint32_t getIndex(const PrefilledTransaction &pt) const
CTransactionRef getItem(const PrefilledTransaction &pt) const
A TxHash is the double sha256 hash of the full transaction data.