mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-02 14:56:10 -04:00
Generate addresses as late as possible
This commit is contained in:
parent
3f43581da7
commit
9e30bd5151
3 changed files with 11 additions and 35 deletions
|
@ -47,8 +47,6 @@ pub async fn swap(
|
|||
monero_wallet: Arc<monero::Wallet>,
|
||||
listen: Multiaddr,
|
||||
local_port: Option<u16>,
|
||||
redeem_address: ::bitcoin::Address,
|
||||
punish_address: ::bitcoin::Address,
|
||||
) -> Result<()> {
|
||||
struct Network {
|
||||
swarm: Arc<Mutex<Swarm>>,
|
||||
|
@ -131,6 +129,9 @@ pub async fn swap(
|
|||
None => unreachable!("should have amounts by here"),
|
||||
};
|
||||
|
||||
let redeem_address = bitcoin_wallet.as_ref().new_address().await?;
|
||||
let punish_address = redeem_address.clone();
|
||||
|
||||
// TODO: Pass this in using <R: RngCore + CryptoRng>
|
||||
let rng = &mut OsRng;
|
||||
let state0 = State0::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue