Package nxt.blockchain
Class BlockchainProcessorImpl
java.lang.Object
nxt.blockchain.BlockchainProcessorImpl
- All Implemented Interfaces:
BlockchainProcessor,Observable<Block,BlockchainProcessor.Event>
-
Nested Class Summary
Nested classes/interfaces inherited from interface nxt.blockchain.BlockchainProcessor
BlockchainProcessor.BlockNotAcceptedException, BlockchainProcessor.BlockOfLowerDifficultyException, BlockchainProcessor.BlockOutOfOrderException, BlockchainProcessor.Event, BlockchainProcessor.TransactionNotAcceptedException -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddListener(Listener<Block> listener, BlockchainProcessor.Event eventType) voidvoidcreateSearchIndexes(Connection con, Filter<DerivedDbTable> filter) voidvoidvoidgenerateBlock(byte[] privateKey, int blockTimestamp) longintstatic BlockchainProcessorImplintintstatic voidinit()booleanbooleanbooleanbooleanpopOffTo(int height) voidprocessPeerBlock(Block inputBlock) Process a single peer block The block must be a continuation of the current chain or a replacement for the current last blockvoidprocessPeerBlocks(List<Block> inputBlocks) Process multiple peer blocks The peer blocks must represent a 2-block fork where the common block is the block preceding the current last block.voidbooleanremoveListener(Listener<Block> listener, BlockchainProcessor.Event eventType) intrestorePrunedData(Chain chain) restorePrunedTransaction(Chain chain, byte[] transactionFullHash) voidscan(int height, boolean validate) voidscheduleScan(int height, boolean validate) voidsetGetMoreBlocks(boolean getMoreBlocks) voidshutdown()voidsuspendDownload(boolean suspend) void
-
Method Details
-
getInstance
-
init
public static void init() -
addListener
- Specified by:
addListenerin interfaceObservable<Block,BlockchainProcessor.Event>
-
removeListener
- Specified by:
removeListenerin interfaceObservable<Block,BlockchainProcessor.Event>
-
registerDerivedTable
- Specified by:
registerDerivedTablein interfaceBlockchainProcessor
-
trimDerivedTables
public void trimDerivedTables()- Specified by:
trimDerivedTablesin interfaceBlockchainProcessor
-
getLastBlockchainFeeder
- Specified by:
getLastBlockchainFeederin interfaceBlockchainProcessor
-
getLastBlockchainFeederHeight
public int getLastBlockchainFeederHeight()- Specified by:
getLastBlockchainFeederHeightin interfaceBlockchainProcessor
-
isScanning
public boolean isScanning()- Specified by:
isScanningin interfaceBlockchainProcessor
-
getInitialScanHeight
public int getInitialScanHeight()- Specified by:
getInitialScanHeightin interfaceBlockchainProcessor
-
suspendDownload
public void suspendDownload(boolean suspend) - Specified by:
suspendDownloadin interfaceBlockchainProcessor
-
isDownloadSuspended
public boolean isDownloadSuspended()- Specified by:
isDownloadSuspendedin interfaceBlockchainProcessor
-
isDownloading
public boolean isDownloading()- Specified by:
isDownloadingin interfaceBlockchainProcessor
-
isProcessingBlock
public boolean isProcessingBlock()- Specified by:
isProcessingBlockin interfaceBlockchainProcessor
-
getMinRollbackHeight
public int getMinRollbackHeight()- Specified by:
getMinRollbackHeightin interfaceBlockchainProcessor
-
getGenesisBlockId
public long getGenesisBlockId()- Specified by:
getGenesisBlockIdin interfaceBlockchainProcessor
-
processPeerBlock
Process a single peer block The block must be a continuation of the current chain or a replacement for the current last block- Specified by:
processPeerBlockin interfaceBlockchainProcessor- Parameters:
inputBlock- Peer block- Throws:
NxtException- Block was not accepted
-
processPeerBlocks
Process multiple peer blocks The peer blocks must represent a 2-block fork where the common block is the block preceding the current last block.- Specified by:
processPeerBlocksin interfaceBlockchainProcessor- Parameters:
inputBlocks- Peer blocks- Throws:
NxtException- Blocks were not accepted
-
popOffTo
- Specified by:
popOffToin interfaceBlockchainProcessor
-
fullReset
public void fullReset()- Specified by:
fullResetin interfaceBlockchainProcessor
-
setGetMoreBlocks
public void setGetMoreBlocks(boolean getMoreBlocks) - Specified by:
setGetMoreBlocksin interfaceBlockchainProcessor
-
restorePrunedData
- Specified by:
restorePrunedDatain interfaceBlockchainProcessor
-
restorePrunedTransaction
- Specified by:
restorePrunedTransactionin interfaceBlockchainProcessor
-
shutdown
public void shutdown() -
generateBlock
public void generateBlock(byte[] privateKey, int blockTimestamp) throws BlockchainProcessor.BlockNotAcceptedException -
scheduleScan
public void scheduleScan(int height, boolean validate) -
scan
public void scan(int height, boolean validate) - Specified by:
scanin interfaceBlockchainProcessor
-
fullScanWithShutdown
public void fullScanWithShutdown()- Specified by:
fullScanWithShutdownin interfaceBlockchainProcessor
-
createSearchIndexes
- Throws:
SQLException
-
createSearchIndexes
- Throws:
SQLException
-