mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-09 23:12:40 -04:00
Bob refunds swap after restart that requires communication
As Bob is dialing Alice, we now ensure that we are connected to Alice at each step that needs communication. If we are not connected, we proceed with dialing. In an attempt to improve libp2p usage, we also add known address of Alice first and only use peer_id to dial. This ensures that we use the expected peer id.
This commit is contained in:
parent
d9ea7ab605
commit
1a4bd0e2b4
14 changed files with 347 additions and 72 deletions
|
@ -1,4 +1,4 @@
|
|||
use libp2p::core::Multiaddr;
|
||||
use libp2p::{core::Multiaddr, PeerId};
|
||||
use url::Url;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -47,6 +47,9 @@ pub enum Command {
|
|||
receive_bitcoin: bitcoin::Amount,
|
||||
},
|
||||
BuyXmr {
|
||||
#[structopt(short = "p", long = "connect-peer-id")]
|
||||
alice_peer_id: PeerId,
|
||||
|
||||
#[structopt(short = "a", long = "connect-addr")]
|
||||
alice_addr: Multiaddr,
|
||||
|
||||
|
@ -78,6 +81,12 @@ pub enum Command {
|
|||
#[structopt(short = "id", long = "swap-id")]
|
||||
swap_id: Uuid,
|
||||
|
||||
#[structopt(short = "p", long = "connect-peer-id")]
|
||||
alice_peer_id: PeerId,
|
||||
|
||||
#[structopt(short = "a", long = "connect-addr")]
|
||||
alice_addr: Multiaddr,
|
||||
|
||||
#[structopt(
|
||||
short = "b",
|
||||
long = "bitcoind-rpc",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue