-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] If bitcoind is not fully synched when clightning starts, clightning will start to scan #1819
Comments
At the very least BTCPay is using pruned node, so running By starting clightning only when bitcoind start, I make sure that clightning does not start scanning from long time ago. Scanning a brand new wallet is only useful for getting the channels in the network, which is only useful when you want to send payment. For a merchant case, the most important is not to send but to receive, so they don't really care about the tradeoff. |
it is not right. I restarted my server, but after reboot I didn't mount disk where bitcoind data were stored. I just started bitcoind, then clightning, not realizing that initial sync is running. I found out next day. I have stopped cln + bitcoind, erased useless bitcoind data, mounted storage, started bitcoin and get to synced state within few minutes - for bitcoind. but clightning did not recover so easily. it is syncing blocks from the begining and it is taking ages. |
@yaraaer I ended up have a marker file file "bitcoind_fully_synched" that some middleware of mine is generating, and the script starting lightningd just sleeping until it sees this file before starting lightningd. Hack, but never got any problem since then. |
I think this is now handled correctly ? |
Nope, just got a report from Javier on Telegram. He ran bitcoind -reindex and it found corruption. lightningd started syncing from block 119,000 or so! Presumably he started it up before bitcoind was finished. |
Right, that was what happened to me today.
|
This was fixed in faded9a, and I verified that def test_ibd(node_factory):
l1 = node_factory.get_node(start=False)
mock_getblockchaininfo = {
"chain": "regtest",
"blocks": 1000,
"headers": 2000,
"initialblockdownload": True,
}
l1.daemon.rpcproxy.mock_rpc('getblockchaininfo', mock_getblockchaininfo)
l1.start() |
If
bitcoind
is not fully synched whenclightning
starts for the first time, it seemsclightning
is starting to scan blocks from the beginning of time.See: btcpayserver/btcpayserver-docker#18 (comment)
Reported by @sosthene and @ndeet , based on 0.6.
Workaround: Using a utilities waiting for bitcoind to be fully synched before starting lnd. (Using NBXplorer/NBXplorer.NodeWaiter in BTCPay)
The text was updated successfully, but these errors were encountered: