Skip to content

Commit

Permalink
dusty htlcs: don't fail the channel, make it error a whole bunch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
niftynei committed Oct 6, 2021
1 parent d14cde0 commit ae76ca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,10 +1310,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,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,9 +2493,9 @@ def test_htlc_too_dusty_outgoing(node_factory, bitcoind):
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'])


Expand Down

0 comments on commit ae76ca2

Please sign in to comment.