-
Notifications
You must be signed in to change notification settings - Fork 83
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
Watch For Deposit #196
Comments
This comment has been minimized.
This comment has been minimized.
thomaseizinger
added a commit
that referenced
this issue
Feb 25, 2021
We are using BDK with an electrum backend. Electrum includes mempool transactions in the response of unspent UTXOs. As such, picking up the balance by simply syncing is extremely fast after the transaction has been broadcasted to the network. Fixes #196.
rishflab
pushed a commit
that referenced
this issue
Feb 26, 2021
If the current balance is 0, we wait until the user deposits money to the given address. After that, we simply swap the full balance. Not only does this simplify the interface by removing a parameter, but it also integrates the `deposit` command into the `buy-xmr` command. Syncing a wallet that is backed by electrum includes transactions that are part of the mempool when computing the balance. As such, waiting for a deposit is a very quick action because it allows us to build our lock transaction on top of the yet to be confirmed deposit transactions. This patch introduces another function to the `bitcoin::Wallet` that relies on the currently statically encoded fee rate. To make sure future developers don't forget to adjust both, we extract a function that "selects" a fee rate and return the constant from there. Fixes #196.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
The buy-xmr tool generates and displays a bitcoin address for the user to fund. These funds are used to buy Monero. Currently we are manually checking that these funds have arrived before commencing the swap. This does not fit with the goal of providing a streamlined UX.
Potential Solution
Assumption: We do not really care how the buy-xmr tool is funded. All that matters is that is has enough funds to execute the swap.
The buy-xmr tool should watch for the funds and automatically commence the swap when they are confirmed.
Loop on
bdk_wallet.get_balance()
until the balance is sufficient for the swap.Potential Issues
get_balance()
requires the wallet to be synced. Syncing could take a while.get_balance
API doesn't mention anything about UTXO confirmations. The swap could begin execution but fail when it comes to building/publishing/ waiting for TxLock to confirm.The text was updated successfully, but these errors were encountered: