From 2eb09b66efba479acd6a7043ac42456c8733dce9 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 10 Jan 2011 13:54:39 -0500 Subject: [PATCH] Fix so listaccounts with minconf works. --- rpc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc.cpp b/rpc.cpp index fa9bda773c..a020ee9bc5 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -1009,8 +1009,8 @@ Value listaccounts(const Array& params, bool fHelp) "Returns Object that has account names as keys, account balances as values."); int nMinDepth = 1; - if (params.size() > 1) - nMinDepth = params[1].get_int(); + if (params.size() > 0) + nMinDepth = params[0].get_int(); map mapAccountBalances; CRITICAL_BLOCK(cs_mapWallet) @@ -1934,7 +1934,7 @@ int CommandLineRPC(int argc, char *argv[]) if (strMethod == "sendfrom" && n > 2) ConvertTo(params[2]); if (strMethod == "sendfrom" && n > 3) ConvertTo(params[3]); if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); - if (strMethod == "listaccounts" && n > 1) ConvertTo(params[1]); + if (strMethod == "listaccounts" && n > 0) ConvertTo(params[0]); // Execute Object reply = CallRPC(strMethod, params);