diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-15 18:17:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-15 18:17:53 +0800 |
commit | b02fa5ee430cff9dafc9d9c399099a88d554a083 (patch) | |
tree | 31f962f1e40e18a656693ebf38e8176b6e09c9f6 /core/test | |
parent | 6a127c42323b9b5cdde1cdb17e385d22ef9dfd10 (diff) | |
download | dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar.gz dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar.bz2 dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar.lz dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar.xz dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.tar.zst dexon-consensus-b02fa5ee430cff9dafc9d9c399099a88d554a083.zip |
core/syncer: add force sync (#468)
* core: Add Recovery Interface
* core/syncer: modify recovery interface
* core: fix Recovery interface
* core/syncer: rename terminator to watchcat (#491)
* core/syncer: rename terminator to watchcat
* Add error log
* Rename Pat to Feed
* core/syncer: add force sync
* run prepareRandomness if round >= DKGDelayRound
* Add test for Forcsync
Diffstat (limited to 'core/test')
-rw-r--r-- | core/test/app.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/test/app.go b/core/test/app.go index 0a17f13..4cfd580 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -208,6 +208,15 @@ func (app *App) BlockConfirmed(b types.Block) { app.LastConfirmedHeight = b.Position.Height } +// ClearUndeliveredBlocks -- +func (app *App) ClearUndeliveredBlocks() { + app.deliveredLock.RLock() + defer app.deliveredLock.RUnlock() + app.confirmedLock.Lock() + defer app.confirmedLock.Unlock() + app.LastConfirmedHeight = uint64(len(app.DeliverSequence) - 1) +} + // BlockDelivered implements Application interface. func (app *App) BlockDelivered(blockHash common.Hash, pos types.Position, result types.FinalizationResult) { |