From d01e21d8ac9de2e0bd8df1eba5310f780be604a8 Mon Sep 17 00:00:00 2001 From: tinyema <11536058+tinyema@users.noreply.github.com> Date: Fri, 20 Mar 2020 10:32:15 +0100 Subject: [PATCH] fix trtl daemon get_info trtl v.0.22.0: The /getinfo, /getheight, /getpeers, and /getfee calls have been removed in lieu of /info, /height, /peers, and /fee. This quick fix fallback to getlastblockheader if get_info fail because of empty reply. --- lib/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.js b/lib/api.js index d0edb1c..e20e4f7 100644 --- a/lib/api.js +++ b/lib/api.js @@ -567,7 +567,7 @@ function getNetworkData (callback, rpcMode) { // Try get_info RPC method first if available (not all coins support it) if (rpcMode === 'get_info') { apiInterfaces.rpcDaemon('get_info', {}, function (error, reply) { - if (error) { + if (error || !reply) { getNetworkData(callback, 'getlastblockheader'); return; } else {