Class: SigCache

script.SigCache

new SigCache(sizeopt)

Signature cache.

Parameters:
Name Type Attributes Default Description
size Number <optional>
50000
Properties:
Name Type Description
size Number
keys Array:.<Hash:>
valid Object
Source:

Methods

add(hash, sig, key)

Add item to the sigcache. Potentially evict a random member.

Parameters:
Name Type Description
hash Hash

Sig hash.

sig Buffer
key Buffer
Source:

has(hash, sig, key) → {Boolean}

Test whether the sig exists.

Parameters:
Name Type Description
hash Hash

Sig hash.

sig Buffer
key Buffer
Source:
Returns:
Type
Boolean

resize(size)

Resize the sigcache.

Parameters:
Name Type Description
size Number
Source:

verify(msg, sig, key, historicalnullable, highnullable) → {Boolean}

Verify a signature, testing it against the cache first.

Parameters:
Name Type Attributes Description
msg Buffer
sig Buffer
key Buffer
historical Boolean <nullable>
high Boolean <nullable>
Source:
Returns:
Type
Boolean