mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 06:22:39 -04:00
Save Alice's peer-id in the db for Bob
This allows loading the seller-peer-id from the database upon resuming a swap. Thus, the parameters `--seller-peer-id` is removed for the `resume` command. Other than the peer-id the multi address of a seller can change and thus is still a parameter. This parameter might become optional once we add DHT support.
This commit is contained in:
parent
bc442bcad3
commit
d90496931b
4 changed files with 116 additions and 26 deletions
|
@ -37,8 +37,15 @@ pub struct Arguments {
|
|||
pub enum Command {
|
||||
/// Start a XMR for BTC swap
|
||||
BuyXmr {
|
||||
#[structopt(
|
||||
long = "seller-peer-id",
|
||||
default_value = DEFAULT_ALICE_PEER_ID,
|
||||
help = "The peer id of a specific swap partner can be optionally provided"
|
||||
)]
|
||||
alice_peer_id: PeerId,
|
||||
|
||||
#[structopt(flatten)]
|
||||
connect_params: AliceConnectParams,
|
||||
alice_multi_addr: AliceMultiaddress,
|
||||
|
||||
#[structopt(long = "electrum-rpc",
|
||||
help = "Provide the Bitcoin Electrum RPC URL",
|
||||
|
@ -60,7 +67,7 @@ pub enum Command {
|
|||
swap_id: Uuid,
|
||||
|
||||
#[structopt(flatten)]
|
||||
connect_params: AliceConnectParams,
|
||||
alice_multi_addr: AliceMultiaddress,
|
||||
|
||||
#[structopt(long = "electrum-rpc",
|
||||
help = "Provide the Bitcoin Electrum RPC URL",
|
||||
|
@ -108,14 +115,7 @@ pub enum Command {
|
|||
}
|
||||
|
||||
#[derive(structopt::StructOpt, Debug)]
|
||||
pub struct AliceConnectParams {
|
||||
#[structopt(
|
||||
long = "seller-peer-id",
|
||||
default_value = DEFAULT_ALICE_PEER_ID,
|
||||
help = "The peer id of a specific swap partner can be optionally provided"
|
||||
)]
|
||||
pub peer_id: PeerId,
|
||||
|
||||
pub struct AliceMultiaddress {
|
||||
#[structopt(
|
||||
long = "seller-addr",
|
||||
default_value = DEFAULT_ALICE_MULTIADDR,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue