You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforce max_balance_dust_htlc_msat at HTLC reception/forward
At `update_add_htlc()`/`send_htlc()`, we verify that the inbound/
outbound dust or the sum of both, on either sides of the link isn't
above new config setting `max_balance_dust_htlc_msat`.
A dust HTLC is hence defined as a trimmed-to-dust one, i.e including
the fee cost to publish its claiming transaction.
if msg.amount_msat / 1000 < (self.feerate_per_kwasu64*HTLC_TIMEOUT_TX_WEIGHT / 1000) + self.counterparty_dust_limit_satoshis{
2065
+
if on_counterparty_tx_dust_inbound + on_counterparty_tx_dust_outbound + msg.amount_msat > self.get_max_balance_dust_htlc_msat(){
2066
+
log_info!(logger,"Cannot accept value that would put holder dusted balance {} on counterparty commitment over limit {}", on_counterparty_tx_dust_inbound + on_counterparty_tx_dust_outbound + msg.amount_msat,self.get_max_balance_dust_htlc_msat());
if msg.amount_msat / 1000 < (self.feerate_per_kwasu64*HTLC_SUCCESS_TX_WEIGHT / 1000) + self.holder_dust_limit_satoshis{
2072
+
if on_holder_tx_dust_inbound + on_holder_tx_dust_outbound + msg.amount_msat > self.get_max_balance_dust_htlc_msat(){
2073
+
log_info!(logger,"Cannot accept value that would put holder dusted balance {} on holder commitment over limit {}", on_holder_tx_dust_inbound + on_holder_tx_dust_outbound + msg.amount_msat,self.get_max_balance_dust_htlc_msat());
if amount_msat / 1000 < (self.feerate_per_kwasu64*HTLC_SUCCESS_TX_WEIGHT / 1000) + self.counterparty_dust_limit_satoshis{
4147
+
if on_counterparty_tx_dust_inbound + on_counterparty_tx_dust_outbound + amount_msat > self.get_max_balance_dust_htlc_msat(){
4148
+
returnErr(ChannelError::Ignore(format!("Cannot send value that would put holder dusted balance {} on counterparty commitment over limit {}", on_counterparty_tx_dust_inbound + on_counterparty_tx_dust_outbound + amount_msat,self.get_max_balance_dust_htlc_msat())));
4149
+
}
4150
+
}
4151
+
4152
+
if amount_msat / 1000 < (self.feerate_per_kwasu64*HTLC_TIMEOUT_TX_WEIGHT / 1000) + self.holder_dust_limit_satoshis{
4153
+
if on_holder_tx_dust_inbound + on_holder_tx_dust_outbound + amount_msat > self.get_max_balance_dust_htlc_msat(){
4154
+
returnErr(ChannelError::Ignore(format!("Cannot send value that would put holder dusted balance {} on holder commitment over limit {}", on_holder_tx_dust_inbound + on_holder_tx_dust_outbound + amount_msat,self.get_max_balance_dust_htlc_msat())));
4155
+
}
4156
+
}
4157
+
4128
4158
let pending_value_to_self_msat = self.value_to_self_msat - htlc_outbound_value_msat;
4129
4159
if pending_value_to_self_msat < amount_msat {
4130
4160
returnErr(ChannelError::Ignore(format!("Cannot send value that would overdraw remaining funds. Amount: {}, pending value to self {}", amount_msat, pending_value_to_self_msat)));
0 commit comments