Browse Source
Re-trigger sending commit in case we start up in `PendingCommit`
For now the behavior is: Once the user pressed the button commit will be published and also retried upon startup.
upload-correct-windows-binary
Daniel Karzel
3 years ago
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E
3 changed files with
18 additions and
0 deletions
-
daemon/src/maker_cfd.rs
-
daemon/src/model/cfd.rs
-
daemon/src/taker_cfd.rs
|
|
@ -97,6 +97,13 @@ impl Actor { |
|
|
|
tracing::info!("Refund transaction published on chain: {}", txid); |
|
|
|
} |
|
|
|
|
|
|
|
for cfd in cfds.iter().filter(|cfd| Cfd::is_pending_commit(cfd)) { |
|
|
|
let signed_commit_tx = cfd.commit_tx()?; |
|
|
|
let txid = wallet.try_broadcast_transaction(signed_commit_tx).await?; |
|
|
|
|
|
|
|
tracing::info!("Commit transaction published on chain: {}", txid); |
|
|
|
} |
|
|
|
|
|
|
|
Ok(Self { |
|
|
|
db, |
|
|
|
wallet, |
|
|
|
|
|
@ -654,6 +654,10 @@ impl Cfd { |
|
|
|
matches!(self.state.clone(), CfdState::MustRefund { .. }) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn is_pending_commit(&self) -> bool { |
|
|
|
matches!(self.state.clone(), CfdState::PendingCommit { .. }) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn is_cleanup(&self) -> bool { |
|
|
|
matches!( |
|
|
|
self.state.clone(), |
|
|
|
|
|
@ -90,6 +90,13 @@ impl Actor { |
|
|
|
tracing::info!("Refund transaction published on chain: {}", txid); |
|
|
|
} |
|
|
|
|
|
|
|
for cfd in cfds.iter().filter(|cfd| Cfd::is_pending_commit(cfd)) { |
|
|
|
let signed_commit_tx = cfd.commit_tx()?; |
|
|
|
let txid = wallet.try_broadcast_transaction(signed_commit_tx).await?; |
|
|
|
|
|
|
|
tracing::info!("Commit transaction published on chain: {}", txid); |
|
|
|
} |
|
|
|
|
|
|
|
Ok(Self { |
|
|
|
db, |
|
|
|
wallet, |
|
|
|