VotePendingBlockNumber = uint64(10000)
//DPOS parameter
- NumOfConsensusNode = 10
- BlockNumEachNode = 12
- RoundVoteBlockNums = NumOfConsensusNode * BlockNumEachNode * 10
- MinVoteNum = 10000000
+ NumOfConsensusNode = 10
+ BlockNumEachNode = 12
+ RoundVoteBlockNums = NumOfConsensusNode * BlockNumEachNode * 10
+ MinVoteNum = 10000000
+ MinVoteOutputAmount = uint64(100000000)
// BlockTimeInterval indicate product one block per 500 milliseconds
BlockTimeInterval = 500
ErrOverGasCredit = errors.New("all gas credit has been spend")
ErrGasCalculate = errors.New("gas usage calculate got a math error")
ErrVotePubKey = errors.New("invalid public key of vote")
+ ErrVoteOutputAmount = errors.New("invalid vote amount")
)
// GasState record the gas usage status
if err = checkValidSrc(&vs2, e.Source); err != nil {
return errors.Wrap(err, "checking vote output source")
}
+ if err = checkVoteOutputAmount(e.Source); err != nil {
+ return errors.Wrap(err, "checking vote output amount")
+ }
case *bc.Retirement:
vs2 := *vs
}
return vs.gasStatus, checkValid(vs, tx.TxHeader)
}
+
+func checkVoteOutputAmount(vs *bc.ValueSource) error {
+ if vs.Value.Amount < consensus.MinVoteOutputAmount {
+ return ErrVoteOutputAmount
+ }
+ return nil
+}