-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terminal Condition is now a Boolean Provider
Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
- Loading branch information
Showing
5 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...a/org/hyperledger/besu/ethereum/eth/sync/fullsync/FlexibleBlockHashTerminalCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.hyperledger.besu.ethereum.eth.sync.fullsync; | ||
|
||
import org.hyperledger.besu.datatypes.Hash; | ||
import org.hyperledger.besu.ethereum.chain.Blockchain; | ||
|
||
public class FlexibleBlockHashTerminalCondition implements FullSyncTerminationCondition { | ||
private Hash blockHash; | ||
private final Blockchain blockchain; | ||
|
||
public FlexibleBlockHashTerminalCondition(final Hash blockHash, final Blockchain blockchain) { | ||
this.blockHash = blockHash; | ||
this.blockchain = blockchain; | ||
} | ||
|
||
public synchronized void setBlockHash(final Hash blockHash) { | ||
this.blockHash = blockHash; | ||
} | ||
|
||
@Override | ||
public synchronized boolean getAsBoolean() { | ||
return blockchain.contains(blockHash); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters