Fixed minor bug for get signers from penalties header.

This commit is contained in:
DinhLN 2019-02-22 10:27:22 +07:00 committed by Nguyen Ba Tam
parent 8747342373
commit cafef44074
4 changed files with 5 additions and 7 deletions

View file

@ -355,7 +355,7 @@ func GetSignersSignedAtBlockHash(c *posv.Posv, chain consensus.ChainReader, data
// Get signers list from bytes.
func GetSignersFromBytes(byteHeader []byte) []common.Address {
signers := make([]common.Address, len(byteHeader)/common.AddressLength)
for i := 0; i < len(masternodes); i++ {
for i := 0; i < len(signers); i++ {
copy(signers[i][:], byteHeader[i*common.AddressLength:])
}

View file

@ -238,7 +238,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
contractAction = "contract creation"
} else {
// Increment the nonce for the next transaction
nonce = st.state.GetNonce(sender.Address())+1
nonce = st.state.GetNonce(sender.Address()) + 1
st.state.SetNonce(sender.Address(), nonce)
ret, st.gas, vmerr = evm.Call(sender, st.to().Address(), st.data, st.gas, st.value)
contractAction = "contract call"

View file

@ -337,9 +337,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
}
}
if len(prevSigners) > 0 {
for _, signer := range prevSigners {
penSigners = append(penSigners, signer)
}
penSigners = append(penSigners, prevSigners...)
}
}