mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Add todo and curly brackets
This commit is contained in:
parent
5433707fa2
commit
06f407fda3
1 changed files with 6 additions and 3 deletions
|
@ -225,7 +225,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
|
||||
// Called from various threads
|
||||
public void sendMessage(NetworkEnvelope networkEnvelope) {
|
||||
log.debug(">> Send networkEnvelope of type: " + networkEnvelope.getClass().getSimpleName());
|
||||
log.debug(">> Send networkEnvelope of type: {}", networkEnvelope.getClass().getSimpleName());
|
||||
|
||||
if (!stopped) {
|
||||
if (noCapabilityRequiredOrCapabilityIsSupported(networkEnvelope)) {
|
||||
|
@ -319,6 +319,8 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: If msg is BundleOfEnvelopes we should check each individual message for capability and filter out those
|
||||
// which fail.
|
||||
public boolean noCapabilityRequiredOrCapabilityIsSupported(Proto msg) {
|
||||
boolean result;
|
||||
if (msg instanceof AddDataMessage) {
|
||||
|
@ -408,12 +410,13 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
public void onMessage(NetworkEnvelope networkEnvelope, Connection connection) {
|
||||
checkArgument(connection.equals(this));
|
||||
|
||||
if (networkEnvelope instanceof BundleOfEnvelopes)
|
||||
if (networkEnvelope instanceof BundleOfEnvelopes) {
|
||||
for (NetworkEnvelope current : ((BundleOfEnvelopes) networkEnvelope).getEnvelopes()) {
|
||||
UserThread.execute(() -> messageListeners.forEach(e -> e.onMessage(current, connection)));
|
||||
}
|
||||
else
|
||||
} else {
|
||||
UserThread.execute(() -> messageListeners.forEach(e -> e.onMessage(networkEnvelope, connection)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue