Class Generator

java.lang.Object
nxt.blockchain.Generator
All Implemented Interfaces:
Comparable<Generator>

public final class Generator extends Object implements Comparable<Generator>
  • Method Details

    • init

      public static void init()
    • addListener

      public static boolean addListener(Listener<Generator> listener, Generator.Event eventType)
    • removeListener

      public static boolean removeListener(Listener<Generator> listener, Generator.Event eventType)
    • startForging

      public static Generator startForging(byte[] privateKey)
    • stopForging

      public static Generator stopForging(byte[] privateKey)
    • stopForging

      public static int stopForging()
    • getGenerator

      public static Generator getGenerator(byte[] privateKey)
    • getGeneratorCount

      public static int getGeneratorCount()
    • getAllGenerators

      public static Collection<Generator> getAllGenerators()
    • getSortedForgers

      public static List<Generator> 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

      public int compareTo(Generator g)
      Specified by:
      compareTo in interface Comparable<Generator>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNextGenerators

      public static List<Generator.ActiveGenerator> 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