Skip to content

Commit

Permalink
fix: additional check for cancelled transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
StriderDM committed Sep 20, 2021
1 parent e594c5f commit 4a121bd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion base_layer/wallet/src/transaction_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,18 @@ where
traced_message_tag
);

// Check if this transaction has already been received and cancelled.
if let Ok(inbound_tx) = self.db.get_cancelled_pending_inbound_transaction(data.tx_id).await {
trace!(
target: LOG_TARGET,
"A repeated Transaction (TxId: {}) has been received but has been previously cancelled",
inbound_tx.tx_id
);
return Ok(());
}

// Check if this transaction has already been received.
if let Ok(inbound_tx) = self.db.get_pending_inbound_transaction(data.tx_id).await {
if let Ok(inbound_tx) = self.db.get_pending_inbound_transaction(data.clone().tx_id).await {
// Check that it is from the same person
if inbound_tx.source_public_key != source_pubkey {
return Err(TransactionServiceError::InvalidSourcePublicKey);
Expand Down

0 comments on commit 4a121bd

Please sign in to comment.