Skip to content

Conversation

ozankaymak
Copy link
Contributor

This PR implements mempool check for newly created withdrawal (dust) utxo. If not confirmed, gives error for send-safe-withdrawal.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements mempool checking for withdrawal UTXO transactions to prevent users from attempting safe withdrawals with unconfirmed transactions. The change adds validation to ensure withdrawal transactions are confirmed on-chain before proceeding with the withdrawal process.

Key changes:

  • Added transaction on-chain verification before preparing withdrawal parameters
  • Introduced new API functions to check transaction confirmation status via mempool.space and Bitcoin RPC fallback
  • Updated user messaging to inform about confirmation requirements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/withdraw.rs Added mempool check in prepare_withdrawal_params and imported new API function
src/main.rs Updated user instructions to mention waiting for transaction confirmation
src/errors.rs Added new error type for transactions not found on-chain
src/api_utils.rs Implemented is_tx_on_chain function with mempool.space and Bitcoin RPC fallback

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -354,6 +354,12 @@ pub async fn prepare_withdrawal_params(
BridgeCliError,
> {
// Get the prepare tx details
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment needs to be moved below

}
}

async fn is_tx_on_chain_mempool_space(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return bool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants