14 Commits

Author SHA1 Message Date
f321x
286fc4b86e lnworker: enforce creation of PaymentInfo for b11
Enforce that the information used to create a bolt11 invoice using
`get_bolt11_invoice()` is similar to the related instance of PaymentInfo
by requiring a PaymentInfo as argument for `get_bolt11_invoice()`.
This way the invoice cannot differ from the created PaymentInfo.
This allows to use the information in PaymentInfo for validation of
incoming htlcs more reliably.

To cover all required information for the creation of a b11 invoice the
PaymentInfo class has to be extended with a expiry and
min_final_cltv_expiry. This requires a db upgrade.
2025-09-30 09:54:35 +02:00
SomberNight
81be0554a3 swaps: more robust parsing 2025-08-19 13:42:21 +00:00
Sander van Grieken
3c9c6a286c imports, whitespace, type hints, copyright headers 2025-06-12 14:32:00 +02:00
ghost43
448cbc7869 Merge pull request #9936 from f321x/nwc_incoming_event_filtering
plugin: nwc: improve filtering of expired requests
2025-06-10 18:32:13 +00:00
f321x
0f442f4c85 plugin: nwc: improve filtering of expired requests
improve the filtering of incoming requests by checking if they have
explicitly set an expiration tag. If so, they will only be ignored if
this timestamp is exceeded. Otherwise requests older than 30 secons will
get ignored and an error will get sent to the client so the client is
aware it's request arrived too late.
This is done to prevent handling requests the user may already expects
to have failed.
2025-06-10 19:29:19 +02:00
SomberNight
527d9e8215 plugins: nwc: clean-up imports
Try to follow PEP-8 import grouping, to make things readable.
I want to be able to quickly spot 3rd-party library imports! :P
2025-06-10 15:22:13 +00:00
SomberNight
dd7a284fd9 plugins: nwc: fix constants.net import
"# don't import net directly, import the module instead (so that net is singleton)"

set_as_network does not work if net is not a singleton, it results in a split worldview.
2025-06-10 15:22:10 +00:00
f321x
3daed92be2 nwc: don't announce spending methods if limit is 0
don't return the spending methods pay_invoice and multi_pay_invoice in
the get_info request and the info event so connections can be used for
services that enforce receive only connections.
2025-06-03 14:13:32 +02:00
SomberNight
6c11c75d58 follow-up prev 2025-05-14 13:29:30 +00:00
SomberNight
44f3444795 lnworker: make "preimages" dict private
I want to hook into lnworker.save_preimage (not done yet).
Other modules should not put preimages into the dict directly.
2025-05-14 13:23:02 +00:00
f321x
e80551192b plugins: structure plugin storage in wallet
store all plugin data by plugin name in a root dictionary `plugin_data`
inside the wallet db so that plugin data can get deleted again.
Prunes the data of plugins from the wallet db on wallet stop if the
plugin is not installed anymore.
2025-05-06 13:16:49 +02:00
ThomasV
eff8b65355 Plugins: pass wallet to settings_dialog
Also, remove settings_widget method.
The widget should always be a button.

nwc: is_initialized -> initialized
2025-04-12 11:09:15 +02:00
ThomasV
3a18000f7a nwc plugin: settings_dialog is wallet agnostic.
instead, test wallet in start_plugin.
prevent plugin from using several wallets.
2025-04-11 20:16:59 +02:00
f321x
253ab6849a implement NIP47 plugin 2025-04-10 10:22:29 +02:00