Skip to content

Commit

Permalink
Only send bundle if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
freimair committed Jul 10, 2019
1 parent b44cb45 commit 31a4ba3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2p/src/main/java/bisq/network/p2p/network/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ public void sendMessage(NetworkEnvelope networkEnvelope) {
bundleSender.schedule(() -> {
if (!stopped) {
synchronized (lock) {
protoOutputStream.writeEnvelope(queueOfBundles.poll());
BundleOfEnvelopes current = queueOfBundles.poll();
if(current.getEnvelopes().size() == 1)
protoOutputStream.writeEnvelope(current.getEnvelopes().get(0));
else
protoOutputStream.writeEnvelope(current);
}
}
}, lastSendTimeStamp - now, TimeUnit.MILLISECONDS);
Expand Down

0 comments on commit 31a4ba3

Please sign in to comment.