From e14cac6eb19c885262caae0bd7c28ee11c5d8555 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 22 Nov 2019 22:48:04 +0100 Subject: [PATCH] add support of batch calls to rpc client --- lib/bitcoind-rpc/rpc-client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bitcoind-rpc/rpc-client.js b/lib/bitcoind-rpc/rpc-client.js index 84ba57a..e78421f 100644 --- a/lib/bitcoind-rpc/rpc-client.js +++ b/lib/bitcoind-rpc/rpc-client.js @@ -37,7 +37,9 @@ class RpcClient { return async function(...args) { const result = await origMethod.apply(target.client, args) - if (result.result) { + if (Array.isArray(result)) { + return result + } else if (result.result) { return result.result } else if (result.error) { throw result.error