mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
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:
parent
81a6af9624
commit
304ae444ab
2 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue