ConsumeGas for pubkey.VerifyBytes

This commit is contained in:
Christopher Goes
2018-05-16 01:14:31 +02:00
parent a801874aba
commit 38716d5edc
+5
View File
@@ -8,6 +8,10 @@ import (
"github.com/spf13/viper"
)
const (
VerifyCost = 100
)
// NewAnteHandler returns an AnteHandler that checks
// and increments sequence numbers, checks signatures,
// and deducts fees from the first signer.
@@ -134,6 +138,7 @@ func processSig(
}
// Check sig.
ctx.GasMeter().ConsumeGas(VerifyCost, "ante verify")
if !pubKey.VerifyBytes(signBytes, sig.Signature) {
return nil, sdk.ErrUnauthorized("signature verification failed").Result()
}