Package org.bitcoinj.core.listeners
Interface ReorganizeListener
- All Known Implementing Classes:
NativeBlockChainListener
,Wallet
public interface ReorganizeListener
Listener interface for when the best chain has changed.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
reorganize
(StoredBlock splitPoint, List<StoredBlock> oldBlocks, List<StoredBlock> newBlocks) Called by theBlockChain
when the best chain (representing total work done) has changed.
-
Method Details
-
reorganize
void reorganize(StoredBlock splitPoint, List<StoredBlock> oldBlocks, List<StoredBlock> newBlocks) throws VerificationException Called by theBlockChain
when the best chain (representing total work done) has changed. In this case, we need to go through our transactions and find out if any have become invalid. It's possible for our balance 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.The oldBlocks/newBlocks lists are ordered height-wise from top first to bottom last (i.e. newest blocks first).
- Throws:
VerificationException
-