Fix peer dropping (#2780)
It turns out that we drop connection if we fail to process a message because of chain/store/internal error, eg we have a header already, so we refuse it and drop the peer. This pr doesn't forward this error to the peer error channel so the connection will not be dropped.
This commit is contained in:
@@ -51,6 +51,10 @@ macro_rules! try_break {
|
||||
match $inner {
|
||||
Ok(v) => Some(v),
|
||||
Err(Error::Connection(ref e)) if e.kind() == io::ErrorKind::WouldBlock => None,
|
||||
Err(Error::Store(_))
|
||||
| Err(Error::Chain(_))
|
||||
| Err(Error::Internal)
|
||||
| Err(Error::NoDandelionRelay) => None,
|
||||
Err(e) => {
|
||||
let _ = $chan.send(e);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ macro_rules! connection {
|
||||
($holder:expr) => {
|
||||
match $holder.connection.as_ref() {
|
||||
Some(conn) => conn.lock(),
|
||||
None => return Err(Error::Internal),
|
||||
None => return Err(Error::ConnectionClose),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user