Skip to content

Commit

Permalink
Merge pull request #2695 from rsksmart/adding-snap-capability-if-clie…
Browse files Browse the repository at this point in the history
…nt-is-enabled

Adding SNAP capability if the client or the server are enabled
  • Loading branch information
rmoreliovlabs authored Aug 23, 2024
2 parents 8fc7aa0 + c36348f commit a3c6885
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public int getLongSyncLimit() {
public List<String> peerCapabilities() {
List<String> capabilities = super.peerCapabilities();

if (isServerSnapshotSyncEnabled()) {
if (isSnapshotSyncEnabled()) {
capabilities.add(Capability.SNAP);
}

Expand Down Expand Up @@ -554,6 +554,10 @@ public GasPriceCalculator.GasCalculatorType getGasCalculatorType() {
return gasCalculatorType;
}

public boolean isSnapshotSyncEnabled(){
return isServerSnapshotSyncEnabled() || isClientSnapshotSyncEnabled();
}

private void fetchMethodTimeout(Config configElement, Map<String, Long> methodTimeoutMap) {
configElement.getObject("methods.timeout")
.unwrapped()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ConfigCapabilitiesImpl(RskSystemProperties config) {
}
}

if (config.isServerSnapshotSyncEnabled() && allCapabilities.stream().anyMatch(Capability::isRSK)) {
if (config.isSnapshotSyncEnabled() && allCapabilities.stream().anyMatch(Capability::isRSK)) {
allCapabilities.add(new Capability(SNAP, SNAP_VERSION));
}

Expand Down

0 comments on commit a3c6885

Please sign in to comment.