mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-06 13:34:38 -04:00
Align with origin/database
This commit is contained in:
parent
1a5b9f9fa9
commit
4ce8695dfc
7 changed files with 652 additions and 493 deletions
|
@ -259,6 +259,13 @@ pub fn is_xmr_locked(state: &AliceState) -> bool {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn is_encsig_learned(state: &AliceState) -> bool {
|
||||
matches!(
|
||||
state,
|
||||
AliceState::EncSignLearned{..}
|
||||
)
|
||||
}
|
||||
|
||||
// State machine driver for swap execution
|
||||
#[async_recursion]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
|
|
@ -118,7 +118,10 @@ async fn main() -> Result<()> {
|
|||
alice::event_loop::EventLoop::new(alice_transport, alice_behaviour, listen_addr)?;
|
||||
|
||||
let swap_id = Uuid::new_v4();
|
||||
info!("Swap id: {}", swap_id);
|
||||
info!(
|
||||
"Swap sending {} and receiving {} started with ID {}",
|
||||
send_monero, receive_bitcoin, swap_id
|
||||
);
|
||||
|
||||
let swap = alice::swap::swap(
|
||||
alice_state,
|
||||
|
@ -135,7 +138,6 @@ async fn main() -> Result<()> {
|
|||
}
|
||||
Options::BuyXmr {
|
||||
alice_addr,
|
||||
alice_peer_id: _,
|
||||
bitcoind_url,
|
||||
bitcoin_wallet_name,
|
||||
monero_wallet_rpc_url,
|
||||
|
@ -193,6 +195,12 @@ async fn main() -> Result<()> {
|
|||
let (event_loop, handle) =
|
||||
bob::event_loop::EventLoop::new(bob_transport, bob_behaviour).unwrap();
|
||||
|
||||
let swap_id = Uuid::new_v4();
|
||||
info!(
|
||||
"Swap sending {} and receiving {} started with ID {}",
|
||||
send_bitcoin, receive_monero, swap_id
|
||||
);
|
||||
|
||||
let swap = bob::swap::swap(
|
||||
bob_state,
|
||||
handle,
|
||||
|
@ -200,7 +208,7 @@ async fn main() -> Result<()> {
|
|||
bitcoin_wallet.clone(),
|
||||
monero_wallet.clone(),
|
||||
OsRng,
|
||||
Uuid::new_v4(),
|
||||
swap_id,
|
||||
);
|
||||
|
||||
let _event_loop = tokio::spawn(async move { event_loop.run().await });
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use libp2p::{core::Multiaddr, PeerId};
|
||||
use libp2p::core::Multiaddr;
|
||||
use url::Url;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -40,9 +40,6 @@ pub enum Options {
|
|||
#[structopt(short = "a", long = "connect-addr")]
|
||||
alice_addr: Multiaddr,
|
||||
|
||||
#[structopt(short = "p", long = "connect-peer-id")]
|
||||
alice_peer_id: PeerId,
|
||||
|
||||
#[structopt(
|
||||
short = "b",
|
||||
long = "bitcoind",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue