Skip to content

Commit

Permalink
Add method to check if svp is ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-zack committed Sep 11, 2024
1 parent 9d03dfa commit f84b459
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit f84b459

Please sign in to comment.