From 80302c5c0708bce8b013def256f23f63be17db9c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 10 Aug 2020 18:49:48 +0300 Subject: [PATCH] consensus: use dbft.M() for new block witness We're collecting dbft.M() number of signatures in getBlockWitness(), so we should use the same value for M here. --- pkg/consensus/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index d41373af4..7dca1ef13 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -518,7 +518,7 @@ func (s *service) newBlockFromContext(ctx *dbft.Context) block.Block { if err != nil { return nil } - script, err := smartcontract.CreateMultiSigRedeemScript(len(validators)-(len(validators)-1)/3, validators) + script, err := smartcontract.CreateMultiSigRedeemScript(s.dbft.Context.M(), validators) if err != nil { return nil }