|
|
@ -258,7 +258,7 @@ func (consensus *Consensus) checkConsensusMessage(message *msg_pb.Message, publi |
|
|
|
consensusID := consensusMsg.ConsensusId |
|
|
|
consensusID := consensusMsg.ConsensusId |
|
|
|
blockHash := consensusMsg.BlockHash |
|
|
|
blockHash := consensusMsg.BlockHash |
|
|
|
|
|
|
|
|
|
|
|
utils.GetLogInstance().Warn("checkConsensusMessage", "publicKey", publicKey) |
|
|
|
utils.GetLogInstance().Warn("checkConsensusMessage", "consensusID", consensusID, "blockHash", blockHash) |
|
|
|
// Verify message signature
|
|
|
|
// Verify message signature
|
|
|
|
err := verifyMessageSig(publicKey, message) |
|
|
|
err := verifyMessageSig(publicKey, message) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -309,7 +309,7 @@ func verifyMessageSig(signerPubKey *bls.PublicKey, message *msg_pb.Message) erro |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
msgHash := sha256.Sum256(messageBytes) |
|
|
|
msgHash := sha256.Sum256(messageBytes) |
|
|
|
utils.GetLogInstance().Debug("verifyMessageSig", "signerPubKey", signerPubKey, "msgHash", msgHash) |
|
|
|
utils.GetLogInstance().Debug("verifyMessageSig") |
|
|
|
if !msgSig.VerifyHash(signerPubKey, msgHash[:]) { |
|
|
|
if !msgSig.VerifyHash(signerPubKey, msgHash[:]) { |
|
|
|
return errors.New("failed to verify the signature") |
|
|
|
return errors.New("failed to verify the signature") |
|
|
|
} |
|
|
|
} |
|
|
|