Add mark_output_spend and update mark_output_mined

This commit is contained in:
Sosthene 2025-06-24 17:03:03 +02:00 committed by Nicolas Cantu
parent 9b5a67fc13
commit 02d0f2d44e

View File

@ -68,9 +68,18 @@ impl SpWallet {
self.last_scan = last_scan;
}
pub fn mark_output_mined(&mut self, outpoint: &OutPoint, blk_hash: [u8; 32]) {
pub fn mark_output_spent(&mut self, outpoint: &OutPoint, txid: &Txid) {
if let Some(output) = self.outputs.get_mut(outpoint) {
output.spend_status = OutputSpendStatus::Spent(blk_hash);
output.spend_status = OutputSpendStatus::Spent(txid.to_byte_array());
}
}
pub fn mark_output_mined(&mut self, outpoint: &OutPoint, blk_hash: BlockHash) {
if let Some(output) = self.outputs.get_mut(outpoint) {
output.spend_status = OutputSpendStatus::Mined(blk_hash.to_byte_array());
}
}
}
}