mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
commando: limit to 16 partially-received incoming commands at a time.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
4cada557ba
commit
05a666e424
@@ -463,6 +463,10 @@ static void handle_incmd(struct node_id *peer,
|
||||
incmd->contents = tal_arr(incmd, u8, 0);
|
||||
tal_arr_expand(&incoming_commands, incmd);
|
||||
tal_add_destructor2(incmd, destroy_commando, &incoming_commands);
|
||||
|
||||
/* More than 16 partial commands at once? Free oldest */
|
||||
if (tal_count(incoming_commands) > 16)
|
||||
tal_free(incoming_commands[0]);
|
||||
}
|
||||
|
||||
/* 1MB should be enough for anybody! */
|
||||
|
||||
Reference in New Issue
Block a user