File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,22 @@ impl node::rpc::RpcService for NodeService {
9898 respond_p2p_connection_outgoing,
9999 RpcP2pConnectionOutgoingResponse
100100 ) ;
101- rpc_service_impl ! (
102- respond_p2p_connection_incoming_answer,
103- P2pConnectionResponse
104- ) ;
101+
102+ fn respond_p2p_connection_incoming_answer (
103+ & mut self ,
104+ rpc_id : RpcId ,
105+ response : P2pConnectionResponse ,
106+ ) -> Result < ( ) , RespondError > {
107+ let entry = self . rpc . pending . get ( rpc_id) ;
108+ let chan = entry. ok_or ( RespondError :: UnknownRpcId ) ?;
109+ let chan = chan
110+ . downcast_ref :: < mpsc:: Sender < RpcP2pConnectionIncomingResponse > > ( )
111+ . ok_or ( RespondError :: UnexpectedResponseType ) ?
112+ . clone ( ) ;
113+ chan. try_send ( RpcP2pConnectionIncomingResponse :: Answer ( response) )
114+ . or ( Err ( RespondError :: RespondingFailed ) ) ?;
115+ Ok ( ( ) )
116+ }
105117
106118 fn respond_p2p_connection_incoming (
107119 & mut self ,
Original file line number Diff line number Diff line change @@ -262,15 +262,13 @@ pub struct RpcHealthCheckAction {
262262
263263impl redux:: EnablingCondition < crate :: State > for RpcHealthCheckAction { }
264264
265-
266265#[ derive( Serialize , Deserialize , Debug , Clone ) ]
267266pub struct RpcReadinessCheckAction {
268267 pub rpc_id : RpcId ,
269268}
270269
271270impl redux:: EnablingCondition < crate :: State > for RpcReadinessCheckAction { }
272271
273-
274272/// Finish/Cleanup rpc request.
275273#[ derive( Serialize , Deserialize , Debug , Clone ) ]
276274pub struct RpcFinishAction {
You can’t perform that action at this time.
0 commit comments