Skip to content

Commit ae76ca2

Browse files
committed
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.
1 parent d14cde0 commit ae76ca2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

channeld/channeld.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,10 +1310,10 @@ static void send_commit(struct peer *peer)
13101310
/* Is this feerate update going to push the committed
13111311
* htlcs over our allowed dust limits? */
13121312
if (!htlc_dust_ok(peer->channel, feerate_target, REMOTE)
1313-
|| !htlc_dust_ok(peer->channel, feerate_target, LOCAL))
1314-
/* We fail the channel. Oops */
1315-
peer_failed_err(peer->pps, &peer->channel_id,
1316-
"Too much dust to update fee");
1313+
|| !htlc_dust_ok(peer->channel, feerate_target, LOCAL))
1314+
peer_failed_warn(peer->pps, &peer->channel_id,
1315+
"Too much dust to update fee (Desired"
1316+
" feerate update %d)", feerate_target);
13171317

13181318
if (!channel_update_feerate(peer->channel, feerate_target))
13191319
status_failed(STATUS_FAIL_INTERNAL_ERROR,

tests/test_pay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,9 +2493,9 @@ def test_htlc_too_dusty_outgoing(node_factory, bitcoind):
24932493
l1.set_feerates([feerate * 2] * 4, False)
24942494
l1.restart()
24952495

2496-
# the channel should fail -- too much dust
2496+
# the channel should start warning -- too much dust
24972497
inv = l2.rpc.invoice(htlc_val_msat, str(num_dusty_htlcs + 1), str(num_dusty_htlcs + 1))
2498-
with pytest.raises(RpcError, match=r'WIRE_UNKNOWN_NEXT_PEER'):
2498+
with pytest.raises(RpcError, match=r'WIRE_TEMPORARY_CHANNEL_FAILURE'):
24992499
l1.rpc.sendpay(route, inv['payment_hash'], payment_secret=inv['payment_secret'])
25002500

25012501

0 commit comments

Comments
 (0)