Skip to content

Commit 2bd507a

Browse files
giaki3003Ash-L2L
authored andcommitted
[perf]: backport changes from thunder perf hackathon (#68)
* [perf]: backport changes from thunder perf hackathon * [misc] Fix std dep order, add comments * [cli] remove mimalloc from cli * [fix] smallvec usage * [misc] Add comments for LMDB flags * [fix] Switch to Borsh and add small test for OutpointKey * [fix] make in/out tracking explicit as per suggestion * [fix] Adjust import ordering * [fix] clarify counts() use, rm into_parts() and explicit deconstruct * [fix] explicit From
1 parent 5d04d03 commit 2bd507a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/state/block.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,13 @@ pub fn disconnect_tip(
563563
.try_for_each(|(outpoint, utxo_hash)| {
564564
let key = OutPointKey::from(outpoint);
565565
if let Some(spent_output) =
566-
state.stxos.try_get(rwtxn, &key).map_err(DbError::from)?
566+
state.stxos.try_get(rwtxn, &key)?
567567
{
568568
accumulator_diff.insert(utxo_hash.into());
569-
state.stxos.delete(rwtxn, &key).map_err(DbError::from)?;
569+
state.stxos.delete(rwtxn, &key)?;
570570
state
571571
.utxos
572-
.put(rwtxn, &key, &spent_output.output)
573-
.map_err(DbError::from)?;
572+
.put(rwtxn, &key, &spent_output.output)?;
574573
Ok(())
575574
} else {
576575
Err(Error::NoStxo {

lib/state/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ pub struct PrevalidatedBlock {
4343
pub computed_merkle_root: MerkleRoot,
4444
pub total_fees: bitcoin::Amount,
4545
pub coinbase_value: bitcoin::Amount,
46-
pub next_height: u32, // Precomputed next height to avoid DB read in write txn
46+
/// Precomputed next height to avoid DB read in write txn
47+
pub next_height: u32,
4748
pub accumulator_diff: crate::types::AccumulatorDiff,
4849
}
4950

0 commit comments

Comments
 (0)