func test: prevent disconnects when using mocktime

Thanks to pythcoiner for providing this fix.
This commit is contained in:
Michael Mallan 2024-09-05 13:25:34 +01:00
parent b630d46770
commit 341f940664
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB

View File

@ -72,6 +72,12 @@ class Bitcoind(BitcoinBackend):
"rpcport": rpcport,
"fallbackfee": Decimal(1000) / COIN,
"rpcthreads": 32,
# bitcoind uses mocktime in some tests, which can lead to peers (e.g. electrs)
# being disconnected. To prevent this, we set `peertimeout` greater than
# the max value being mocked.
# See https://github.com/bitcoin/bitcoin/blob/fa05ee0517d58b600f0ccad4c02c0734a23707d6/src/net.cpp#L1961.
# h/t pythcoiner :)
"peertimeout": 2 * 24 * 60 * 60, # 2 days
}
self.conf_file = os.path.join(bitcoin_dir, "bitcoin.conf")
with open(self.conf_file, "w") as f: