Merge pull request #3151 from chimp1984/dont-send-bsq-blocks-to-full-nodes

Do not send BSQ blocks to full nodes
This commit is contained in:
Christoph Atteneder 2019-08-28 12:42:16 +02:00 committed by GitHub
commit 4478476763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,7 @@ public enum Capability {
PROPOSAL,
BLIND_VOTE,
ACK_MSG,
BSQ_BLOCK,
RECEIVE_BSQ_BLOCK,
DAO_STATE,
BUNDLE_OF_ENVELOPES,
SIGNED_ACCOUNT_AGE_WITNESS

View File

@ -64,6 +64,6 @@ public final class NewBlockBroadcastMessage extends BroadcastMessage implements
@Override
public Capabilities getRequiredCapabilities() {
return new Capabilities(Capability.BSQ_BLOCK);
return new Capabilities(Capability.RECEIVE_BSQ_BLOCK);
}
}

View File

@ -29,10 +29,10 @@ import lombok.extern.slf4j.Slf4j;
public class CoreNetworkCapabilities {
public static void setSupportedCapabilities(BisqEnvironment bisqEnvironment) {
Capabilities.app.addAll(Capability.TRADE_STATISTICS, Capability.TRADE_STATISTICS_2, Capability.ACCOUNT_AGE_WITNESS, Capability.ACK_MSG);
Capabilities.app.addAll(Capability.BUNDLE_OF_ENVELOPES,Capability.SIGNED_ACCOUNT_AGE_WITNESS);
Capabilities.app.addAll(Capability.BUNDLE_OF_ENVELOPES, Capability.SIGNED_ACCOUNT_AGE_WITNESS);
if (BisqEnvironment.isDaoActivated(bisqEnvironment)) {
Capabilities.app.addAll(Capability.PROPOSAL, Capability.BLIND_VOTE, Capability.BSQ_BLOCK, Capability.DAO_STATE);
Capabilities.app.addAll(Capability.PROPOSAL, Capability.BLIND_VOTE, Capability.DAO_STATE);
maybeApplyDaoFullMode(bisqEnvironment);
}
@ -46,6 +46,10 @@ public class CoreNetworkCapabilities {
if (isFullDaoNode != null && !isFullDaoNode.isEmpty() && isFullDaoNode.toLowerCase().equals("true")) {
log.info("Set Capability.DAO_FULL_NODE");
Capabilities.app.addAll(Capability.DAO_FULL_NODE);
} else {
// A lite node has the capability to receive bsq blocks. We do not want to send BSQ blocks to full nodes
// as they ignore them anyway.
Capabilities.app.addAll(Capability.RECEIVE_BSQ_BLOCK);
}
}
}