mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
When core lightning is asking the information about the blockchain with `getchaininfo` command lightningd know already the information about the min and max block height. the problem is when we have a smarter Bitcoin backend that is able to switch between different clients in some cases is helpful give the information about current known height by lightningd and pass it down to the plugin. In this way, the plugin knows what is the correct known height from lightnind, and can try to fix some problems if any exit. This is particularly useful when you are syncing a new backend from scratch like https://github.com/cloudhead/nakamoto and we avoid returning the lower height from the known, and avoid the crash of core lightning. With this information, the plugin can start to sync the chain and return the answer back only when the chain is in sync with the current status of lightningd. Another reason to add this field and not wait the correct block in core lightning itself is because Bitcoin Core is extremely slow to sync up, so the question here is, how long should we wait? The time depends on various factors. With this approach of informing the plugin about the height, in some cases, you can start the syncing but move the execution to another backend until the previous one is ready. The problem I want to solve is that I don't want to be left in the dark when we run `getchaininfo`, and I want to have the opportunity to wait for the blockchain sync or decide to dispatch the request elsewhere. Changelog-Added: Pass the current known block height down to the getchaininfo call. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> |
||
---|---|---|
.. | ||
bkpr | ||
examples | ||
grpc-plugin | ||
spender | ||
src | ||
test | ||
.gitignore | ||
autoclean.c | ||
bcli.c | ||
Cargo.toml | ||
chanbackup.c | ||
commando.c | ||
fetchinvoice.c | ||
funder.c | ||
funder_policy.c | ||
funder_policy.h | ||
keysend.c | ||
libplugin-pay.c | ||
libplugin-pay.h | ||
libplugin.c | ||
libplugin.h | ||
Makefile | ||
offers.c | ||
offers.h | ||
offers_inv_hook.c | ||
offers_inv_hook.h | ||
offers_invreq_hook.c | ||
offers_invreq_hook.h | ||
offers_offer.c | ||
offers_offer.h | ||
pay.c | ||
README.md | ||
sql.c | ||
topology.c | ||
txprepare.c |
Plugin Directory
Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).