mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-28 09:31:34 +00:00
Merge pull request #3455 from nspcc-dev/sast
Adjust minor SAST warnings
This commit is contained in:
commit
3c471f0b7e
2 changed files with 6 additions and 6 deletions
|
@ -3017,12 +3017,7 @@ func (bc *Blockchain) verifyTxWitnesses(t *transaction.Transaction, block *block
|
|||
|
||||
// verifyHeaderWitnesses is a block-specific implementation of VerifyWitnesses logic.
|
||||
func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header) error {
|
||||
var hash util.Uint160
|
||||
if prevHeader == nil && currHeader.PrevHash.Equals(util.Uint256{}) {
|
||||
hash = currHeader.Script.ScriptHash()
|
||||
} else {
|
||||
hash = prevHeader.NextConsensus
|
||||
}
|
||||
hash := prevHeader.NextConsensus
|
||||
_, err := bc.VerifyWitness(hash, currHeader, &currHeader.Script, HeaderVerificationGasLimit)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -157,6 +157,11 @@ func (o *Oracle) processRequest(priv *keys.PrivateKey, req request) error {
|
|||
resp.Code = transaction.Error
|
||||
}
|
||||
case neofs.URIScheme:
|
||||
if len(o.MainCfg.NeoFS.Nodes) == 0 {
|
||||
o.Log.Warn("no NeoFS nodes configured", zap.String("url", req.Req.URL))
|
||||
resp.Code = transaction.Error
|
||||
break
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), o.MainCfg.NeoFS.Timeout)
|
||||
defer cancel()
|
||||
index := (int(req.ID) + incTx.attempts) % len(o.MainCfg.NeoFS.Nodes)
|
||||
|
|
Loading…
Reference in a new issue