txscript: Drop the mutex before doing crypto
This commit is contained in:
parent
554460feda
commit
9f71f090e6
1 changed files with 3 additions and 6 deletions
|
@ -57,13 +57,10 @@ func NewSigCache(maxEntries uint) *SigCache {
|
||||||
// unless there exists a writer, adding an entry to the SigCache.
|
// unless there exists a writer, adding an entry to the SigCache.
|
||||||
func (s *SigCache) Exists(sigHash chainhash.Hash, sig *btcec.Signature, pubKey *btcec.PublicKey) bool {
|
func (s *SigCache) Exists(sigHash chainhash.Hash, sig *btcec.Signature, pubKey *btcec.PublicKey) bool {
|
||||||
s.RLock()
|
s.RLock()
|
||||||
defer s.RUnlock()
|
entry, ok := s.validSigs[sigHash]
|
||||||
|
s.RUnlock()
|
||||||
|
|
||||||
if entry, ok := s.validSigs[sigHash]; ok {
|
return ok && entry.pubKey.IsEqual(pubKey) && entry.sig.IsEqual(sig)
|
||||||
return entry.pubKey.IsEqual(pubKey) && entry.sig.IsEqual(sig)
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add adds an entry for a signature over 'sigHash' under public key 'pubKey'
|
// Add adds an entry for a signature over 'sigHash' under public key 'pubKey'
|
||||||
|
|
Loading…
Add table
Reference in a new issue