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 6, 2024
1 parent 38cdd32 commit 73703d4
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 @@ -956,6 +956,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 73703d4

Please sign in to comment.