ConsumeGas for pubkey.VerifyBytes
This commit is contained in:
parent
a801874aba
commit
38716d5edc
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue