Changeset View
Changeset View
Standalone View
Standalone View
src/blockencodings.h
// Copyright (c) 2016 The Bitcoin Core developers | // Copyright (c) 2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_BLOCK_ENCODINGS_H | #ifndef BITCOIN_BLOCK_ENCODINGS_H | ||||
#define BITCOIN_BLOCK_ENCODINGS_H | #define BITCOIN_BLOCK_ENCODINGS_H | ||||
#include "primitives/block.h" | #include "primitives/block.h" | ||||
#include "rwcollection.h" | |||||
#include <memory> | #include <memory> | ||||
class Config; | class Config; | ||||
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 { | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
CBlockHeader header; | CBlockHeader header; | ||||
PartiallyDownloadedBlock(const Config &configIn, CTxMemPool *poolIn) | PartiallyDownloadedBlock(const Config &configIn, CTxMemPool *poolIn) | ||||
: 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( | ||||
InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, | const CBlockHeaderAndShortTxIDs &cmpctblock, | ||||
const std::vector<std::pair<uint256, CTransactionRef>> &extra_txn); | const RWCollection<std::vector<std::pair<uint256, CTransactionRef>>>:: | ||||
ReadView 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 |