ConsumeGas for pubkey.VerifyBytes

This commit is contained in:
Christopher Goes 2018-05-15 15:02:54 +02:00
parent a801874aba
commit 38716d5edc
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 5 additions and 0 deletions

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()
}