Prevent wallet attempting to re-pay a cancelled invoice transaction (#707)

This commit is contained in:
Yeastplume
2024-04-24 09:03:58 +01:00
committed by GitHub
parent 75363a9a25
commit 297c828532
3 changed files with 49 additions and 0 deletions
+3
View File
@@ -680,6 +680,9 @@ where
if t.tx_type == TxLogEntryType::TxSent {
return Err(Error::TransactionAlreadyReceived(ret_slate.id.to_string()));
}
if t.tx_type == TxLogEntryType::TxSentCancelled {
return Err(Error::TransactionWasCancelled(ret_slate.id.to_string()));
}
}
let height = w.w2n_client().get_chain_tip()?.0;
+4
View File
@@ -153,6 +153,10 @@ pub enum Error {
#[error("Transaction {0} has already been received")]
TransactionAlreadyReceived(String),
/// Transaction has been cancelled
#[error("Transaction {0} has been cancelled")]
TransactionWasCancelled(String),
/// Attempt to repost a transaction that's not completed and stored
#[error("Transaction building not completed: {0}")]
TransactionBuildingNotCompleted(u32),