Package nxt.blockchain
Class Generator
java.lang.Object
nxt.blockchain.Generator
- All Implemented Interfaces:
Comparable<Generator>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classActive generatorstatic enum -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddListener(Listener<Generator> listener, Generator.Event eventType) static booleanallowsFakeForging(byte[] publicKey) intlongstatic Collection<Generator>longstatic GeneratorgetGenerator(byte[] privateKey) static intlongstatic List<Generator.ActiveGenerator>Return a list of generators for the next block.static longgetNextHitTime(long lastBlockId, int curTime) byte[]static voidinit()static booleanremoveListener(Listener<Generator> listener, Generator.Event eventType) static voidsetDelay(int delay) static GeneratorstartForging(byte[] privateKey) static intstatic GeneratorstopForging(byte[] privateKey) toString()static booleanverifyHit(BigInteger hit, BigInteger effectiveBalance, Block previousBlock, int timestamp)
-
Method Details
-
init
public static void init() -
addListener
-
removeListener
-
startForging
-
stopForging
-
stopForging
public static int stopForging() -
getGenerator
-
getGeneratorCount
public static int getGeneratorCount() -
getAllGenerators
-
getSortedForgers
-
getNextHitTime
public static long getNextHitTime(long lastBlockId, int curTime) -
setDelay
public static void setDelay(int delay) -
verifyHit
public static boolean verifyHit(BigInteger hit, BigInteger effectiveBalance, Block previousBlock, int timestamp) -
allowsFakeForging
public static boolean allowsFakeForging(byte[] publicKey) -
getPublicKey
public byte[] getPublicKey() -
getAccountId
public long getAccountId() -
getDeadline
public long getDeadline() -
getHitTime
public long getHitTime() -
compareTo
- Specified by:
compareToin interfaceComparable<Generator>
-
toString
-
getNextGenerators
Return a list of generators for the next block. The caller must hold the blockchain read lock to ensure the integrity of the returned list.- Returns:
- List of generator account identifiers
-