diff --git a/Libplanet/Blockchain/BlockChain.cs b/Libplanet/Blockchain/BlockChain.cs index e706a88c26..9a86aafa21 100644 --- a/Libplanet/Blockchain/BlockChain.cs +++ b/Libplanet/Blockchain/BlockChain.cs @@ -176,6 +176,11 @@ bool render /// public event EventHandler TipChanged; + /// + /// An event which is invoked when is changed. + /// + public event EventHandler OnReorg; + public IBlockPolicy Policy { get; } /// @@ -1293,6 +1298,7 @@ IEnumerable GetTxIdsWithRange(BlockChain chain, Block start, Block(Store); TipChanged?.Invoke(this, tipChangedEventArgs); + OnReorg?.Invoke(this, new OnReorgEventArgs()); _transactions = new TransactionSet(Store); Store.DeleteChainId(obsoleteId); } @@ -1567,5 +1573,12 @@ public class TipChangedEventArgs : EventArgs /// public HashDigest Hash { get; set; } } + + /// + /// Provides data for the event. + /// + public class OnReorgEventArgs : EventArgs + { + } } }