From b57fed047a27f9359b2f66ce8fcbfe94389a078e Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 6 Oct 2021 12:37:09 -0500 Subject: [PATCH] dusty htlcs: don't fail the channel, make it error a whole bunch Let's make this a softer launch by just warning on the channel til the feerates go back down. You can also 'fix' this by upping your dust limit with the `max-dust-htlc-exposure-msat` config. --- channeld/channeld.c | 8 ++++---- tests/test_pay.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 27610241a..8d26ad1ac 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -1309,10 +1309,10 @@ static void send_commit(struct peer *peer) /* Is this feerate update going to push the committed * htlcs over our allowed dust limits? */ if (!htlc_dust_ok(peer->channel, feerate_target, REMOTE) - || !htlc_dust_ok(peer->channel, feerate_target, LOCAL)) - /* We fail the channel. Oops */ - peer_failed_err(peer->pps, &peer->channel_id, - "Too much dust to update fee"); + || !htlc_dust_ok(peer->channel, feerate_target, LOCAL)) + peer_failed_warn(peer->pps, &peer->channel_id, + "Too much dust to update fee (Desired" + " feerate update %d)", feerate_target); if (!channel_update_feerate(peer->channel, feerate_target)) status_failed(STATUS_FAIL_INTERNAL_ERROR, diff --git a/tests/test_pay.py b/tests/test_pay.py index a604b8809..dd972de38 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2496,9 +2496,9 @@ def test_htlc_too_dusty_outgoing(node_factory, bitcoind, chainparams): l1.set_feerates([feerate * 2] * 4, False) l1.restart() - # the channel should fail -- too much dust + # the channel should start warning -- too much dust inv = l2.rpc.invoice(htlc_val_msat, str(num_dusty_htlcs + 1), str(num_dusty_htlcs + 1)) - with pytest.raises(RpcError, match=r'WIRE_UNKNOWN_NEXT_PEER'): + with pytest.raises(RpcError, match=r'WIRE_TEMPORARY_CHANNEL_FAILURE'): l1.rpc.sendpay(route, inv['payment_hash'], payment_secret=inv['payment_secret'])