mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
htlc_add: only limit is on receiving side.
BOLT has been updated, so update code and comments. The receiving side check is sufficient, as the limit is per-offerer, and that's the only way the HTLCs get back to the offerer's side. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -619,10 +619,9 @@ Pkt *accept_pkt_htlc_add(struct peer *peer, const Pkt *pkt)
|
||||
/* BOLT #2:
|
||||
*
|
||||
* A node MUST NOT add a HTLC if it would result in it
|
||||
* offering more than 300 HTLCs in either commitment transaction.
|
||||
* offering more than 300 HTLCs in the remote commitment transaction.
|
||||
*/
|
||||
if (tal_count(peer->remote.staging_cstate->side[THEIRS].htlcs) == 300
|
||||
|| tal_count(peer->local.staging_cstate->side[THEIRS].htlcs) == 300)
|
||||
if (tal_count(peer->remote.staging_cstate->side[THEIRS].htlcs) == 300)
|
||||
return pkt_err(peer, "Too many HTLCs");
|
||||
|
||||
/* BOLT #2:
|
||||
|
||||
Reference in New Issue
Block a user