File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -163,15 +163,16 @@ def sync(self):
163163 self .unhandled_messages .pop (transient_id )
164164
165165 unhandled_entries .sort (key = lambda e : e [1 ], reverse = False )
166- cumulative_size = 0
166+ per_message_overhead = 16 # Really only 2 bytes, but set a bit higher for now
167+ cumulative_size = 24 # Initialised to highest reasonable binary structure overhead
167168 for unhandled_entry in unhandled_entries :
168169 transient_id = unhandled_entry [0 ]
169170 weight = unhandled_entry [1 ]
170171 lxm_size = unhandled_entry [2 ]
171172 if self .propagation_transfer_limit != None and cumulative_size + lxm_size > (self .propagation_transfer_limit * 1000 ):
172173 pass
173174 else :
174- cumulative_size += lxm_size
175+ cumulative_size += ( lxm_size + per_message_overhead )
175176 unhandled_ids .append (transient_id )
176177
177178 RNS .log ("Sending sync request to peer " + str (self .destination ), RNS .LOG_DEBUG )
You can’t perform that action at this time.
0 commit comments