Skip to content

Commit 6e9e4e6

Browse files
committed
Use ParamsWrapper for witness serialization
1 parent 5800c55 commit 6e9e4e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+226
-219
lines changed

src/bench/checkblock.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void DeserializeBlockTest(benchmark::Bench& bench)
2424

2525
bench.unit("block").run([&] {
2626
CBlock block;
27-
stream >> block;
27+
stream >> TX_WITH_WITNESS(block);
2828
bool rewound = stream.Rewind(benchmark::data::block413567.size());
2929
assert(rewound);
3030
});
@@ -41,7 +41,7 @@ static void DeserializeAndCheckBlockTest(benchmark::Bench& bench)
4141

4242
bench.unit("block").run([&] {
4343
CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here
44-
stream >> block;
44+
stream >> TX_WITH_WITNESS(block);
4545
bool rewound = stream.Rewind(benchmark::data::block413567.size());
4646
assert(rewound);
4747

src/bench/rpc_blockchain.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct TestBlockAndIndex {
2727
std::byte a{0};
2828
stream.write({&a, 1}); // Prevent compaction
2929

30-
stream >> block;
30+
stream >> TX_WITH_WITNESS(block);
3131

3232
blockHash = block.GetHash();
3333
blockindex.phashBlock = &blockHash;

src/bench/verify_script.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void VerifyScriptBench(benchmark::Bench& bench)
6262

6363
#if defined(HAVE_CONSENSUS_LIB)
6464
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
65-
stream << txSpend;
65+
stream << TX_WITH_WITNESS(txSpend);
6666
int csuccess = bitcoinconsensus_verify_script_with_amount(
6767
txCredit.vout[0].scriptPubKey.data(),
6868
txCredit.vout[0].scriptPubKey.size(),

src/blockencodings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class BlockTransactions {
6565

6666
SERIALIZE_METHODS(BlockTransactions, obj)
6767
{
68-
READWRITE(obj.blockhash, Using<VectorFormatter<TransactionCompression>>(obj.txn));
68+
READWRITE(obj.blockhash, TX_WITH_WITNESS(Using<VectorFormatter<TransactionCompression>>(obj.txn)));
6969
}
7070
};
7171

@@ -76,7 +76,7 @@ struct PrefilledTransaction {
7676
uint16_t index;
7777
CTransactionRef tx;
7878

79-
SERIALIZE_METHODS(PrefilledTransaction, obj) { READWRITE(COMPACTSIZE(obj.index), Using<TransactionCompression>(obj.tx)); }
79+
SERIALIZE_METHODS(PrefilledTransaction, obj) { READWRITE(COMPACTSIZE(obj.index), TX_WITH_WITNESS(Using<TransactionCompression>(obj.tx))); }
8080
};
8181

8282
typedef enum ReadStatus_t

src/consensus/tx_check.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ bool CheckTransaction(const CTransaction& tx, TxValidationState& state)
1616
if (tx.vout.empty())
1717
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vout-empty");
1818
// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
19-
if (::GetSerializeSize(tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
19+
if (::GetSerializeSize(TX_NO_WITNESS(tx)) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT) {
2020
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-oversize");
21+
}
2122

2223
// Check for negative or overflow output values (see CVE-2010-5139)
2324
CAmount nValueOut = 0;

src/consensus/validation.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ class BlockValidationState : public ValidationState<BlockValidationResult> {};
149149
// weight = (stripped_size * 3) + total_size.
150150
static inline int32_t GetTransactionWeight(const CTransaction& tx)
151151
{
152-
return ::GetSerializeSize(tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(tx, PROTOCOL_VERSION);
152+
return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx));
153153
}
154154
static inline int64_t GetBlockWeight(const CBlock& block)
155155
{
156-
return ::GetSerializeSize(block, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(block, PROTOCOL_VERSION);
156+
return ::GetSerializeSize(TX_NO_WITNESS(block)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(block));
157157
}
158158
static inline int64_t GetTransactionInputWeight(const CTxIn& txin)
159159
{
160160
// scriptWitness size is added here because witnesses and txins are split up in segwit serialization.
161-
return ::GetSerializeSize(txin, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(txin, PROTOCOL_VERSION) + ::GetSerializeSize(txin.scriptWitness.stack, PROTOCOL_VERSION);
161+
return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack);
162162
}
163163

164164
/** Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found */

src/core_io.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ bool ParseHashStr(const std::string& strHex, uint256& result);
5151
// core_write.cpp
5252
UniValue ValueFromAmount(const CAmount amount);
5353
std::string FormatScript(const CScript& script);
54-
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
54+
std::string EncodeHexTx(const CTransaction& tx, const bool without_witness = false);
5555
std::string SighashToStr(unsigned char sighash_type);
5656
void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false, const SigningProvider* provider = nullptr);
57-
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS);
57+
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex = true, bool without_witness = false, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS);
5858

5959
#endif // BITCOIN_CORE_IO_H

src/core_read.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
142142
// Try decoding with extended serialization support, and remember if the result successfully
143143
// consumes the entire input.
144144
if (try_witness) {
145-
CDataStream ssData(tx_data, SER_NETWORK, PROTOCOL_VERSION);
145+
DataStream ssData(tx_data);
146146
try {
147-
ssData >> tx_extended;
147+
ssData >> TX_WITH_WITNESS(tx_extended);
148148
if (ssData.empty()) ok_extended = true;
149149
} catch (const std::exception&) {
150150
// Fall through.
@@ -160,9 +160,9 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
160160

161161
// Try decoding with legacy serialization, and remember if the result successfully consumes the entire input.
162162
if (try_no_witness) {
163-
CDataStream ssData(tx_data, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
163+
DataStream ssData(tx_data);
164164
try {
165-
ssData >> tx_legacy;
165+
ssData >> TX_NO_WITNESS(tx_legacy);
166166
if (ssData.empty()) ok_legacy = true;
167167
} catch (const std::exception&) {
168168
// Fall through.
@@ -222,9 +222,9 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
222222
return false;
223223

224224
std::vector<unsigned char> blockData(ParseHex(strHexBlk));
225-
CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION);
225+
DataStream ssBlock(blockData);
226226
try {
227-
ssBlock >> block;
227+
ssBlock >> TX_WITH_WITNESS(block);
228228
}
229229
catch (const std::exception&) {
230230
return false;

src/core_write.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,14 @@ std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDeco
140140
return str;
141141
}
142142

143-
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags)
143+
std::string EncodeHexTx(const CTransaction& tx, const bool without_witness)
144144
{
145-
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | serializeFlags);
146-
ssTx << tx;
145+
DataStream ssTx;
146+
if (without_witness) {
147+
ssTx << TX_NO_WITNESS(tx);
148+
} else {
149+
ssTx << TX_WITH_WITNESS(tx);
150+
}
147151
return HexStr(ssTx);
148152
}
149153

@@ -168,7 +172,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex, bool i
168172
out.pushKV("type", GetTxnOutputType(type));
169173
}
170174

171-
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo, TxVerbosity verbosity)
175+
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, bool without_witness, const CTxUndo* txundo, TxVerbosity verbosity)
172176
{
173177
CHECK_NONFATAL(verbosity >= TxVerbosity::SHOW_DETAILS);
174178

@@ -177,7 +181,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
177181
// Transaction version is actually unsigned in consensus checks, just signed in memory,
178182
// so cast to unsigned before giving it to the user.
179183
entry.pushKV("version", static_cast<int64_t>(static_cast<uint32_t>(tx.nVersion)));
180-
entry.pushKV("size", (int)::GetSerializeSize(tx, PROTOCOL_VERSION));
184+
entry.pushKV("size", tx.GetTotalSize());
181185
entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);
182186
entry.pushKV("weight", GetTransactionWeight(tx));
183187
entry.pushKV("locktime", (int64_t)tx.nLockTime);
@@ -264,6 +268,6 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
264268
}
265269

266270
if (include_hex) {
267-
entry.pushKV("hex", EncodeHexTx(tx, serialize_flags)); // The hex-encoded transaction. Used the name "hex" to be consistent with the verbose output of "getrawtransaction".
271+
entry.pushKV("hex", EncodeHexTx(tx, without_witness)); // The hex-encoded transaction. Used the name "hex" to be consistent with the verbose output of "getrawtransaction".
268272
}
269273
}

