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

Add method to check if svp is ongoing #2713

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
13 changes: 13 additions & 0 deletions rskj-core/src/main/java/co/rsk/peg/BridgeSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,19 @@ public void updateCollections(Transaction rskTx) throws IOException {
updateFederationCreationBlockHeights();
}

private boolean svpIsOngoing() {
Optional<Federation> proposedFederationOpt = federationSupport.getProposedFederation();

if (!proposedFederationOpt.isPresent()) {
return false;
}
Federation proposedFederation = proposedFederationOpt.get();

long validationPeriodEndBlock = proposedFederation.getCreationBlockNumber()
+ bridgeConstants.getFederationConstants().getValidationPeriodDurationInBlocks();
return rskExecutionBlock.getNumber() <= validationPeriodEndBlock;
}

protected void processSvpFundTransactionUnsigned(Transaction rskTx) throws IOException, InsufficientMoneyException {
Optional<Federation> proposedFederationOpt = federationSupport.getProposedFederation();
if (!proposedFederationOpt.isPresent()) {
Expand Down
Loading