mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 00:24:28 +01:00
So far we were relying on `lightningd` to create an ad-hoc invoice when telling it to `resolve` with a given preimage. We now switch to having the plugin create the invoice, remove the mandatory `keysend_preimage` field (which would upset `lightningd` otherwise), and then return the modified payload with the instructions to `continue` instead of resolving. This ties back in with the existing payment/invoice handling code. Invoices are created only if we don't have a label clash (unlikely since we have the nano-time in the label), or the `payment_hash` was already used for another invoice (at which point `lightningd` will automatically reject the payment and we're a bit poorer for it, but meh :-)
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).