From b57678b0368b75ec0f864e8eb51cff855e8a97f7 Mon Sep 17 00:00:00 2001 From: patrini32 <171664803+patrini32@users.noreply.github.com> Date: Sun, 9 Jun 2024 14:29:57 +0300 Subject: [PATCH] remove changes to punish.rs --- swap/src/bitcoin/punish.rs | 4 +--- swap/src/cli/cancel_and_refund.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/swap/src/bitcoin/punish.rs b/swap/src/bitcoin/punish.rs index a2280dba..9d687544 100644 --- a/swap/src/bitcoin/punish.rs +++ b/swap/src/bitcoin/punish.rs @@ -44,9 +44,7 @@ impl TxPunish { watch_script: punish_address.script_pubkey(), } } - pub fn txid(&self) -> Txid { - self.inner.txid() - } + pub fn digest(&self) -> Sighash { self.digest } diff --git a/swap/src/cli/cancel_and_refund.rs b/swap/src/cli/cancel_and_refund.rs index 6730bec0..3b4a9011 100644 --- a/swap/src/cli/cancel_and_refund.rs +++ b/swap/src/cli/cancel_and_refund.rs @@ -130,7 +130,7 @@ pub async fn refund( if let ExpiredTimelocks::Punish { .. } = state6.expired_timelock(bitcoin_wallet.as_ref()).await? { - // Alice already punished Bob, so Bob sets his state to BtcPunished. + // Punish timelock already expired, so we can't refund. let state = BobState::BtcPunished { tx_lock_id: state6.tx_lock_id(), };