Skip to content

Commit f75b39c

Browse files
committed
Bump HTTP read timeout to match reality of Bitcoin Core blocking
1 parent 8f78bbd commit f75b39c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning-block-sync/src/http.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ const TCP_STREAM_TIMEOUT: Duration = Duration::from_secs(5);
2727

2828
/// Timeout for reading the first byte of a response. This is separate from the general read
2929
/// timeout as it is not uncommon for Bitcoin Core to be blocked waiting on UTXO cache flushes for
30-
/// upwards of a minute or more. Note that we always retry once when we time out, so the maximum
31-
/// time we allow Bitcoin Core to block for is twice this value.
32-
const TCP_STREAM_RESPONSE_TIMEOUT: Duration = Duration::from_secs(120);
30+
/// upwards of 10 minutes on slow-ish devices (eg RPis with SSDs over USB). Note that we always
31+
/// retry once when we time out, so the maximum time we allow Bitcoin Core to block for is twice
32+
/// this value.
33+
const TCP_STREAM_RESPONSE_TIMEOUT: Duration = Duration::from_secs(300);
3334

3435
/// Maximum HTTP message header size in bytes.
3536
const MAX_HTTP_MESSAGE_HEADER_SIZE: usize = 8192;

0 commit comments

Comments
 (0)