mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-29 03:38:10 -07:00
global: snapshot
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user