mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
txscript: Remove checks for impossible conditions.
This removes a couple of checks for impossible conditions found by the staticcheck linter. In the case of executeOpcode, bytes are always >= 0 and, similarly for SigCache.Add, uint are always >= 0.
This commit is contained in:
parent
51852570e2
commit
e570fb8d75
@ -296,7 +296,7 @@ func (vm *Engine) executeOpcode(op *opcode, data []byte) error {
|
||||
}
|
||||
|
||||
// Ensure all executed data push opcodes use the minimal encoding.
|
||||
if vm.isBranchExecuting() && op.value >= 0 && op.value <= OP_PUSHDATA4 {
|
||||
if vm.isBranchExecuting() && op.value <= OP_PUSHDATA4 {
|
||||
if err := checkMinimalDataPush(op, data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ func (s *SigCache) Add(sigHash chainhash.Hash, sig chainec.Signature, pubKey cha
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
if s.maxEntries <= 0 {
|
||||
if s.maxEntries == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user