mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-01 02:56:08 -04:00
Refactor Alice's peer-id and identity to be handled on the outside
Doing this in the behaviour is a weird indirection that is not needed.
This commit is contained in:
parent
8bf467b550
commit
0c19af9090
4 changed files with 31 additions and 70 deletions
|
@ -666,9 +666,13 @@ fn init_alice_event_loop(
|
|||
alice::event_loop::EventLoop,
|
||||
alice::event_loop::EventLoopHandle,
|
||||
) {
|
||||
let alice_behaviour = alice::Behaviour::new(network::Seed::new(seed));
|
||||
let alice_transport = build(alice_behaviour.identity()).unwrap();
|
||||
alice::event_loop::EventLoop::new(alice_transport, alice_behaviour, listen).unwrap()
|
||||
let identity = network::Seed::new(seed).derive_libp2p_identity();
|
||||
|
||||
let peer_id = identity.public().into_peer_id();
|
||||
|
||||
let alice_behaviour = alice::Behaviour::default();
|
||||
let alice_transport = build(identity).unwrap();
|
||||
alice::event_loop::EventLoop::new(alice_transport, alice_behaviour, listen, peer_id).unwrap()
|
||||
}
|
||||
|
||||
async fn init_bob_state(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue