aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-10-23 17:14:47 +0800
committerWei-Ning Huang <aitjcize@gmail.com>2018-10-23 17:14:47 +0800
commit23779823a7816d07c41fd7c135c6c0edf39182db (patch)
tree8e58408721dc0a25de858cbed101beb4b17741d0 /core/types
parent726e855384bf686b192f9d4b1c4cb0e9d006d414 (diff)
downloaddexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar.gz
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar.bz2
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar.lz
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar.xz
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.tar.zst
dexon-consensus-23779823a7816d07c41fd7c135c6c0edf39182db.zip
core: Change interface of Application.VerifyBlock (#246)
* Change interface of Application.VerifyBlock
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 9de4673..29b1c84 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -33,6 +33,20 @@ import (
"github.com/dexon-foundation/dexon-consensus-core/core/crypto"
)
+// BlockVerifyStatus is the return code for core.Application.VerifyBlock
+type BlockVerifyStatus int
+
+// Enums for return value of core.Application.VerifyBlock.
+const (
+ // VerifyOK: Block is verified.
+ VerifyOK BlockVerifyStatus = iota
+ // VerifyRetryLater: Block is unable to be verified at this moment.
+ // Try again later.
+ VerifyRetryLater
+ // VerifyInvalidBlock: Block is an invalid one.
+ VerifyInvalidBlock
+)
+
var (
// blockPool is the blocks cache to reuse allocated blocks.
blockPool = sync.Pool{