src/index/txindex.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool TxIndex::CustomAppend(const interfaces::BlockInfo& block)
6565
vPos.reserve(block.data->vtx.size());
6666
for (const auto& tx : block.data->vtx) {
6767
vPos.emplace_back(tx->GetHash(), pos);
68-
pos.nTxOffset += ::GetSerializeSize(*tx, CLIENT_VERSION);
68+
pos.nTxOffset += ::GetSerializeSize(TX_WITH_WITNESS(*tx));
6969
}
7070
return m_db->WriteTxs(vPos);
7171
}
@@ -89,7 +89,7 @@ bool TxIndex::FindTx(const uint256& tx_hash, uint256& block_hash, CTransactionRe
8989
if (fseek(file.Get(), postx.nTxOffset, SEEK_CUR)) {
9090
return error("%s: fseek(...) failed", __func__);
9191
}
92-
file >> tx;
92+
file >> TX_WITH_WITNESS(tx);
9393
} catch (const std::exception& e) {
9494
return error("%s: Deserialize or I/O error - %s", __func__, e.what());
9595
}

src/interfaces/chain.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class Chain
335335
virtual void rpcRunLater(const std::string& name, std::function<void()> fn, int64_t seconds) = 0;
336336

337337
//! Current RPC serialization flags.
338-
virtual int rpcSerializationFlags() = 0;
338+
virtual bool rpcSerializationWithoutWitness() = 0;
339339

