Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-L2L committed Jan 2, 2025
1 parent 1b4c3e0 commit c7241e5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 5 additions & 2 deletions app/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::{collections::HashMap, net::SocketAddr, sync::Arc};
use std::{
collections::{HashMap, HashSet},
net::SocketAddr,
sync::Arc,
};

use eframe::egui::ahash::HashSet;
use futures::{StreamExt, TryFutureExt, TryStreamExt as _};
use parking_lot::RwLock;
use rustreexo::accumulator::proof::Proof;
Expand Down
1 change: 1 addition & 0 deletions app/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ fn main() -> anyhow::Result<()> {
});
});
if config.headless {
drop(line_buffer);
let _app = app?;
// wait for ctrlc signal
let (tx, rx) = mpsc::channel();
Expand Down
2 changes: 0 additions & 2 deletions lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ pub use heed;
pub fn format_deposit_address(dest: types::Address) -> String {
format!("s{}_{}", types::THIS_SIDECHAIN, dest.to_base58ck())
}

// TODO: Add error log.
7 changes: 3 additions & 4 deletions lib/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ struct RollBack<T>(NonEmpty<HeightStamped<T>>);

impl<T> RollBack<T> {
fn new(value: T, height: u32) -> Self {
let txid_stamped = HeightStamped { value, height };
Self(nonempty![txid_stamped])
let height_stamped = HeightStamped { value, height };
Self(nonempty![height_stamped])
}

/// Pop the most recent value
Expand Down Expand Up @@ -713,21 +713,20 @@ impl State {
if let Some(bundle) =
self.collect_withdrawal_bundle(rwtxn, block_height)?
{
let m6id = bundle.compute_m6id();
for (outpoint, spend_output) in bundle.spend_utxos() {
let utxo_hash = hash(&PointedOutput {
outpoint: *outpoint,
output: spend_output.clone(),
});
accumulator_del.insert(utxo_hash.into());
self.utxos.delete(rwtxn, outpoint)?;
let m6id = bundle.compute_m6id();
let spent_output = SpentOutput {
output: spend_output.clone(),
inpoint: InPoint::Withdrawal { m6id },
};
self.stxos.put(rwtxn, outpoint, &spent_output)?;
}
let m6id = bundle.compute_m6id();
self.pending_withdrawal_bundle.put(
rwtxn,
&UnitKey,
Expand Down

0 comments on commit c7241e5

Please sign in to comment.