diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/interfaces.go | 6 | ||||
-rw-r--r-- | core/lattice.go | 2 | ||||
-rw-r--r-- | core/nonblocking.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/core/interfaces.go b/core/interfaces.go index f4a6cd0..98cbb4d 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -37,6 +37,9 @@ type Application interface { // VerifyBlock verifies if the block is valid. VerifyBlock(block *types.Block) bool + // BlockConfirmed is called when a block is confirmed and added to lattice. + BlockConfirmed(blockHash common.Hash) + // BlockDelivered is called when a block is add to the compaction chain. BlockDelivered(block types.Block) } @@ -44,9 +47,6 @@ type Application interface { // Debug describes the application interface that requires // more detailed consensus execution. type Debug interface { - // BlockConfirmed is called when a block is confirmed and added to lattice. - BlockConfirmed(blockHash common.Hash) - // StronglyAcked is called when a block is strongly acked. StronglyAcked(blockHash common.Hash) diff --git a/core/lattice.go b/core/lattice.go index 3ee0b94..6ecb88f 100644 --- a/core/lattice.go +++ b/core/lattice.go @@ -153,8 +153,8 @@ func (s *Lattice) ProcessBlock( // be done here. if s.debug != nil { s.debug.StronglyAcked(input.Hash) - s.debug.BlockConfirmed(input.Hash) } + s.app.BlockConfirmed(input.Hash) // Purge blocks in pool with the same chainID and lower height. s.pool.purgeBlocks(input.Position.ChainID, input.Position.Height) // Replay tips in pool to check their validity. diff --git a/core/nonblocking.go b/core/nonblocking.go index 4948a4f..83c2351 100644 --- a/core/nonblocking.go +++ b/core/nonblocking.go @@ -94,7 +94,7 @@ func (nb *nonBlocking) run() { case stronglyAckedEvent: nb.debug.StronglyAcked(e.blockHash) case blockConfirmedEvent: - nb.debug.BlockConfirmed(e.blockHash) + nb.app.BlockConfirmed(e.blockHash) case totalOrderingDeliveredEvent: nb.debug.TotalOrderingDelivered(e.blockHashes, e.early) case blockDeliveredEvent: |