core-lightning/plugins
Vincenzo Palazzo 85992e6e48 feat(bitcoind): pass the current known block height
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>
2023-06-13 16:27:10 +02:00
..
bkpr wallet: add channel_type field to db. 2023-04-10 17:26:47 +09:30
examples pytest: Highlight the re-entrancy issue for cln-plugin events 2023-04-13 18:13:28 -07:00
grpc-plugin grpc: The plugin needs to use the server feature on cln-grpc 2023-06-01 13:41:21 +09:30
spender fix: build with gcc 13 with enum and int mismatch 2023-04-27 07:41:27 +09:30
src rs: Run hooks, methods and notification handlers in tokio tasks 2023-04-13 18:13:28 -07:00
test cleanup: rename json_add_amount_msat_only to json_add_amount_msat 2023-03-18 15:55:49 +10:30
.gitignore ignore sql binary plugin 2023-02-08 14:38:58 -06:00
autoclean.c plugin: autoclean: cleanup the forwards with localfailed 2023-03-23 08:18:27 +00:00
bcli.c feat(bitcoind): pass the current known block height 2023-06-13 16:27:10 +02:00
Cargo.toml rs: Bump version of cln-plugin 2023-06-02 14:47:13 +02:00
chanbackup.c chanbackup: even if they enable experimental-peer-storage, check peers 2023-03-08 18:46:21 -06:00
commando.c commando: integer command parameters can be compared with < and >. 2023-06-06 19:47:08 +09:30
fetchinvoice.c listconfigs: show plugin options in 'configs' with normal options. 2023-06-03 10:50:29 +09:30
funder.c Update libwally to 0.8.8, support PSBTv2 2023-03-23 16:10:55 +10:30
funder_policy.c df: pass lease data back to funder for rbfs 2022-10-20 13:42:41 +02:00
funder_policy.h df: pass lease data back to funder for rbfs 2022-10-20 13:42:41 +02:00
keysend.c config: replace accept-htlc-tlv-types with accept-htlc-tlv-type 2023-06-03 10:50:29 +09:30
libplugin-pay.c plugins: initialize destination_reachable 2023-06-05 16:16:21 +02:00
libplugin-pay.h Makefile: update bolts to 60cfb5972ad4bec4c49ee0f9e729fb3352fcdc6a. 2023-04-07 21:22:56 +09:30
libplugin.c libplugin: Expose the jsonrpc_request_sync method 2023-02-28 15:00:44 -06:00
libplugin.h libplugin: Expose the jsonrpc_request_sync method 2023-02-28 15:00:44 -06:00
Makefile build: don't generate experimental variants of wire files. 2023-05-23 09:34:08 +09:30
offers.c listconfigs: show plugin options in 'configs' with normal options. 2023-06-03 10:50:29 +09:30
offers.h common: update to latest onion message spec. 2022-10-26 11:29:06 +10:30
offers_inv_hook.c lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_inv_hook.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_invreq_hook.c offers: fix pay where we are using deprecated apis. 2023-02-03 16:59:51 +01:00
offers_invreq_hook.h offers: create a real blinded path, if necessary. 2022-11-09 15:08:03 +01:00
offers_offer.c offers: enable label for invoicerequest 2023-03-09 06:56:06 -06:00
offers_offer.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
pay.c listconfigs: show plugin options in 'configs' with normal options. 2023-06-03 10:50:29 +09:30
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
sql.c plugins/sql: recurse correctly into complex objects during processing. 2023-03-25 15:28:02 +10:30
topology.c cleanup: rename json_add_amount_msat_only to json_add_amount_msat 2023-03-18 15:55:49 +10:30
txprepare.c signpsbt_done: don't try to access global tx in exception 2023-05-24 12:00:28 +09:30

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).