rpc: Added totalSigs to JSON response for scriptToJSON
- Added totalSigs property to the JSON response object - Use getMultisig() function to return n value if available
This commit is contained in:
parent
90cdf84e72
commit
14d2fd2a27
1 changed files with 5 additions and 1 deletions
|
|
@ -2984,17 +2984,21 @@ class RPC extends RPCBase {
|
|||
hex: undefined,
|
||||
type: Script.typesByVal[type],
|
||||
reqSigs: 1,
|
||||
totalSigs: 1,
|
||||
p2sh: undefined
|
||||
};
|
||||
|
||||
if (hex)
|
||||
json.hex = script.toJSON();
|
||||
|
||||
const [m] = script.getMultisig();
|
||||
const [m, n] = script.getMultisig();
|
||||
|
||||
if (m !== -1)
|
||||
json.reqSigs = m;
|
||||
|
||||
if (n !== -1)
|
||||
json.totalSigs = n;
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue