diff --git a/src/farcasterd/runtime.rs b/src/farcasterd/runtime.rs index d56cd1ab8..761362891 100644 --- a/src/farcasterd/runtime.rs +++ b/src/farcasterd/runtime.rs @@ -571,7 +571,7 @@ impl Runtime { ServiceBus::Ctl, self.identity(), swap_service_id, - Request::PeerdReconnected, + Request::PeerdReconnected(source.clone()), )?; } } else { diff --git a/src/rpc/request.rs b/src/rpc/request.rs index 8ce6d09c2..e0ebc369e 100644 --- a/src/rpc/request.rs +++ b/src/rpc/request.rs @@ -357,8 +357,8 @@ pub enum Request { ReconnectPeer(ReconnectPeer), #[api(type = 8)] - #[display("peerd_reconnected()")] - PeerdReconnected, + #[display("peerd_reconnected({0})")] + PeerdReconnected(ServiceId), #[api(type = 32)] #[display("node_id({0})")] diff --git a/src/swapd/runtime.rs b/src/swapd/runtime.rs index b079cc968..b7c3926d9 100644 --- a/src/swapd/runtime.rs +++ b/src/swapd/runtime.rs @@ -481,7 +481,7 @@ impl Runtime { if let Err(error) = endpoints.send_to( ServiceBus::Msg, self.identity(), - self.peer_service.clone(), // = ServiceId::Loopback + self.peer_service.clone(), // ServiceId::Loopback if not initiailized Request::Protocol(msg.clone()), ) { error!( @@ -2356,7 +2356,13 @@ impl Runtime { self.send_ctl(endpoints, source, Request::SwapInfo(info))?; } - Request::PeerdReconnected => { + Request::PeerdReconnected(service_id) => { + // set the reconnected service id, if it is not set yet. This + // can happen if this is a maker launched swap after restoration + // and the taker reconnects + if self.peer_service == ServiceId::Loopback { + self.peer_service = service_id; + } for msg in self.pending_peer_request.clone().iter() { self.send_peer(endpoints, msg.clone())?; }