mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
RPC Corrections and deadlock fix (#640)
* Correct goodbye handling and fix deadlock * Correct typo
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::methods::{RPCErrorResponse, RPCResponse, RequestId};
|
||||
use super::methods::{RPCErrorResponse, RequestId};
|
||||
use super::protocol::{RPCError, RPCProtocol, RPCRequest};
|
||||
use super::RPCEvent;
|
||||
use crate::rpc::protocol::{InboundFramed, OutboundFramed};
|
||||
@@ -208,7 +208,6 @@ where
|
||||
// drop the stream and return a 0 id for goodbye "requests"
|
||||
if let r @ RPCRequest::Goodbye(_) = req {
|
||||
self.events_out.push(RPCEvent::Request(0, r));
|
||||
warn!(self.log, "Goodbye Received");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,14 +244,6 @@ where
|
||||
|
||||
// add the stream to substreams if we expect a response, otherwise drop the stream.
|
||||
match rpc_event {
|
||||
RPCEvent::Request(id, RPCRequest::Goodbye(_)) => {
|
||||
// notify the application layer, that a goodbye has been sent, so the application can
|
||||
// drop and remove the peer
|
||||
self.events_out.push(RPCEvent::Response(
|
||||
id,
|
||||
RPCErrorResponse::Success(RPCResponse::Goodbye),
|
||||
));
|
||||
}
|
||||
RPCEvent::Request(id, request) if request.expect_response() => {
|
||||
// new outbound request. Store the stream and tag the output.
|
||||
let delay_key = self
|
||||
|
||||
Reference in New Issue
Block a user