3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Clarify BlockChainListener javadocs a bit.

This commit is contained in:
Mike Hearn 2014-06-04 18:11:17 +08:00
parent 21b3c06878
commit 86c5449ba2

View File

@ -25,11 +25,12 @@ import java.util.List;
*/
public interface BlockChainListener {
/**
* <p>Called by the {@link BlockChain} when a new block on the best chain is seen, AFTER relevant
* transactions are extracted and sent to us UNLESS the new block caused a re-org, in which case this will
* not be called (the {@link Wallet#reorganize(StoredBlock, java.util.List, java.util.List)} method will
* call this one in that case).</p>
* @param block
* Called when a new block on the best chain is seen, after relevant transactions are extracted and sent to
* us via either {@link #receiveFromBlock(Transaction, StoredBlock, com.google.bitcoin.core.BlockChain.NewBlockType, int)}
* or {@link #notifyTransactionIsInBlock(Sha256Hash, StoredBlock, com.google.bitcoin.core.BlockChain.NewBlockType, int)}.
* If this block is causing a re-organise to a new chain, this method is NOT called even though the block may be
* the new best block: your reorganize implementation is expected to do whatever would normally be done do for a new
* best block in this case.
*/
void notifyNewBestBlock(StoredBlock block) throws VerificationException;
@ -39,7 +40,7 @@ public interface BlockChainListener {
* to go down in this case: money we thought we had can suddenly vanish if the rest of the network agrees it
* should be so.<p>
*
* The oldBlocks/newBlocks lists are ordered height-wise from top first to bottom last.
* The oldBlocks/newBlocks lists are ordered height-wise from top first to bottom last (i.e. newest blocks first).
*/
void reorganize(StoredBlock splitPoint, List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks) throws VerificationException;