Skip to content

Commit b57fed0

Browse files
niftyneicdecker
authored andcommitted
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 cad082a commit b57fed0

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
@@ -1309,10 +1309,10 @@ static void send_commit(struct peer *peer)
13091309
/* Is this feerate update going to push the committed
13101310
* htlcs over our allowed dust limits? */
13111311
if (!htlc_dust_ok(peer->channel, feerate_target, REMOTE)
1312-
|| !htlc_dust_ok(peer->channel, feerate_target, LOCAL))
1313-
/* We fail the channel. Oops */
1314-
peer_failed_err(peer->pps, &peer->channel_id,
1315-
"Too much dust to update fee");
1312+
|| !htlc_dust_ok(peer->channel, feerate_target, LOCAL))
1313+
peer_failed_warn(peer->pps, &peer->channel_id,
1314+
"Too much dust to update fee (Desired"
1315+
" feerate update %d)", feerate_target);
13161316

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

tests/test_pay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,9 +2496,9 @@ def test_htlc_too_dusty_outgoing(node_factory, bitcoind, chainparams):
24962496
l1.set_feerates([feerate * 2] * 4, False)
24972497
l1.restart()
24982498

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

25042504

0 commit comments

Comments
 (0)