Don't close inbound notifications substreams immediately (#6781)

* Don't close inbound notifications substreams immediately

* Fix not closing in return to node A closing
This commit is contained in:
Pierre Krieger authored and GitHub committed 2020-07-31 14:42:53 +00:00
1 parent 9ca2300b05
commit a1786a92ec
3 files changed
+46 -16

No files matched your search

@@ -163,11 +163,9 @@ impl ProtocolsHandler for NotifsInHandler {
}
// Note that we drop the existing substream, which will send an equivalent to a TCP "RST"
// to the remote and force-close the substream. It might seem like an unclean way to get
// to the remote and force-close the substream. It might seem like an unclean way to get
// rid of a substream. However, keep in mind that it is invalid for the remote to open
// multiple such substreams, and therefore sending a "RST" is the correct thing to do.
// Also note that we have already closed our writing side during the initial handshake,
// and we can't close "more" than that anyway.
// multiple such substreams, and therefore sending a "RST" is not an incorrect thing to do.
self.substream = Some(proto);
self.events_queue.push_back(ProtocolsHandlerEvent::Custom(NotifsInHandlerOut::OpenRequest(msg)));