allow signing with m1 = m2

This commit is contained in:
parmarrushabh 2019-03-25 11:38:52 +05:30
parent 85db85cc20
commit a47c0b94e7

View file

@ -977,7 +977,13 @@ func (c *XDPoS) Seal(chain consensus.ChainReader, block *types.Block, stop <-cha
return nil, err
}
copy(header.Extra[len(header.Extra)-extraSeal:], sighash)
m2, err := c.GetValidator(signer, chain, header)
if err != nil {
return nil, fmt.Errorf("can't get block validator: %v", err)
}
if m2 == signer {
header.Validator = sighash
}
return block.WithSeal(header), nil
}