PkScriptByIndex returns the public key script for the provided output index.

Returns nil if the output index references an output that does not exist either due to it being invalid or because the output is not part of the view due to previously being spent/pruned.

PkScriptByIndex is referenced in 2 repositories