We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5ec181 commit d10e571Copy full SHA for d10e571
sync/src/block/downloader/header.rs
@@ -25,6 +25,7 @@ use primitives::{H256, U256};
25
use super::super::message::RequestMessage;
26
27
const MAX_HEADER_REQUEST_LENGTH: u64 = 128;
28
+const MAX_HEADER_QUEUE_LENGTH: usize = 1024;
29
const MAX_RETRY: usize = 3;
30
const MAX_WAIT: u64 = 15;
31
@@ -128,6 +129,9 @@ impl HeaderDownloader {
128
129
if !self.is_idle() {
130
return None
131
}
132
+ if self.queued.len() + self.downloaded.len() > MAX_HEADER_QUEUE_LENGTH {
133
+ return None
134
+ }
135
136
let pivot_number = self.pivot_header().number();
137
0 commit comments