diff --git a/lib/state/block.rs b/lib/state/block.rs index fc40427..260212a 100644 --- a/lib/state/block.rs +++ b/lib/state/block.rs @@ -563,14 +563,13 @@ pub fn disconnect_tip( .try_for_each(|(outpoint, utxo_hash)| { let key = OutPointKey::from(outpoint); if let Some(spent_output) = - state.stxos.try_get(rwtxn, &key).map_err(DbError::from)? + state.stxos.try_get(rwtxn, &key)? { accumulator_diff.insert(utxo_hash.into()); - state.stxos.delete(rwtxn, &key).map_err(DbError::from)?; + state.stxos.delete(rwtxn, &key)?; state .utxos - .put(rwtxn, &key, &spent_output.output) - .map_err(DbError::from)?; + .put(rwtxn, &key, &spent_output.output)?; Ok(()) } else { Err(Error::NoStxo { diff --git a/lib/state/mod.rs b/lib/state/mod.rs index 571c494..25ed6ab 100644 --- a/lib/state/mod.rs +++ b/lib/state/mod.rs @@ -43,7 +43,8 @@ pub struct PrevalidatedBlock { pub computed_merkle_root: MerkleRoot, pub total_fees: bitcoin::Amount, pub coinbase_value: bitcoin::Amount, - pub next_height: u32, // Precomputed next height to avoid DB read in write txn + /// Precomputed next height to avoid DB read in write txn + pub next_height: u32, pub accumulator_diff: crate::types::AccumulatorDiff, }