public final class BlockchainProcessorImpl extends java.lang.Object implements BlockchainProcessor
BlockchainProcessor.BlockNotAcceptedException, BlockchainProcessor.BlockOfLowerDifficultyException, BlockchainProcessor.BlockOutOfOrderException, BlockchainProcessor.Event, BlockchainProcessor.TransactionNotAcceptedException| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(Listener<Block> listener,
BlockchainProcessor.Event eventType) |
void |
fullReset() |
void |
fullScanWithShutdown() |
void |
generateBlock(byte[] privateKey,
int blockTimestamp) |
long |
getGenesisBlockId() |
int |
getInitialScanHeight() |
static BlockchainProcessorImpl |
getInstance() |
Peer |
getLastBlockchainFeeder() |
int |
getLastBlockchainFeederHeight() |
int |
getMinRollbackHeight() |
static void |
init() |
boolean |
isDownloading() |
boolean |
isDownloadSuspended() |
boolean |
isProcessingBlock() |
boolean |
isScanning() |
java.util.List<BlockImpl> |
popOffTo(int height) |
void |
processPeerBlock(Block inputBlock)
Process a single peer block
The block must be a continuation of the current chain or a replacement for the current last block
|
void |
processPeerBlocks(java.util.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.
|
void |
registerDerivedTable(DerivedDbTable table) |
boolean |
removeListener(Listener<Block> listener,
BlockchainProcessor.Event eventType) |
int |
restorePrunedData(Chain chain) |
Transaction |
restorePrunedTransaction(Chain chain,
byte[] transactionFullHash) |
void |
scan(int height,
boolean validate) |
void |
scheduleScan(int height,
boolean validate) |
void |
setGetMoreBlocks(boolean getMoreBlocks) |
void |
shutdown() |
void |
suspendDownload(boolean suspend) |
void |
trimDerivedTables() |
public static BlockchainProcessorImpl getInstance()
public static void init()
public boolean addListener(Listener<Block> listener, BlockchainProcessor.Event eventType)
addListener in interface Observable<Block,BlockchainProcessor.Event>public boolean removeListener(Listener<Block> listener, BlockchainProcessor.Event eventType)
removeListener in interface Observable<Block,BlockchainProcessor.Event>public void registerDerivedTable(DerivedDbTable table)
registerDerivedTable in interface BlockchainProcessorpublic void trimDerivedTables()
trimDerivedTables in interface BlockchainProcessorpublic Peer getLastBlockchainFeeder()
getLastBlockchainFeeder in interface BlockchainProcessorpublic int getLastBlockchainFeederHeight()
getLastBlockchainFeederHeight in interface BlockchainProcessorpublic boolean isScanning()
isScanning in interface BlockchainProcessorpublic int getInitialScanHeight()
getInitialScanHeight in interface BlockchainProcessorpublic void suspendDownload(boolean suspend)
suspendDownload in interface BlockchainProcessorpublic boolean isDownloadSuspended()
isDownloadSuspended in interface BlockchainProcessorpublic boolean isDownloading()
isDownloading in interface BlockchainProcessorpublic boolean isProcessingBlock()
isProcessingBlock in interface BlockchainProcessorpublic int getMinRollbackHeight()
getMinRollbackHeight in interface BlockchainProcessorpublic long getGenesisBlockId()
getGenesisBlockId in interface BlockchainProcessorpublic void processPeerBlock(Block inputBlock) throws NxtException
processPeerBlock in interface BlockchainProcessorinputBlock - Peer blockNxtException - Block was not acceptedpublic void processPeerBlocks(java.util.List<Block> inputBlocks) throws NxtException
processPeerBlocks in interface BlockchainProcessorinputBlocks - Peer blocksNxtException - Blocks were not acceptedpublic java.util.List<BlockImpl> popOffTo(int height)
popOffTo in interface BlockchainProcessorpublic void fullReset()
fullReset in interface BlockchainProcessorpublic void setGetMoreBlocks(boolean getMoreBlocks)
setGetMoreBlocks in interface BlockchainProcessorpublic int restorePrunedData(Chain chain)
restorePrunedData in interface BlockchainProcessorpublic Transaction restorePrunedTransaction(Chain chain, byte[] transactionFullHash)
restorePrunedTransaction in interface BlockchainProcessorpublic void shutdown()
public void generateBlock(byte[] privateKey,
int blockTimestamp)
throws BlockchainProcessor.BlockNotAcceptedException
public void scheduleScan(int height,
boolean validate)
public void scan(int height,
boolean validate)
scan in interface BlockchainProcessorpublic void fullScanWithShutdown()
fullScanWithShutdown in interface BlockchainProcessor