Gun - mesh. Putting the dam message first solve the problem of the first gun 'in' event come without peer.id.

This commit is contained in:
Adriano Rogowski 2018-12-20 21:10:02 -02:00
parent 51b98ba370
commit 6d12b3d5a9
2 changed files with 3 additions and 3 deletions

2
gun.js
View File

@ -2027,7 +2027,7 @@
if(peer.batch){
peer.tail = (peer.tail || 0) + raw.length;
if(peer.tail <= opt.pack){
peer.batch.push(raw);
(msg.dam) ? peer.batch.unshift(raw) : peer.batch.push(raw);
return;
}
flush(peer);

View File

@ -101,7 +101,7 @@ function Mesh(ctx){
if(peer.batch){
peer.tail = (peer.tail || 0) + raw.length;
if(peer.tail <= opt.pack){
peer.batch.push(raw);
(msg.dam) ? peer.batch.unshift(raw) : peer.batch.push(raw);
return;
}
flush(peer);
@ -230,4 +230,4 @@ Mesh.hash = function(s){ // via SO
try{ module.exports = Mesh }catch(e){}