[bisq-network/bisq] Bundle of envelopes (#2939)
Florian Reimair
notifications at github.com
Mon Jul 8 14:24:39 UTC 2019
freimair commented on this pull request.
> + long elapsed = now - lastSendTimeStamp;
+ if (elapsed < sendMsgThrottleTrigger) {
+ log.debug("We got 2 sendMessage requests in less than {} ms. We set the thread to sleep " +
+ "for {} ms to avoid flooding our peer. lastSendTimeStamp={}, now={}, elapsed={}, networkEnvelope={}",
+ sendMsgThrottleTrigger, sendMsgThrottleSleep, lastSendTimeStamp, now, elapsed,
+ networkEnvelope.getClass().getSimpleName());
+
+ // check if BundleOfEnvelopes is supported
+ if(getCapabilities().containsAll(new Capabilities(Capability.ENVELOPE_OF_ENVELOPES))) {
+ synchronized (lock) {
+ // check if current envelope fits size
+ // - no? create new envelope
+ if(queueOfBundles.isEmpty() || queueOfBundles.element().toProtoNetworkEnvelope().getSerializedSize() + networkEnvelope.toProtoNetworkEnvelope().getSerializedSize() > MAX_PERMITTED_MESSAGE_SIZE * 0.9) {
+ // - no? create a bucket
+ queueOfBundles.add(new BundleOfEnvelopes());
+ System.err.println("added fresh container");
well :). PR updated.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2939#discussion_r301122280
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190708/8da5fbb7/attachment.html>
More information about the bisq-github
mailing list