Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: additional check for cancelled transactions #3369

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 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,21 @@ 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 {
if inbound_tx.source_public_key != source_pubkey {
return Err(TransactionServiceError::InvalidSourcePublicKey);
}
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