txscript: Deprecate GetMultisigMandN.

This deprecates the GetMultisigMandN function which should never have
been added since the CalcMultiSigStats function already existed for this
purpose.

While here, redefine the function in terms of CalcMultiSigStats.
This commit is contained in:
Dave Collins 2019-03-13 01:10:59 -05:00
parent b1b64d9228
commit 7f1da3bc07
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -1096,18 +1096,16 @@ func PushedData(script []byte) ([][]byte, error) {
// GetMultisigMandN returns the number of public keys and the number of
// signatures required to redeem the multisignature script.
//
// DEPRECATED. Use CalcMultiSigStats instead. This will be removed in the next
// major version bump.
func GetMultisigMandN(script []byte) (uint8, uint8, error) {
// No valid addresses or required signatures if the script doesn't
// parse.
pops, err := parseScript(script)
numPubKeys, requiredSigs, err := CalcMultiSigStats(script)
if err != nil {
return 0, 0, err
}
requiredSigs := uint8(asSmallInt(pops[0].opcode))
numPubKeys := uint8(asSmallInt(pops[len(pops)-2].opcode))
return requiredSigs, numPubKeys, nil
return uint8(requiredSigs), uint8(numPubKeys), nil
}
// ExtractPkScriptAddrs returns the type of script, addresses and required