diff options
author | Anthony Towns <aj@erisian.com.au> | 2023-09-07 19:16:57 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2023-11-14 08:45:30 +1000 |
commit | 6e9e4e6130797b721c8df1eabaf46ec25ebb6abe (patch) | |
tree | 6444c337cd23d1e6aabedf229a9efb1583fb7351 /src/node | |
parent | 5800c558eb5efb4839ed00d6967e43306d68e1c3 (diff) | |
download | bitcoin-6e9e4e6130797b721c8df1eabaf46ec25ebb6abe.tar.xz |
Use ParamsWrapper for witness serialization
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/blockstorage.cpp | 8 | ||||
-rw-r--r-- | src/node/interfaces.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 058e524745..1108cc676b 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -956,7 +956,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const } // Write index header - unsigned int nSize = GetSerializeSize(block, fileout.GetVersion()); + unsigned int nSize = GetSerializeSize(TX_WITH_WITNESS(block)); fileout << GetParams().MessageStart() << nSize; // Write block @@ -965,7 +965,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const return error("WriteBlockToDisk: ftell failed"); } pos.nPos = (unsigned int)fileOutPos; - fileout << block; + fileout << TX_WITH_WITNESS(block); return true; } @@ -1023,7 +1023,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos) cons // Read block try { - filein >> block; + filein >> TX_WITH_WITNESS(block); } catch (const std::exception& e) { return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString()); } @@ -1092,7 +1092,7 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF FlatFilePos BlockManager::SaveBlockToDisk(const CBlock& block, int nHeight, const FlatFilePos* dbp) { - unsigned int nBlockSize = ::GetSerializeSize(block, CLIENT_VERSION); + unsigned int nBlockSize = ::GetSerializeSize(TX_WITH_WITNESS(block)); FlatFilePos blockPos; const auto position_known {dbp != nullptr}; if (position_known) { diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 5ec7e17b26..f4ecfeb9d5 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -775,7 +775,7 @@ public: { RPCRunLater(name, std::move(fn), seconds); } - int rpcSerializationFlags() override { return RPCSerializationFlags(); } + bool rpcSerializationWithoutWitness() override { return RPCSerializationWithoutWitness(); } common::SettingsValue getSetting(const std::string& name) override { return args().GetSetting(name); |