mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Add log in case protoOutputStream.writeEnvelope fails
This commit is contained in:
parent
00fe80ef0e
commit
a32653f790
1 changed files with 14 additions and 6 deletions
|
@ -283,12 +283,20 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
bundleSender.schedule(() -> {
|
||||
if (!stopped) {
|
||||
synchronized (lock) {
|
||||
BundleOfEnvelopes current = queueOfBundles.poll();
|
||||
if (current != null && !stopped) {
|
||||
if (current.getEnvelopes().size() == 1) {
|
||||
protoOutputStream.writeEnvelope(current.getEnvelopes().get(0));
|
||||
} else {
|
||||
protoOutputStream.writeEnvelope(current);
|
||||
BundleOfEnvelopes bundle = queueOfBundles.poll();
|
||||
if (bundle != null && !stopped) {
|
||||
NetworkEnvelope envelope = bundle.getEnvelopes().size() == 1 ?
|
||||
bundle.getEnvelopes().get(0) :
|
||||
bundle;
|
||||
try {
|
||||
protoOutputStream.writeEnvelope(envelope);
|
||||
} catch (Throwable t) {
|
||||
log.error("Sending envelope of class {} to address {} " +
|
||||
"failed due {}",
|
||||
envelope.getClass().getSimpleName(),
|
||||
this.getPeersNodeAddressOptional(),
|
||||
t.toString());
|
||||
log.error("envelope: {}", envelope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue