eth: accept leading zeros for nonce parameter of submitWork (#3558)

This commit is contained in:
Felix Lange
2017-01-13 00:37:23 +01:00
committed by GitHub
parent e0ceeab0d1
commit c5df37c111
4 changed files with 8 additions and 6 deletions

View File

@ -423,9 +423,9 @@ func CalcUncleHash(uncles []*Header) common.Hash {
// WithMiningResult returns a new block with the data from b
// where nonce and mix digest are set to the provided values.
func (b *Block) WithMiningResult(nonce uint64, mixDigest common.Hash) *Block {
func (b *Block) WithMiningResult(nonce BlockNonce, mixDigest common.Hash) *Block {
cpy := *b.header
binary.BigEndian.PutUint64(cpy.Nonce[:], nonce)
cpy.Nonce = nonce
cpy.MixDigest = mixDigest
return &Block{
header: &cpy,