diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 9f52a22672..b81878006c 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -18,7 +18,7 @@ static void DeserializeBlockTest(benchmark::Bench& bench) { - CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION); + DataStream stream(benchmark::data::block413567); std::byte a{0}; stream.write({&a, 1}); // Prevent compaction @@ -32,7 +32,7 @@ static void DeserializeBlockTest(benchmark::Bench& bench) static void DeserializeAndCheckBlockTest(benchmark::Bench& bench) { - CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION); + DataStream stream(benchmark::data::block413567); std::byte a{0}; stream.write({&a, 1}); // Prevent compaction diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index 5ab439180f..63617c5cf3 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -62,9 +62,9 @@ static void VerifyScriptBench(benchmark::Bench& bench) assert(success); #if defined(HAVE_CONSENSUS_LIB) - CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); + DataStream stream; stream << TX_WITH_WITNESS(txSpend); - CDataStream streamVal(SER_NETWORK, PROTOCOL_VERSION); + DataStream streamVal; streamVal << txCredit.vout[0].nValue; int csuccess = bitcoinconsensus_verify_script_with_amount( nullptr, diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index 3a32943af4..b99b812e92 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index cba7881a1d..6adaa2b368 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -170,7 +170,7 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c break; } - LogPrint(BCLog::CMPCTBLOCK, "Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), GetSerializeSize(TX_WITH_WITNESS(cmpctblock))); + LogPrint(BCLog::CMPCTBLOCK, "Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), GetSerializeSize(cmpctblock)); return READ_STATUS_OK; } diff --git a/src/coins.cpp b/src/coins.cpp index 243b6f408d..a52b9a6286 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -8,7 +8,6 @@ #include #include #include -#include bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; } uint256 CCoinsView::GetBestBlock() const { return uint256(); } @@ -429,7 +428,7 @@ void CCoinsViewCache::SanityCheck() const assert(recomputed_usage == cachedCoinsUsage); } -static const size_t MIN_TRANSACTION_OUTPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxOut(), PROTOCOL_VERSION); +static const size_t MIN_TRANSACTION_OUTPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxOut()); static const size_t MAX_OUTPUTS_PER_BLOCK = MAX_BLOCK_WEIGHT / MIN_TRANSACTION_OUTPUT_WEIGHT; const Coin& AccessByTxid(const CCoinsViewCache& view, const uint256& txid) diff --git a/src/consensus/validation.h b/src/consensus/validation.h index 6f0cebde01..300242f387 100644 --- a/src/consensus/validation.h +++ b/src/consensus/validation.h @@ -7,7 +7,6 @@ #define BITCOIN_CONSENSUS_VALIDATION_H #include -#include #include #include #include diff --git a/src/core_read.cpp b/src/core_read.cpp index 65bf5b0b8e..381ed89dc1 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/src/external_signer.cpp b/src/external_signer.cpp index d5b646d77a..06ef9a7c21 100644 --- a/src/external_signer.cpp +++ b/src/external_signer.cpp @@ -2,12 +2,14 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include + #include #include #include #include #include -#include +#include #include #include diff --git a/src/hash.h b/src/hash.h index 132e1a9fb3..52babf8b1d 100644 --- a/src/hash.h +++ b/src/hash.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp index 5fda798efd..58f777b326 100644 --- a/src/index/blockfilterindex.cpp +++ b/src/index/blockfilterindex.cpp @@ -174,8 +174,8 @@ size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter& assert(filter.GetFilterType() == GetFilterType()); size_t data_size = - GetSerializeSize(filter.GetBlockHash(), CLIENT_VERSION) + - GetSerializeSize(filter.GetEncodedFilter(), CLIENT_VERSION); + GetSerializeSize(filter.GetBlockHash()) + + GetSerializeSize(filter.GetEncodedFilter()); // If writing the filter would overflow the file, flush and move to the next one. if (pos.nPos + data_size > MAX_FLTR_FILE_SIZE) { diff --git a/src/kernel/coinstats.cpp b/src/kernel/coinstats.cpp index 01b73953b9..51fbf9742c 100644 --- a/src/kernel/coinstats.cpp +++ b/src/kernel/coinstats.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/src/net.h b/src/net.h index 0be7939299..8a9dac53e8 100644 --- a/src/net.h +++ b/src/net.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index e4f10e8826..517a997300 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -755,7 +755,7 @@ bool BlockManager::UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos } // Write index header - unsigned int nSize = GetSerializeSize(blockundo, CLIENT_VERSION); + unsigned int nSize = GetSerializeSize(blockundo); fileout << GetParams().MessageStart() << nSize; // Write undo data @@ -1071,7 +1071,7 @@ bool BlockManager::WriteUndoDataForBlock(const CBlockUndo& blockundo, BlockValid // Write undo information to disk if (block.GetUndoPos().IsNull()) { FlatFilePos _pos; - if (!FindUndoPos(state, block.nFile, _pos, ::GetSerializeSize(blockundo, CLIENT_VERSION) + 40)) { + if (!FindUndoPos(state, block.nFile, _pos, ::GetSerializeSize(blockundo) + 40)) { return error("ConnectBlock(): FindUndoPos failed"); } if (!UndoWriteToDisk(blockundo, _pos, block.pprev->GetBlockHash())) { diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 8bb015822d..76c134dafe 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -156,7 +156,7 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc const DynaFedParamEntry current_params = ComputeNextBlockCurrentParameters(m_chainstate.m_chain.Tip(), chainparams.GetConsensus()); const DynaFedParams block_params(current_params, proposed_entry ? *proposed_entry : DynaFedParamEntry()); pblock->m_dynafed_params = block_params; - nBlockWeight += ::GetSerializeSize(block_params, PROTOCOL_VERSION)*WITNESS_SCALE_FACTOR; + nBlockWeight += ::GetSerializeSize(block_params) * WITNESS_SCALE_FACTOR; nBlockWeight += current_params.m_signblock_witness_limit; // Note witness discount assert(pblock->proof.IsNull()); diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 704642148a..b98ae42d66 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/src/psbt.cpp b/src/psbt.cpp index a10741826a..e08140ce1a 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -12,6 +12,7 @@ #include