mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Use ParamsWrapper for witness serialization
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user