Skip to content

Commit

Permalink
df: use system-wide setting for our local config of require-confirmed
Browse files Browse the repository at this point in the history
We were saving the initial setting and re-using it for the life of the
channel, but I think it makes sense to update to using whatever the
system setting is at restart?

We're leaving a record of what was originally done at start for now,
either so splicing can reuse or future cleanup.

Changelog-Changed: On RBF, v2 opens use the current system-wide setting for `require-confirmed-inputs`, instead of the setting from when channel was initialized
  • Loading branch information
niftynei committed Dec 14, 2023
1 parent d6b6ff2 commit 82749ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lightningd/dual_open_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -4170,7 +4170,7 @@ bool peer_restart_dualopend(struct peer *peer,
amount_sat_zero(inflight->lease_amt) ?
NULL : &inflight->lease_amt,
channel->type,
channel->req_confirmed_ins[LOCAL],
peer->ld->config.require_confirmed_inputs,
channel->req_confirmed_ins[REMOTE]);

subd_send_msg(channel->owner, take(msg));
Expand Down
7 changes: 2 additions & 5 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,13 +2408,10 @@ def _no_utxo_response(r):
min_witness_weight=110,
excess_as_change=True)['psbt']

# Attempt bump, fail. L2 should remember required-confirmed-inputs
# from original channel negotiation, despite node-wide setting
# being flagged off
# Attempt bump, L2 uses the system-wide setting now.
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
bump = l1.rpc.openchannel_bump(res['channel_id'], amount, psbt)
with pytest.raises(RpcError, match=r'Input .* is not confirmed'):
l1.rpc.openchannel_update(res['channel_id'], bump['psbt'])
l1.rpc.openchannel_update(res['channel_id'], bump['psbt'])

_verify_utxos(l1, utxo_lookups)

Expand Down

0 comments on commit 82749ff

Please sign in to comment.