From 4ce434d642fea2d8841c33a6151620b244591220 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Tue, 24 Jun 2025 17:03:03 +0200 Subject: [PATCH] Add mark_output_spend and update mark_output_mined --- src/silentpayments.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/silentpayments.rs b/src/silentpayments.rs index 63e8706..53086c7 100644 --- a/src/silentpayments.rs +++ b/src/silentpayments.rs @@ -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()); + } + } + } }