Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CapabilityRequiringPayload from NewBlockBroadcastMessage #3250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
// }
}