From 14d2fd2a27655e85deee5ae0029a4d1ad630e2e0 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 26 Jun 2023 17:58:06 +1000 Subject: [PATCH] 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 --- lib/node/rpc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/node/rpc.js b/lib/node/rpc.js index f62f8bde..905e84da 100644 --- a/lib/node/rpc.js +++ b/lib/node/rpc.js @@ -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; }