Skip to content

Commit

Permalink
graceful close duplicate incoming notification stream (#1350)
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
  • Loading branch information
turuslan authored Sep 23, 2022
1 parent 60e9e2d commit 610d964
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/network/impl/stream_engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ namespace kagome::network {
bool replaced = false;
// Reset previous stream if any
if (dst) {
dst->reset();
if (direction == Direction::INCOMING) {
dst->close([](outcome::result<void>) {});
} else {
dst->reset();
}
replaced = true;
}

Expand Down

0 comments on commit 610d964

Please sign in to comment.