diff --git a/core/types/transaction.go b/core/types/transaction.go index d962247be3..5b76636e3d 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -511,11 +511,13 @@ func (tx *Transaction) IsVotingTransaction() (bool, *common.Address) { var end int data := tx.Data() method := hexutil.Encode(data[0:4]) - if method == common.VoteMethod || method == common.ProposeMethod || method == common.ResignMethod { + + switch method { + case common.VoteMethod, common.ProposeMethod, common.ResignMethod: end = len(data) - } else if method == common.UnvoteMethod { + case common.UnvoteMethod: end = len(data) - 32 - } else { + default: return false, nil }