Commit Graph

14140 Commits

Author SHA1 Message Date
Ken Sedgwick 577075cc37 splice, vls: Fix missing check_mutual_channel_ready check.
This delta was meant to be part of ([#6760]), maybe lost in a rebase.

Changelog-None
2023-11-01 17:29:20 +01:00
Ken Sedgwick 76954d1105 splice, vls: fix missing rename in logging
This change was meant to be made in ([#6724]), maybe lost in a rebase.

ChangeLog-None
2023-11-01 17:29:20 +01:00
daywalker90 39b7d6fa4d add data field to RpcError 2023-11-01 17:28:50 +01:00
Rusty Russell 28fd70a3d8 lightningd: rewrite anchor spend to use multiple UTXOs if needed.
Closes: #6747
Changelog-EXPERIMENTAL: Fixed anchor spending to be able to use more than one UTXO.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell 2482fd4427 pytest: detect RBF more reliably
```
2023-10-30T20:52:48.0652403Z [gw2] [ 63%] FAILED tests/test_closing.py::test_onchain_timeout[True]
...
...
bitcoind.generate_block(4)
        bitcoind.generate_block(1, wait_for_mempool=txid1)
>       l1.mine_txid_or_rbf(txid2)

tests/test_closing.py:1987: 
```

Turns out that the DEBUG-level "no feechange" RBF can happen, as we can actually
call the RBF routine before we even broadcast the first one:


```
2023-10-30T21:07:42.2201798Z lightningd-1 2023-10-30T20:49:44.184Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: RBF onchain txid 14aa9c78fbcbff01faf96d3e734eba52355437078a67f46b8fbca9e72d1494e5 (fee 121sat) with txid 14aa9c78fbcbff01faf96d3e734eba52355437078a67f46b8fbca9e72d1494e5 (fee 121sat)
2023-10-30T21:07:42.2214788Z lightningd-1 2023-10-30T20:49:44.185Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: RBF 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000->02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000
2023-10-30T21:07:42.2230434Z lightningd-1 2023-10-30T20:49:44.196Z DEBUG   lightningd: sendrawtransaction: 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000
...
2023-10-30T21:07:42.2258455Z lightningd-1 2023-10-30T20:49:44.250Z DEBUG   plugin-bcli: sendrawtx exit 0 (bitcoin-cli -regtest -datadir=/tmp/ltests-b6i5i0cl/test_onchain_timeout_1/lightning-1/ -rpcport=43613 -rpcuser=... -stdinrpcpass sendrawtransaction 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000 0) 
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell ebf6f2e344 lightningd: use wallet_utxo_boost for zero-fee htlc_tx.
The previous logic looked wrong anyway!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell e0c9abc2b3 wallet: routine to gather UTXOs to meet a certain feerate.
We want to use this for boosting txs: either attaching fees to
zero-fee HTLCs, or making anchor transactions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell e4d7266fff common: add amount_feerate helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell ed034d9deb wallet: specialize get_utxos interfaces.
Turns out we really only want two:
1. wallet_get_all_utxos()
2. wallet_get_unspent_utxos()

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell b901f885e0 pytest: force anchor tests to use more than one UTXO.
They fail now, since one UTXO is not enough.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell 1d677bcba7 addpsbtoutput: allow command to specify output address.
Default is still to generate it.

Changelog-None: Introduced this release anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Tony Aldon 8a62831847 doc: update clnrest documentation. 2023-10-31 10:21:22 -07:00
Tony Aldon baa9a96eb1 clnrest: code refactoring for:
- certificate generation
- config options validation
- log level from 'error' to 'info'
- sending method as None instead ""
- added `listclnrest-notifications` for websocket server rune method

Changelog-Fixed: websocket server notifications are available with
restriction of `readonly` runes
2023-10-31 10:21:22 -07:00
Lagrang3 12d8ab6451
Remove error from startup_regtest when loading wallet
startup_regtest now checks if wallet directory exists before creating
the default wallet, then it will check if wallet is loaded before
attempting to load it. This prevents unnecessary errors during the
execution of this bash script.

[ Squashed fixup: `regtest: restore double quotes on PATH_TO_BITCOIN` -- RR ]
2023-10-31 12:57:54 +10:30
Rusty Russell 33a0af872a gossipd: never regard our own updates as spam.
If we ever re-enabled a channel too fast, if we considered it spam it
wouldn't propagate.   For the moment, consider our own updates to never
be spam.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-31 10:03:21 +10:30
Rusty Russell b6241cde7a gossipd: don't blanket disable channels on startup.
This should only have an effect if someone queries, but in practice, peers actually
see the disabling of channels.

This is a workaround until we rework the code so gossipd doesn't generate these at all
any more.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-31 10:03:21 +10:30
Chris Guida 4f667e8a62 cln-plugin: don't require redundant method reference
also eliminate a rust warning
2023-10-30 18:24:23 +01:00
Chris Guida dfa326ed9f cln-rpc: Update the Makefile to always rebuild each example when the example files themselves are changed
and to rebuild all the examples when the dependencies are changed (`CLN_RPC_SOURCES`).
2023-10-30 18:24:23 +01:00
Chris Guida c6262189b7 cln-plugin: Add test for cln-plugin send_custom_notification
Also fix Makefile for rust plugin examples

Also add in a missing assert in the test_plugin_start test
2023-10-30 18:24:23 +01:00
Chris Guida 80ba3a573d cln-plugin: implement registering and sending custom notifications to lightningd
This functionality already exists in the Python framework; this feature
enables it for Rust plugins as well.

Changelog-Added: cln-plugin: Implement send_custom_notification to allow sending custom notifications to other plugins.
2023-10-30 18:24:23 +01:00
Vincenzo Palazzo d56abe208b splice: unwrap the old_secret during tx candidates
While running the integration testing in VLS we noted that there is a problem with the old_secret during that revoke and ack.

The built-in signer of core lightning return always the secret, but with a signer with more strict policies this can not be true.

In fact, the VLS return the old_secret only if it is the last tx candidate. So we should keep track of the old_secret during the recursion.

The current core is unsage because we can only revoke transaction M-1 once we have transaction M signed by the counterparty. If there is a splice candidate that is unsigned yet, and we revoke commitment transaction M-1 for it, and it gets into the blockchain, and the peer goes away, we can't force close anymore.

lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: (null):0 ((null)) 0xffffffffffffffff
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: FATAL SIGNAL (version v23.08-64-gbffe599)
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: common/daemon.c:38 (send_backtrace) 0x55c4a2ebd97b
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: common/status.c:221 (status_failed) 0x55c4a2ecf0ae
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: common/subdaemon.c:18 (status_backtrace_exit) 0x55c4a2ecf42b
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: common/daemon.c:78 (crashdump) 0x55c4a2ebdb16
lightningd-1 2023-10-25T15:24:25.151Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 ((null)) 0x7f084e44251f
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317 ((null)) 0x7f084e5a09cd
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: wire/towire.c:17 (towire) 0x55c4a2ed610e
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: bitcoin/privkey.c:33 (towire_secret) 0x55c4a2eea03b
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: wire/peer_wiregen.c:2737 (towire_revoke_and_ack) 0x55c4a2ee1d3d
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:1850 (make_revocation_msg_from_secret) 0x55c4a2e9d80e
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:1931 (send_revocation) 0x55c4a2e9de7a
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:2249 (handle_peer_commit_sig) 0x55c4a2e9f175
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:2880 (interactive_send_commitments) 0x55c4a2ea0c2e
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:3937 (splice_initiator_user_finalized) 0x55c4a2ea40ce
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:4011 (splice_initiator_user_update) 0x55c4a2ea44d4
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:5756 (req_in) 0x55c4a2ea8d9d
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: channeld/channeld.c:6151 (main) 0x55c4a2eaa3f8
lightningd-1 2023-10-25T15:24:25.152Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: ../sysdeps/nptl/libc_start_call_main.h:58 (__libc_start_call_main) 0x7f084e429d8f
lightningd-1 2023-10-25T15:24:25.153Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: ../csu/libc-start.c:392 (__libc_start_main_impl) 0x7f084e429e3f
lightningd-1 2023-10-25T15:24:25.153Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: (null):0 ((null)) 0x55c4a2e98734
lightningd-1 2023-10-25T15:24:25.153Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: backtrace: (null):0 ((null)) 0xffffffffffffffff
lightningd-1 2023-10-25T15:24:25.153Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: STATUS_FAIL_INTERNAL_ERROR: FATAL SIGNAL

Reported-by: devrandom
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-10-30 11:57:51 +10:30
Peter Neuroth f26a758f1c poetry: Add requests dependency
The requests module is required by `devtools/changelog.py`

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-30 11:54:30 +10:30
Rusty Russell 62ddf84b4f doc: document wait for new subsystems, add request & response schemas.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell af971fd025 wait forwards: add in_htlc_id
Without this, we have no unique identifier for which forward happened.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell 0317348479 pytest: add test for wait forwards.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell f2162bf202 lightningd: add ordering and pagination to listforwards.
Changelog-Added: JSON-RPC: `listforwards` new parameters `index`, `start` and `limit`.
2023-10-28 15:48:26 +10:30
Rusty Russell 1d8af90b56 listforwards: add created_index and updated_index fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listforwards` fields `created_index` (old: `id`) and `updated_index`.
2023-10-28 15:48:26 +10:30
Rusty Russell de1e459196 forwards: hook into the wait subsystem.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `wait` now works for `forwards` infrastructure.
2023-10-28 15:48:26 +10:30
Rusty Russell e58ae31947 lightningd: hook forwards into the wait system.
This table doesn't have `id`, except as the implicit one in Sqlite3,
so we need to add it for postgres.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell c4f2ada2ff lightningd: split up peer_htlcs a little, create forwards.c
peer_htlcs has become a bit of a dumping ground: move listforwards
etc to its own file.

Also move `struct channel_info` from peer_htlcs.h to channel.h where
it more logically belongs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell c70a326f1f lightningd: add ordering and pagination to listsendpays.
Changelog-Added: JSON-RPC: `listsendpays` new parameters `index`, `start` and `limit`.
2023-10-28 15:48:26 +10:30
Rusty Russell 00ac1a9475 listsendpays: add created_index and updated_index fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `sendpay`, `listsendpays`, `delpay` new fields `created_index` (old: `id`) and `updated_index`.
2023-10-28 15:48:26 +10:30
Rusty Russell 9ec6ac9922 lightningd: don't log that we're trying to pay if we're not.
Looking through logs I was surprise to see:

```
lightningd-1 2023-10-26T03:42:36.824Z INFO    lightningd: Sending 200000000msat over 1 hops to deliver 200000000msat
```

On a re-payment where we simply returned from sendpay immediately!  Move that log to later.
2023-10-28 15:48:26 +10:30
Rusty Russell f65c3cab75 wallet: use standard-style iterators for payments.
We used to have "unsaved" payments: now we don't we can use
our normal "iterator" pattern rather than returning arrays.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell 89cda26164 lightningd: rename struct sendpay_command to waitsendpay_command.
It used to be used for both `sendpay` and `waitsendpay` but now it's
only for the latter, so the name is confusing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell 2689a4ed76 wallet: don't expose wallet_payment constructor, use wallet_add_payment.
Have it construct and return.  No need to expose details about dbid...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell 52b1ba2992 wallet: remove premature optimization when making payment.
We didn't write to db immediately, but waited until it the actual HTLC got
added (or failed).  That way we didn't have a separate transaction to
write the payment into the db, but the complexity is not worth it: it
makes the next refactors harder, since we can't use the normal
iterator patterns like we do with the rest of the db (as we have to add
the unstored ones).

We might as well also make sendpay return immediately: we used to return
once the HTLC had been confirmed sent, since we entered it in the db
at that point, but we can keep it simple now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell c2d89e4624 sendpays: hook into the wait subsystem.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `wait` now works for `sendpays` infrastructure.
2023-10-28 15:48:26 +10:30
Rusty Russell 896cb61c8c db: initialize variable to hold max payments id.
We generalize the invoice routine, though it's (known) buggy, so we have
to copy it.  We rename the invoice routine to a more specific name though.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Rusty Russell ccb8d4b687 sendpays: add to wait subsystem.
Adding an index means:

1. Add the new subsystem, and new updated_index field to the db, and
   create xxx_index_deleted/created/updated APIs.
2. Hook up these functions to the points they need to be called.
3. Add index, start and limit fields to the list command.
4. Add created_index and updated_index into the list command.

This does #1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-28 15:48:26 +10:30
Aditya Sharma 34692ec3c8 tests/test_misc.py: Add test_decode to test the decryption of bech32 encoding of emergency.recover 2023-10-27 16:05:28 +10:30
Aditya Sharma 8d36b7c438 tools/hsmtool.c: Add to hsmtools to get content of emergency.recover in bech32 format.
Changelog-Added: `hsmtool`: new command `getemergencyrecover` to extract emergency.recover in bech32 format (clnemerge1...)
2023-10-27 16:05:28 +10:30
Aditya Sharma b0c603581f doc/lightning-decode.7: Update the doc 2023-10-27 16:05:28 +10:30
Aditya Sharma d130982aad plugins/offers: Extend the capability of decode to decrypt the contents of emergency.recover file.
Changelog-Added: JSON-RPC: `decode` can now decide emergency.recover files (clnemerg1...)
2023-10-27 16:05:28 +10:30
Dusty Daemon 990f4d0dad splice: Update test for new logs
The log messages were changed but the test fields weren’t updated, resulting in some test flakiness. Being more explicit with the log message we’re looking for should help.

Changelog-None
2023-10-27 13:20:33 +10:30
Rusty Russell f8e036b22d channeld: use anchors on peer's commitment(s) if we can't broadcast our own.
This means refactoring out some of the generic anchor info, from the
per-commitment-tx info (we can have at least two, perhaps more with
splicing!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-27 11:19:56 +10:30
Rusty Russell 484deb94fa lightningd: save peer's commitment anchor info into db.
We actually only need to remember the last two, worst case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-27 11:19:56 +10:30
Rusty Russell be96d33461 lightningd: routines to deal with peer commitment anchor info in db.
Store enough to know how to CPFP the peer's commitment tx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-27 11:19:56 +10:30
Rusty Russell e609bc934e channeld: tell lightningd about local anchor for each commitment tx.
It's going to want to remember these, in case it encounters peers'
commitment tx and needs to boost it with CPFP on the anchor.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-27 11:19:56 +10:30
Rusty Russell 01d31e7dde channeld: have commit_tx tell is what output was the other's anchor.
We're going to want this, soon.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-27 11:19:56 +10:30