Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
blockencodings.cpp
Go to the documentation of this file.
24 //TODO: Use our mempool prior to block acceptance to predictively fill more than just the coinbase
50 ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn) {
51 if (cmpctblock.header.IsNull() || (cmpctblock.shorttxids.empty() && cmpctblock.prefilledtxn.empty()))
53 if (cmpctblock.shorttxids.size() + cmpctblock.prefilledtxn.size() > MaxBlockSize(true) / MIN_TRANSACTION_SIZE)
65 lastprefilledindex += cmpctblock.prefilledtxn[i].index + 1; //index is a uint16_t, so can't overflow here
167 LogPrint(BCLog::CMPCTBLOCK, "Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), GetSerializeSize(cmpctblock, SER_NETWORK, PROTOCOL_VERSION));
178 ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing) {
212 LogPrint(BCLog::CMPCTBLOCK, "Successfully reconstructed block %s with %lu txn prefilled, %lu txn from mempool (incl at least %lu from extra pool) and %lu txn requested\n", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size());
215 LogPrint(BCLog::CMPCTBLOCK, "Reconstructed block %s required tx %s\n", hash.ToString(), tx->GetHash().ToString());
enum ReadStatus_t ReadStatus
CBlockHeaderAndShortTxIDs()
Definition: blockencodings.h:149
ReadStatus FillBlock(CBlock &block, const std::vector< CTransactionRef > &vtx_missing)
Definition: blockencodings.cpp:178
uint64_t GetShortID(const uint256 &txhash) const
Definition: blockencodings.cpp:43
Definition: block.h:72
std::vector< CTransactionRef > txn_available
Definition: blockencodings.h:196
size_t GetSerializeSize(const T &t, int nType, int nVersion=0)
Definition: serialize.h:1295
static const int SHORTTXIDS_LENGTH
Definition: blockencodings.h:140
Definition: box.hpp:161
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
void FillShortTxIDSelector() const
Definition: blockencodings.cpp:32
Definition: util.h:122
std::vector< std::pair< uint256, txiter > > vTxHashes
All tx hashes/entries in mapTx, in random order.
Definition: txmempool.h:492
bool CheckBlock(const CBlock &block, CValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
Functions for validating blocks and updating the block tree.
Definition: validation.cpp:3417
Definition: blockencodings.h:126
Definition: blockencodings.h:131
std::vector< uint64_t > shorttxids
Definition: blockencodings.h:142
std::vector< PrefilledTransaction > prefilledtxn
Definition: blockencodings.h:143
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
bool IsTxAvailable(size_t index) const
Definition: blockencodings.cpp:172
uint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256 &val)
Optimized SipHash-2-4 implementation for uint256.
Definition: hash.cpp:168
Definition: blockencodings.h:124
ReadStatus InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, const std::vector< std::pair< uint256, CTransactionRef >> &extra_txn)
Definition: blockencodings.cpp:50
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
Definition: blockencodings.h:125
Definition: serialize.h:160