Browse Source

Don't send empty link state messages if there's nothing to send

Caleb James DeLisle 5 years ago
parent
commit
9028b86d63
1 changed files with 1 additions and 0 deletions
  1. 1 0
      subnode/LinkState.h

+ 1 - 0
subnode/LinkState.h

@@ -60,6 +60,7 @@ static inline int LinkState_encode(
         err |= VarInt_push(&iter, ls->lagSlots[idx]);
     }
     if (err) { return 1; }
+    if (!count) { return 0; }
 
     // index of the first slot which should be updated when parsing
     Assert_true(!VarInt_push(&iter, (i + 1) % LinkState_SLOTS));