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 {
98
98
respond_p2p_connection_outgoing,
99
99
RpcP2pConnectionOutgoingResponse
100
100
) ;
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
+ }
105
117
106
118
fn respond_p2p_connection_incoming (
107
119
& mut self ,
Original file line number Diff line number Diff line change @@ -262,15 +262,13 @@ pub struct RpcHealthCheckAction {
262
262
263
263
impl redux:: EnablingCondition < crate :: State > for RpcHealthCheckAction { }
264
264
265
-
266
265
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
267
266
pub struct RpcReadinessCheckAction {
268
267
pub rpc_id : RpcId ,
269
268
}
270
269
271
270
impl redux:: EnablingCondition < crate :: State > for RpcReadinessCheckAction { }
272
271
273
-
274
272
/// Finish/Cleanup rpc request.
275
273
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
276
274
pub struct RpcFinishAction {
You can’t perform that action at this time.
0 commit comments