Use ParamsWrapper for witness serialization

This commit is contained in:
Anthony Towns
2023-09-07 19:16:57 +10:00
parent 5800c558eb
commit 6e9e4e6130
59 changed files with 226 additions and 219 deletions

View File

@@ -65,7 +65,7 @@ bool TxIndex::CustomAppend(const interfaces::BlockInfo& block)
vPos.reserve(block.data->vtx.size());
for (const auto& tx : block.data->vtx) {
vPos.emplace_back(tx->GetHash(), pos);
pos.nTxOffset += ::GetSerializeSize(*tx, CLIENT_VERSION);
pos.nTxOffset += ::GetSerializeSize(TX_WITH_WITNESS(*tx));
}
return m_db->WriteTxs(vPos);
}
@@ -89,7 +89,7 @@ bool TxIndex::FindTx(const uint256& tx_hash, uint256& block_hash, CTransactionRe
if (fseek(file.Get(), postx.nTxOffset, SEEK_CUR)) {
return error("%s: fseek(...) failed", __func__);
}
file >> tx;
file >> TX_WITH_WITNESS(tx);
} catch (const std::exception& e) {
return error("%s: Deserialize or I/O error - %s", __func__, e.what());
}