Skip to content

Commit

Permalink
Use new MUTXO field abandoned_at in resync and wallet-block updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword-Smith committed Jul 24, 2023
1 parent b24b328 commit 83ab2da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/models/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ impl GlobalState {
'outer: for i in 0..num_monitored_utxos {
let mut monitored_utxo = monitored_utxos.get(i).clone();

// Ignore those MUTXOs that were marked as abandoned
if monitored_utxo.abandoned_at.is_some() {
continue;
}

// ignore synced ones
if monitored_utxo.is_synced_to(&tip_hash) {
continue;
Expand Down
14 changes: 11 additions & 3 deletions src/models/state/wallet/wallet_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,17 @@ impl WalletState {
"Strong key must be unique in wallet DB"
);
}
None => warn!(
"Unable to find valid membership proof for UTXO with digest {utxo_digest}"
),
None => {
// Was MUTXO marked as abandoned? Then this is fine. Otherwise, log a warning.
// TODO: If MUTXO was spent, maybe we also don't want to maintain it?
if monitored_utxo.abandoned_at.is_some() {
debug!("Monitored UTXO with digest {utxo_digest} was marked as abandoned. Skipping.");
} else {
warn!(
"Unable to find valid membership proof for UTXO with digest {utxo_digest}"
);
}
}
}
}

Expand Down

0 comments on commit 83ab2da

Please sign in to comment.