Package com.privatechain.core.event
Class BlockchainEvent.ForkDetectedEvent
java.lang.Object
com.privatechain.core.event.BlockchainEvent
com.privatechain.core.event.BlockchainEvent.ForkDetectedEvent
- Enclosing class:
BlockchainEvent
Fired when the node detects two competing valid blocks at the same chain height.
The Blockchain resolves forks by applying
the longest-chain (greatest cumulative difficulty) rule. This event is published
before resolution so that observers can log or alert on the fork.
Use getBlockA() and getBlockB() to inspect the competing blocks.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.privatechain.core.event.BlockchainEvent
BlockchainEvent.BlockAddedEvent, BlockchainEvent.ForkDetectedEvent, BlockchainEvent.PeerConnectedEvent, BlockchainEvent.PeerDisconnectedEvent, BlockchainEvent.TransactionSubmittedEvent -
Constructor Summary
ConstructorsConstructorDescriptionForkDetectedEvent(Block blockA, Block blockB) Constructs aForkDetectedEvent. -
Method Summary
Methods inherited from class com.privatechain.core.event.BlockchainEvent
getOccurredAt
-
Constructor Details
-
ForkDetectedEvent
Constructs aForkDetectedEvent.- Parameters:
blockA- first competing block (non-null)blockB- second competing block (non-null)- Throws:
NullPointerException- if either block is null
-
-
Method Details