diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 9f52a226725..b81878006cd 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 e1a0bf138eb..3682b335187 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -61,7 +61,7 @@ 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); int csuccess = bitcoinconsensus_verify_script_with_amount( txCredit.vout[0].scriptPubKey.data(), diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index 8b68d04b2bf..96387e8c71e 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 29306b22290..1e940e8f03e 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -164,7 +164,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(cmpctblock, PROTOCOL_VERSION)); + 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 b44d920ee1f..f576fae7488 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(); } @@ -339,7 +338,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 3fdc01e66b9..1556c7888f9 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 bffb9e90425..e32e46d1b9b 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 102c58b56aa..15024f6e0f2 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 132e1a9fb39..52babf8b1d9 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 5fda798efd6..58f777b3266 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 9bd755ed271..302638cdbea 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 16312cf72d4..aa75df075d7 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 1108cc676b6..c066d1c939f 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -662,7 +662,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 @@ -979,7 +979,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/primitives/transaction.cpp b/src/primitives/transaction.cpp index 6650277c2b6..82fb59d3494 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 76a2fd82417..e46032f5d50 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -8,6 +8,7 @@ #include