Increase peer's send buffer () ()

When we send a txhashet archive a peer's thread is busy with sending it
and can't send other messages, eg pings. If the network connection is
slow buffer capacity 10 may be not enough,  hence the peer's drop.

Safer attempt to address  in 2.0.0
This commit is contained in:
hashmap 2019-06-30 22:26:17 +02:00 committed by GitHub
parent 2f01274557
commit dbd2535f42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
p2p/src
servers/src/grin/sync

View file

@ -163,7 +163,7 @@ impl<'a> Response<'a> {
}
}
pub const SEND_CHANNEL_CAP: usize = 10;
pub const SEND_CHANNEL_CAP: usize = 100;
pub struct StopHandle {
/// Channel to close the connection

View file

@ -106,7 +106,7 @@ impl BodySync {
// 10) max will be 80 if all 8 peers are advertising more work
// also if the chain is already saturated with orphans, throttle
let block_count = cmp::min(
cmp::min(100, peers.len() * p2p::SEND_CHANNEL_CAP),
cmp::min(100, peers.len() * 10),
chain::MAX_ORPHAN_SIZE.saturating_sub(self.chain.orphans_len()) + 1,
);