Skip to content

lnwallet/btcwallet: skip 2-hour tip-staleness check on regtest/simnet - #11002

Open
ZZiigguurraatt wants to merge 1 commit into
lightningnetwork:masterfrom
ZZiigguurraatt:issync-skip-stale-tip-regtest
Open

lnwallet/btcwallet: skip 2-hour tip-staleness check on regtest/simnet#11002
ZZiigguurraatt wants to merge 1 commit into
lightningnetwork:masterfrom
ZZiigguurraatt:issync-skip-stale-tip-regtest

Conversation

@ZZiigguurraatt

@ZZiigguurraatt ZZiigguurraatt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

IsSynced rejected "synced" status whenever the best block header timestamp was more than 2 hours in the past. On regtest and simnet blocks are only mined on demand, so an idle chain would drive the tip timestamp past that window and report synced_to_chain=false, and could block the startup sync loop indefinitely.

Skip the staleness check on local networks (regtest via wire.TestNet, simnet via wire.SimNet); mainnet and testnet3/testnet4 are unaffected. Also rename the misleading minus24Hours variable to minus2Hours.

Add TestIsSyncedStaleTip covering the skip on regtest/simnet, the still-enforced check on mainnet, and a testnet3 guard case ensuring the skip does not accidentally match real testnet.

Fixes #11004

IsSynced rejected "synced" status whenever the best block header
timestamp was more than 2 hours in the past. On regtest and simnet
blocks are only mined on demand, so an idle chain would drive the tip
timestamp past that window and report synced_to_chain=false, and could
block the startup sync loop indefinitely.

Skip the staleness check on local networks (regtest via wire.TestNet,
simnet via wire.SimNet); mainnet and testnet3/testnet4 are unaffected.
Also rename the misleading minus24Hours variable to minus2Hours.

Add TestIsSyncedStaleTip covering the skip on regtest/simnet, the
still-enforced check on mainnet, and a testnet3 guard case ensuring the
skip does not accidentally match real testnet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 hour stale block check should not hang up regtest networks

1 participant