aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go
index 2b2456c62..0b38474a6 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/penalty-helper.go
@@ -27,6 +27,8 @@ import (
var (
// ErrInvalidDKGMasterPublicKey means the DKG MasterPublicKey is invalid.
ErrInvalidDKGMasterPublicKey = errors.New("invalid DKG master public key")
+ // ErrPayloadNotEmpty means the payload of block is not empty.
+ ErrPayloadNotEmpty = errors.New("payload not empty")
)
// NeedPenaltyDKGPrivateShare checks if the proposer of dkg private share
@@ -95,8 +97,11 @@ func NeedPenaltyForkBlock(block1, block2 *types.Block) (bool, error) {
block1.Hash == block2.Hash {
return false, nil
}
+ if len(block1.Payload) != 0 || len(block2.Payload) != 0 {
+ return false, ErrPayloadNotEmpty
+ }
verifyBlock := func(block *types.Block) (bool, error) {
- err := VerifyBlockSignature(block)
+ err := VerifyBlockSignatureWithoutPayload(block)
switch err {
case nil:
return true, nil