From 0f4956dcd54d715e4881db74bfa51a092193b7b6 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 4 Sep 2023 08:50:05 -0400 Subject: [PATCH] Initialize variables in z_getstats correctly --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index b10650137..01c379ecd 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3682,8 +3682,8 @@ UniValue z_getstats(const UniValue& params, bool fHelp, const CPubKey& mypk) if(!ReadBlockFromDisk(block, pblockindex,1)) throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk"); - int total_ztxs, total_zins, total_zouts = 0; - int largest_zins, largest_zouts = 0; + int total_ztxs = 0, total_zins = 0, total_zouts = 0; + int largest_zins = 0, largest_zouts = 0; // given a single block height, we calculate stats for that height if (params.size() == 1) {