From a47c0b94e7889d05b954b5e473c8a5c78e47a6e8 Mon Sep 17 00:00:00 2001 From: parmarrushabh Date: Mon, 25 Mar 2019 11:38:52 +0530 Subject: [PATCH] allow signing with m1 = m2 --- consensus/XDPoS/XDPoS.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/consensus/XDPoS/XDPoS.go b/consensus/XDPoS/XDPoS.go index 282f179782..562b3cb770 100644 --- a/consensus/XDPoS/XDPoS.go +++ b/consensus/XDPoS/XDPoS.go @@ -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 }