Skip to content

Commit

Permalink
Merge pull request #3250 from chimp1984/remove-required-capability
Browse files Browse the repository at this point in the history
Remove CapabilityRequiringPayload from NewBlockBroadcastMessage
  • Loading branch information
ripcurlx authored Sep 13, 2019
2 parents 3b35386 + e71b6d6 commit e84fffb
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@
import bisq.core.dao.node.full.RawBlock;

import bisq.network.p2p.storage.messages.BroadcastMessage;
import bisq.network.p2p.storage.payload.CapabilityRequiringPayload;

import bisq.common.app.Capabilities;
import bisq.common.app.Capability;
import bisq.common.app.Version;
import bisq.common.proto.network.NetworkEnvelope;

import lombok.EqualsAndHashCode;
import lombok.Getter;

// We remove the CapabilityRequiringPayload interface to avoid risks that new BSQ blocks are not well distributed in
// case the capability is not exchanged at the time when the message is sent. We need to improve the capability handling
// so that we can be sure that we know the actual capability of the peer.

// This message is sent only to lite DAO nodes (full nodes get block from their local bitcoind)
@EqualsAndHashCode(callSuper = true)
@Getter
public final class NewBlockBroadcastMessage extends BroadcastMessage implements CapabilityRequiringPayload {
public final class NewBlockBroadcastMessage extends BroadcastMessage /*implements CapabilityRequiringPayload*/ {
private final RawBlock block;

public NewBlockBroadcastMessage(RawBlock block) {
Expand Down Expand Up @@ -63,8 +64,8 @@ public static NetworkEnvelope fromProto(protobuf.NewBlockBroadcastMessage proto,
messageVersion);
}

@Override
public Capabilities getRequiredCapabilities() {
return new Capabilities(Capability.RECEIVE_BSQ_BLOCK);
}
// @Override
// public Capabilities getRequiredCapabilities() {
// return new Capabilities(Capability.RECEIVE_BSQ_BLOCK);
// }
}

0 comments on commit e84fffb

Please sign in to comment.