[bug] fix improper mark_output_mined

This commit is contained in:
Sosthene 2025-06-24 15:07:01 +02:00 committed by Nicolas Cantu
parent cc51415957
commit 066719982f

View File

@ -288,13 +288,7 @@ async fn handle_state_updates(
let mut sp_wallet = WALLET.get().unwrap().lock_anyhow().unwrap();
// inputs first
for outpoint in found_inputs {
if let Some(output) = sp_wallet.get_mut_outputs().get_mut(&outpoint) {
output.spend_status =
OutputSpendStatus::Mined(blkhash.as_raw_hash().to_byte_array());
} else {
// We found an input that we don't have in our wallet, that shouldn't happen
error!("Spent unknown output: {:?}", outpoint);
}
sp_wallet.mark_output_mined(&outpoint, blkhash);
}
sp_wallet.get_mut_outputs().extend(found_outputs);
sp_wallet.set_last_scan(blkheight.to_consensus_u32());