mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-13 16:55:57 -04:00
Remove connection handling from swap execution
The swap should not be concerned with connection handling. This is the responsibility of the overall application. All but the execution-setup NetworkBehaviour are `request-response` behaviours. These have built-in functionality to automatically emit a dial attempt in case we are not connected at the time we want to send a message. We remove all of the manual dialling code from the swap in favor of this behaviour. Additionally, we make sure to establish a connection as soon as the EventLoop gets started. In case we ever loose the connection to Alice, we try to re-establish it.
This commit is contained in:
parent
804b34f6b0
commit
cde3f0f74a
11 changed files with 79 additions and 215 deletions
|
@ -9,7 +9,6 @@ use get_port::get_port;
|
|||
use libp2p::core::Multiaddr;
|
||||
use libp2p::{PeerId, Swarm};
|
||||
use monero_harness::{image, Monero};
|
||||
use std::convert::Infallible;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
@ -78,7 +77,7 @@ impl BobParams {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct BobEventLoopJoinHandle(JoinHandle<Result<Infallible>>);
|
||||
pub struct BobEventLoopJoinHandle(JoinHandle<()>);
|
||||
|
||||
impl BobEventLoopJoinHandle {
|
||||
pub fn abort(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue