aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test/node.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-10-05 09:12:26 +0800
committerGitHub <noreply@github.com>2018-10-05 09:12:26 +0800
commitefcb301ec31acf7b87312cbec962682148555999 (patch)
tree76ba2fbe5a7c7017005f771ab95102b997973f1f /integration_test/node.go
parent6773c56fe29511aca0f4345e9fd3758ca05e174f (diff)
downloadtangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar.gz
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar.bz2
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar.lz
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar.xz
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.tar.zst
tangerine-consensus-efcb301ec31acf7b87312cbec962682148555999.zip
core: find block in db (#174)
* Make sure block pool is large enough It's safe to use a larger blockPool when the number of chains is smaller. * Construct latticeData via config. * Seek acked blocks in blockdb when unable to find them in memory cache. In previous implementation, we assume our cache in memory is enough to perform DAG's sanity check. However, it's no longer true when the number of chains might be changed between rounds. * Simplify purge. Remove the relation to purge block by chainStatus.
Diffstat (limited to 'integration_test/node.go')
-rw-r--r--integration_test/node.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/integration_test/node.go b/integration_test/node.go
index c0c4fa1..555142d 100644
--- a/integration_test/node.go
+++ b/integration_test/node.go
@@ -203,11 +203,14 @@ func (n *Node) processBlock(b *types.Block) (err error) {
}
// Deliver blocks.
for _, b = range delivered {
- if err = n.db.Update(*b); err != nil {
+ if err = n.db.Put(*b); err != nil {
return
}
n.app.BlockDelivered(*b)
}
+ if err = n.lattice.PurgeBlocks(delivered); err != nil {
+ return
+ }
// Update pending blocks for verified block (pass sanity check).
pendings = append(pendings, verified...)
}