340340
//! Get settings value.
341341
virtual common::SettingsValue getSetting(const std::string& arg) = 0;

src/kernel/mempool_persist.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool LoadMempool(CTxMemPool& pool, const fs::path& load_path, Chainstate& active
4242
{
4343
if (load_path.empty()) return false;
4444

45-
CAutoFile file{opts.mockable_fopen_function(load_path, "rb"), CLIENT_VERSION};
45+
AutoFile file{opts.mockable_fopen_function(load_path, "rb")};
4646
if (file.IsNull()) {
4747
LogPrintf("Failed to open mempool file from disk. Continuing anyway.\n");
4848
return false;
@@ -74,7 +74,7 @@ bool LoadMempool(CTxMemPool& pool, const fs::path& load_path, Chainstate& active
7474
CTransactionRef tx;
7575
int64_t nTime;
7676
int64_t nFeeDelta;
77-
file >> tx;
77+
file >> TX_WITH_WITNESS(tx);
7878
file >> nTime;
7979
file >> nFeeDelta;
8080

@@ -158,7 +158,7 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
158158

159159
auto mid = SteadyClock::now();
160160

161-
CAutoFile file{mockable_fopen_function(dump_path + ".new", "wb"), CLIENT_VERSION};
161+
AutoFile file{mockable_fopen_function(dump_path + ".new", "wb")};
162162
if (file.IsNull()) {
163163
return false;
164164
}
@@ -176,7 +176,7 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
176176

177177
file << (uint64_t)vinfo.size();
178178
for (const auto& i : vinfo) {
179-
file << *(i.tx);
179+
file << TX_WITH_WITNESS(*(i.tx));
180180
file << int64_t{count_seconds(i.m_time)};
181181
file << int64_t{i.nFeeDelta};
182182
mapDeltas.erase(i.tx->GetHash());

src/net_processing.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -2308,9 +2308,9 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
23082308
}
23092309
if (pblock) {
23102310
if (inv.IsMsgBlk()) {
2311-
m_connman.PushMessage(&pfrom, msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::BLOCK, *pblock));
2311+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, TX_NO_WITNESS(*pblock)));
23122312
} else if (inv.IsMsgWitnessBlk()) {
2313-
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, *pblock));
2313+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, TX_WITH_WITNESS(*pblock)));
23142314
} else if (inv.IsMsgFilteredBlk()) {
23152315
bool sendMerkleBlock = false;
23162316
CMerkleBlock merkleBlock;
@@ -2331,7 +2331,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
23312331
// however we MUST always provide at least what the remote peer needs
23322332
typedef std::pair<unsigned int, uint256> PairType;
23332333
for (PairType& pair : merkleBlock.vMatchedTxn)
2334-
m_connman.PushMessage(&pfrom, msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, *pblock->vtx[pair.first]));
2334+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::TX, TX_NO_WITNESS(*pblock->vtx[pair.first])));
23352335
}
23362336
// else
23372337
// no response
@@ -2348,7 +2348,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
23482348
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::CMPCTBLOCK, cmpctblock));
23492349
}
23502350
} else {
2351-
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, *pblock));
2351+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::BLOCK, TX_WITH_WITNESS(*pblock)));
23522352
}
23532353
}
23542354
}
@@ -2418,8 +2418,8 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
24182418
CTransactionRef tx = FindTxForGetData(*tx_relay, ToGenTxid(inv));
24192419
if (tx) {
24202420
// WTX and WITNESS_TX imply we serialize with witness
2421-
int nSendFlags = (inv.IsMsgTx() ? SERIALIZE_TRANSACTION_NO_WITNESS : 0);
2422-
m_connman.PushMessage(&pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *tx));
2421+
const auto maybe_with_witness = (inv.IsMsgTx() ? TX_NO_WITNESS : TX_WITH_WITNESS);
2422+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::TX, maybe_with_witness(*tx)));
24232423
m_mempool.RemoveUnbroadcastTx(tx->GetHash());
24242424
} else {
24252425
vNotFound.push_back(inv);
@@ -4119,7 +4119,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41194119
LogPrint(BCLog::NET, "Ignoring getheaders from peer=%d because active chain has too little work; sending empty response\n", pfrom.GetId());
41204120
// Just respond with an empty headers message, to tell the peer to
41214121
// go away but not treat us as unresponsive.
4122-
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::HEADERS, std::vector<CBlock>()));
4122+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::HEADERS, std::vector<CBlockHeader>()));
41234123
return;
41244124
}
41254125

