global: snapshot

This commit is contained in:
nym21
2026-03-04 17:10:15 +01:00
parent 891f0dad9e
commit 9e23de4ba1
313 changed files with 9087 additions and 4918 deletions
+4 -6
View File
@@ -28,10 +28,9 @@ impl BlockProcessor<'_> {
.blockhashprefix_to_height
.insert(blockhash_prefix, height);
self.stores.height_to_coinbase_tag.insert(
height,
self.block.coinbase_tag().into(),
);
self.stores
.height_to_coinbase_tag
.insert(height, self.block.coinbase_tag().into());
self.vecs
.blocks
@@ -52,8 +51,7 @@ impl BlockProcessor<'_> {
/// Push block total_size and weight, reusing per-tx sizes already computed in ComputedTx.
/// This avoids redundant tx serialization (base_size + total_size were already computed).
pub fn push_block_size_and_weight(&mut self, txs: &[ComputedTx]) -> Result<()> {
let overhead =
bitcoin::block::Header::SIZE + bitcoin::VarInt::from(txs.len()).size();
let overhead = bitcoin::block::Header::SIZE + bitcoin::VarInt::from(txs.len()).size();
let mut total_size = overhead;
let mut weight_wu = overhead * 4;
for ct in txs {
+2 -4
View File
@@ -20,8 +20,7 @@ impl<'a> BlockProcessor<'a> {
.par_iter()
.enumerate()
.map(|(index, tx)| {
let (btc_txid, base_size, total_size) =
self.block.compute_tx_id_and_sizes(index);
let (btc_txid, base_size, total_size) = self.block.compute_tx_id_and_sizes(index);
let txid = Txid::from(btc_txid);
let txid_prefix = TxidPrefix::from(&txid);
@@ -105,8 +104,7 @@ pub(super) fn store_tx_metadata(
md.txid.checked_push(ct.txindex, ct.txid)?;
md.rawlocktime
.checked_push(ct.txindex, ct.tx.lock_time.into())?;
md.base_size
.checked_push(ct.txindex, ct.base_size.into())?;
md.base_size.checked_push(ct.txindex, ct.base_size.into())?;
md.total_size
.checked_push(ct.txindex, ct.total_size.into())?;
md.is_explicitly_rbf
@@ -56,4 +56,3 @@ pub struct BlockBuffers {
pub already_added_addresses: ByAddressType<FxHashMap<AddressHash, TypeIndex>>,
pub same_block_output_info: FxHashMap<OutPoint, SameBlockOutputInfo>,
}