mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
df: for rbfs, since we know what they asked for, we can abort
if they request less than we wanted/accepted FIXME: add a test for this?
This commit is contained in:
parent
fa987f2344
commit
00d3e3e492
@ -3220,6 +3220,24 @@ static void rbf_local_start(struct state *state, u8 *msg)
|
||||
goto free_rbf_ctx;
|
||||
}
|
||||
|
||||
/* If their new amount is less than the lease we asked for,
|
||||
* abort, abort! */
|
||||
if (state->requested_lease
|
||||
&& amount_sat_less(tx_state->accepter_funding,
|
||||
*state->requested_lease)) {
|
||||
negotiation_failed(state,
|
||||
"We requested %s, which is more"
|
||||
" than they've offered to provide"
|
||||
" (%s)",
|
||||
type_to_string(tmpctx,
|
||||
struct amount_sat,
|
||||
state->requested_lease),
|
||||
type_to_string(tmpctx,
|
||||
struct amount_sat,
|
||||
&tx_state->accepter_funding));
|
||||
goto free_rbf_ctx;
|
||||
}
|
||||
|
||||
/* Now that we know the total of the channel, we can set the reserve */
|
||||
set_reserve(tx_state, total, state->our_role);
|
||||
|
||||
|
@ -343,6 +343,7 @@ def test_v2_rbf_single(node_factory, bitcoind, chainparams):
|
||||
|
||||
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
|
||||
@pytest.mark.openchannel('v2')
|
||||
@pytest.mark.xfail
|
||||
def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams):
|
||||
|
||||
opts = {'funder-policy': 'match', 'funder-policy-mod': 100,
|
||||
|
Loading…
Reference in New Issue
Block a user