MCPcopy Create free account
hub / github.com/btcsuite/btcd / IsPayToScriptHash

Function IsPayToScriptHash

txscript/script.go:73–75  ·  view source on GitHub ↗

IsPayToScriptHash returns true if the script is in the standard pay-to-script-hash (P2SH) format, false otherwise. WARNING: This function always treats the passed script as version 0. Great care must be taken if introducing a new script version because it is used in consensus which, unfortunately

(script []byte)

Source from the content-addressed store, hash-verified

71// script versions before determining if the script is a P2SH which means nodes
72// on existing rules will analyze new version scripts as if they were version 0.
73func IsPayToScriptHash(script []byte) bool {
74 return isScriptHashScript(script)
75}
76
77// IsPayToWitnessScriptHash returns true if the script is in the standard
78// pay-to-witness-script-hash (P2WSH) format, false otherwise.

Callers 2

TestIsPayToScriptHashFunction · 0.85

Calls 1

isScriptHashScriptFunction · 0.85

Tested by 2

TestIsPayToScriptHashFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…