nxt.blockchain

## Class BlockchainImpl

- java.lang.Object
- - nxt.blockchain.BlockchainImpl

- All Implemented Interfaces:
    Blockchain

      public final class BlockchainImpl
      extends java.lang.Object
      implements Blockchain

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DbIterator<BlockImpl>` | `getAllBlocks()`
    `BlockImpl` | `getBlock(long blockId)`
    `BlockImpl` | `getBlock(long blockId, boolean loadTransactions)`
    `BlockImpl` | `getBlockAtHeight(int height)`
    `int` | `getBlockCount(long accountId)`
    `long` | `getBlockIdAtHeight(int height)`
    `java.util.List<java.lang.Long>` | `getBlockIdsAfter(long blockId, int limit)`
    `DbIterator<BlockImpl>` | `getBlocks(java.sql.Connection con, java.sql.PreparedStatement pstmt)`
    `DbIterator<BlockImpl>` | `getBlocks(int from, int to)`
    `DbIterator<BlockImpl>` | `getBlocks(long accountId, int timestamp)`
    `DbIterator<BlockImpl>` | `getBlocks(long accountId, int timestamp, int from, int to)`
    `java.util.List<BlockImpl>` | `getBlocksAfter(long blockId, int limit)`
    `java.util.List<BlockImpl>` | `getBlocksAfter(long blockId, java.util.List<java.lang.Long> blockList)`
    `BlockImpl` | `getECBlock(int timestamp)`
    `DbIterator<? extends Transaction>` | `getExecutedTransactions(Chain chain, long senderId, long recipientId, byte type, byte subtype, int height, int numberOfConfirmations, int from, int to)`
    `java.util.List<TransactionImpl>` | `getExpectedTransactions(Filter<Transaction> filter)`
    `FxtTransactionImpl` | `getFxtTransaction(long transactionId)`
    `int` | `getHeight()`
    `static BlockchainImpl` | `getInstance()`
    `BlockImpl` | `getLastBlock()`
    `BlockImpl` | `getLastBlock(int timestamp)`
    `int` | `getLastBlockTimestamp()`
    `DbIterator<ChildTransactionImpl>` | `getReferencingTransactions(ChildChain childChain, byte[] referencedTransactionFullHash, int from, int to)`
    `TransactionImpl` | `getTransaction(Chain chain, byte[] fullHash)`
    `int` | `getTransactionCount(Chain chain)`
    `DbIterator<ChildTransactionImpl>` | `getTransactions(ChildChain childChain, java.sql.Connection con, java.sql.PreparedStatement pstmt)`
    `DbIterator<ChildTransactionImpl>` | `getTransactions(ChildChain childChain, long accountId, byte type, byte subtype, int blockTimestamp, boolean includeExpiredPrunable)`
    `DbIterator<ChildTransactionImpl>` | `getTransactions(ChildChain childChain, long accountId, int numberOfConfirmations, byte type, byte subtype, int blockTimestamp, boolean withMessage, boolean phasedOnly, boolean nonPhasedOnly, int from, int to, boolean includeExpiredPrunable, boolean executedOnly)`
    `DbIterator<FxtTransactionImpl>` | `getTransactions(FxtChain chain, java.sql.Connection con, java.sql.PreparedStatement pstmt)`
    `DbIterator<? extends FxtTransaction>` | `getTransactions(FxtChain chain, long accountId, int numberOfConfirmations, byte type, byte subtype, int blockTimestamp, int from, int to)`
    `boolean` | `hasBlock(long blockId)`
    `boolean` | `hasFxtTransaction(long transactionId)`
    `boolean` | `hasTransaction(Chain chain, byte[] fullHash)`
    `void` | `readLock()`
    `void` | `readUnlock()`
    `void` | `updateLock()`
    `void` | `updateUnlock()`
    `void` | `writeLock()`
    `void` | `writeUnlock()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static BlockchainImpl getInstance()

    - #### readLock

          public void readLock()

      Specified by:
        `readLock` in interface `Blockchain`

    - #### readUnlock

          public void readUnlock()

      Specified by:
        `readUnlock` in interface `Blockchain`

    - #### updateLock

          public void updateLock()

      Specified by:
        `updateLock` in interface `Blockchain`

    - #### updateUnlock

          public void updateUnlock()

      Specified by:
        `updateUnlock` in interface `Blockchain`

    - #### writeLock

          public void writeLock()

    - #### writeUnlock

          public void writeUnlock()

    - #### getLastBlock

          public BlockImpl getLastBlock()

      Specified by:
        `getLastBlock` in interface `Blockchain`

    - #### getHeight

          public int getHeight()

      Specified by:
        `getHeight` in interface `Blockchain`

    - #### getLastBlockTimestamp

          public int getLastBlockTimestamp()

      Specified by:
        `getLastBlockTimestamp` in interface `Blockchain`

    - #### getLastBlock

          public BlockImpl getLastBlock(int timestamp)

      Specified by:
        `getLastBlock` in interface `Blockchain`

    - #### getBlock

          public BlockImpl getBlock(long blockId)

      Specified by:
        `getBlock` in interface `Blockchain`

    - #### getBlock

          public BlockImpl getBlock(long blockId,
                                    boolean loadTransactions)

      Specified by:
        `getBlock` in interface `Blockchain`

    - #### hasBlock

          public boolean hasBlock(long blockId)

      Specified by:
        `hasBlock` in interface `Blockchain`

    - #### getAllBlocks

          public DbIterator<BlockImpl> getAllBlocks()

      Specified by:
        `getAllBlocks` in interface `Blockchain`

    - #### getBlocks

          public DbIterator<BlockImpl> getBlocks(int from,
                                                 int to)

      Specified by:
        `getBlocks` in interface `Blockchain`

    - #### getBlocks

          public DbIterator<BlockImpl> getBlocks(long accountId,
                                                 int timestamp)

      Specified by:
        `getBlocks` in interface `Blockchain`

    - #### getBlocks

          public DbIterator<BlockImpl> getBlocks(long accountId,
                                                 int timestamp,
                                                 int from,
                                                 int to)

      Specified by:
        `getBlocks` in interface `Blockchain`

    - #### getBlockCount

          public int getBlockCount(long accountId)

      Specified by:
        `getBlockCount` in interface `Blockchain`

    - #### getBlocks

          public DbIterator<BlockImpl> getBlocks(java.sql.Connection con,
                                                 java.sql.PreparedStatement pstmt)

      Specified by:
        `getBlocks` in interface `Blockchain`

    - #### getBlockIdsAfter

          public java.util.List<java.lang.Long> getBlockIdsAfter(long blockId,
                                                                 int limit)

      Specified by:
        `getBlockIdsAfter` in interface `Blockchain`

    - #### getBlocksAfter

          public java.util.List<BlockImpl> getBlocksAfter(long blockId,
                                                          int limit)

      Specified by:
        `getBlocksAfter` in interface `Blockchain`

    - #### getBlocksAfter

          public java.util.List<BlockImpl> getBlocksAfter(long blockId,
                                                          java.util.List<java.lang.Long> blockList)

      Specified by:
        `getBlocksAfter` in interface `Blockchain`

    - #### getBlockIdAtHeight

          public long getBlockIdAtHeight(int height)

      Specified by:
        `getBlockIdAtHeight` in interface `Blockchain`

    - #### getBlockAtHeight

          public BlockImpl getBlockAtHeight(int height)

      Specified by:
        `getBlockAtHeight` in interface `Blockchain`

    - #### getECBlock

          public BlockImpl getECBlock(int timestamp)

      Specified by:
        `getECBlock` in interface `Blockchain`

    - #### getTransaction

          public TransactionImpl getTransaction(Chain chain,
                                                byte[] fullHash)

      Specified by:
        `getTransaction` in interface `Blockchain`

    - #### hasTransaction

          public boolean hasTransaction(Chain chain,
                                        byte[] fullHash)

      Specified by:
        `hasTransaction` in interface `Blockchain`

    - #### getFxtTransaction

          public FxtTransactionImpl getFxtTransaction(long transactionId)

      Specified by:
        `getFxtTransaction` in interface `Blockchain`

    - #### hasFxtTransaction

          public boolean hasFxtTransaction(long transactionId)

      Specified by:
        `hasFxtTransaction` in interface `Blockchain`

    - #### getTransactionCount

          public int getTransactionCount(Chain chain)

      Specified by:
        `getTransactionCount` in interface `Blockchain`

    - #### getTransactions

          public DbIterator<ChildTransactionImpl> getTransactions(ChildChain childChain,
                                                                  long accountId,
                                                                  byte type,
                                                                  byte subtype,
                                                                  int blockTimestamp,
                                                                  boolean includeExpiredPrunable)

      Specified by:
        `getTransactions` in interface `Blockchain`

    - #### getTransactions

          public DbIterator<ChildTransactionImpl> getTransactions(ChildChain childChain,
                                                                  long accountId,
                                                                  int numberOfConfirmations,
                                                                  byte type,
                                                                  byte subtype,
                                                                  int blockTimestamp,
                                                                  boolean withMessage,
                                                                  boolean phasedOnly,
                                                                  boolean nonPhasedOnly,
                                                                  int from,
                                                                  int to,
                                                                  boolean includeExpiredPrunable,
                                                                  boolean executedOnly)

      Specified by:
        `getTransactions` in interface `Blockchain`

    - #### getReferencingTransactions

          public DbIterator<ChildTransactionImpl> getReferencingTransactions(ChildChain childChain,
                                                                             byte[] referencedTransactionFullHash,
                                                                             int from,
                                                                             int to)

      Specified by:
        `getReferencingTransactions` in interface `Blockchain`

    - #### getTransactions

          public DbIterator<? extends FxtTransaction> getTransactions(FxtChain chain,
                                                                      long accountId,
                                                                      int numberOfConfirmations,
                                                                      byte type,
                                                                      byte subtype,
                                                                      int blockTimestamp,
                                                                      int from,
                                                                      int to)

      Specified by:
        `getTransactions` in interface `Blockchain`

    - #### getTransactions

          public DbIterator<FxtTransactionImpl> getTransactions(FxtChain chain,
                                                                java.sql.Connection con,
                                                                java.sql.PreparedStatement pstmt)

      Specified by:
        `getTransactions` in interface `Blockchain`

    - #### getTransactions

          public DbIterator<ChildTransactionImpl> getTransactions(ChildChain childChain,
                                                                  java.sql.Connection con,
                                                                  java.sql.PreparedStatement pstmt)

      Specified by:
        `getTransactions` in interface `Blockchain`

    - #### getExpectedTransactions

          public java.util.List<TransactionImpl> getExpectedTransactions(Filter<Transaction> filter)

      Specified by:
        `getExpectedTransactions` in interface `Blockchain`

    - #### getExecutedTransactions

          public DbIterator<? extends Transaction> getExecutedTransactions(Chain chain,
                                                                           long senderId,
                                                                           long recipientId,
                                                                           byte type,
                                                                           byte subtype,
                                                                           int height,
                                                                           int numberOfConfirmations,
                                                                           int from,
                                                                           int to)

      Specified by:
        `getExecutedTransactions` in interface `Blockchain`