@@ -4169,7 +4169,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41694169
// will re-announce the new block via headers (or compact blocks again)
41704170
// in the SendMessages logic.
41714171
nodestate->pindexBestHeaderSent = pindex ? pindex : m_chainman.ActiveChain().Tip();
4172-
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::HEADERS, vHeaders));
4172+
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::HEADERS, TX_WITH_WITNESS(vHeaders)));
41734173
return;
41744174
}
41754175

@@ -4186,7 +4186,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41864186
if (m_chainman.IsInitialBlockDownload()) return;
41874187

41884188
CTransactionRef ptx;
4189-
vRecv >> ptx;
4189+
vRecv >> TX_WITH_WITNESS(ptx);
41904190
const CTransaction& tx = *ptx;
41914191

41924192
const uint256& txid = ptx->GetHash();
@@ -4687,7 +4687,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
46874687
}
46884688

46894689
std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
4690-
vRecv >> *pblock;
4690+
vRecv >> TX_WITH_WITNESS(*pblock);
46914691

46924692
LogPrint(BCLog::NET, "received block %s peer=%d\n", pblock->GetHash().ToString(), pfrom.GetId());
46934693

@@ -5698,7 +5698,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
56985698
LogPrint(BCLog::NET, "%s: sending header %s to peer=%d\n", __func__,
56995699
vHeaders.front().GetHash().ToString(), pto->GetId());
57005700
}
5701-
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::HEADERS, vHeaders));
5701+
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::HEADERS, TX_WITH_WITNESS(vHeaders)));
57025702
state.pindexBestHeaderSent = pBestIndex;
57035703
} else
57045704
fRevertToInv = true;

src/node/blockstorage.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
956956
}
957957

958958
// Write index header
959-
unsigned int nSize = GetSerializeSize(block, fileout.GetVersion());
959+
unsigned int nSize = GetSerializeSize(TX_WITH_WITNESS(block));
960960
fileout << GetParams().MessageStart() << nSize;
961961

962962
// Write block
@@ -965,7 +965,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
965965
return error("WriteBlockToDisk: ftell failed");
966966
}
967967
pos.nPos = (unsigned int)fileOutPos;
968-
fileout << block;
968+
fileout << TX_WITH_WITNESS(block);
969969

970970
return true;
971971
}
@@ -1023,7 +1023,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos) cons
10231023

10241024
// Read block
10251025
try {
1026-
filein >> block;
1026+
filein >> TX_WITH_WITNESS(block);
10271027
} catch (const std::exception& e) {
10281028
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
10291029
}
@@ -1092,7 +1092,7 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF
10921092

10931093
FlatFilePos BlockManager::SaveBlockToDisk(const CBlock& block, int nHeight, const FlatFilePos* dbp)
10941094
{
1095-
unsigned int nBlockSize = ::GetSerializeSize(block, CLIENT_VERSION);
1095+
unsigned int nBlockSize = ::GetSerializeSize(TX_WITH_WITNESS(block));
10961096
FlatFilePos blockPos;
10971097
const auto position_known {dbp != nullptr};
10981098
if (position_known) {

src/node/interfaces.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ class ChainImpl : public Chain
775775
{
776776
RPCRunLater(name, std::move(fn), seconds);
777777
}
778-
int rpcSerializationFlags() override { return RPCSerializationFlags(); }
778+
bool rpcSerializationWithoutWitness() override { return RPCSerializationWithoutWitness(); }
779779
common::SettingsValue getSetting(const std::string& name) override
780780
{
781781
return args().GetSetting(name);

0 commit comments

Comments
 (0)