1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00
eclair/eclair-core
Fabrice Drouin 28072e8d69
Select final onchain address when closing (#2565)
* Add a finalScriptPubKey field to DATA_CLOSING (no functional changes)

* Add an explicit finalScriptPubKey parameter to helper methods (no functional changes)

* Rename LocalParams field defaultFinalScriptPubKey to upfrontShutdownScript_opt

`localParams.upfrontShutdownScript_opt` is now optional, and a new field has been added to DATA_CLOSING: finalScriptPubKey, which is the actual pubkey script onchain funds are sent to.

When reading DATA_CLOSING data serialized with older codecs, we rely on the fact that `localParams.upfrontShutdownScript_opt` was always present and was actually used as the final onchain
destination: it is safe to use `localParams.upfrontShutdownScript_opt.get` to populate DATA_CLOSING's finalScriptPubKey field.

* Update closing address when possible

When a channel gets closed, and when possible, we send all onchain funds to a recent onchain address and not
to an address that was generated when the channel was created.

This is possible for new channels in all cases except when mutual-closing a channel that sets `upfront-shutdown-script`.

Existing channels, which will keep sending onchain funds to addresses generated when they were created. Migration for existing channels will be handled in another PR.

Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
2023-01-26 10:51:23 +01:00
..
src Select final onchain address when closing (#2565) 2023-01-26 10:51:23 +01:00
eclair-cli Add GetNode router API (#2568) 2023-01-16 15:13:09 +01:00
pom.xml Update to bitcoind 23.1 (#2551) 2023-01-04 14:27:46 +01:00