From 64a474a49b20a66453fbcd2382e4b042427b0a0f Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Sun, 14 Feb 2010 22:27:13 +0000 Subject: [PATCH] renamed a few rpc methods git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@63 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- makefile.vc | 2 +- net.cpp | 4 ---- rpc.cpp | 26 +++++++++++++------------- serialize.h | 2 +- util.h | 1 + 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/makefile.vc b/makefile.vc index 73fd1cfd..527f2467 100644 --- a/makefile.vc +++ b/makefile.vc @@ -22,7 +22,7 @@ LIBS= \ wxmsw28$(D)_richtext.lib wxmsw28$(D)_html.lib wxmsw28$(D)_core.lib wxmsw28$(D)_adv.lib wxbase28$(D).lib wxtiff$(D).lib wxjpeg$(D).lib wxpng$(D).lib wxzlib$(D).lib wxregex$(D).lib wxexpat$(D).lib \ kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib WXDEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH -CFLAGS=/c /nologo /Ob0 /MD$(D) /EHsc /GR /Zm300 /YX /Fpobj/headers.pch $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS) +CFLAGS=/c /nologo /Ob0 /MD$(D) /EHsc /GR /Zm300 $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS) HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h market.h rpc.h uibase.h ui.h diff --git a/net.cpp b/net.cpp index d669b8c5..061f000a 100644 --- a/net.cpp +++ b/net.cpp @@ -655,11 +655,7 @@ void ThreadSocketHandler2(void* parg) if (FD_ISSET(hListenSocket, &fdsetRecv)) { struct sockaddr_in sockaddr; -#ifdef __WXMSW__ - int len = sizeof(sockaddr); -#else socklen_t len = sizeof(sockaddr); -#endif SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); CAddress addr(sockaddr); if (hSocket == INVALID_SOCKET) diff --git a/rpc.cpp b/rpc.cpp index b176b158..f4eef37f 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -157,12 +157,12 @@ Value listtransactions(const Array& params) } -Value getamountpaid(const Array& params) +Value getamountreceived(const Array& params) { if (params.size() < 1 || params.size() > 2) throw runtime_error( - "getamountpaid [minconf=1]\n" - "Returns the total amount paid to in transactions with at least [minconf] confirmations."); + "getamountreceived [minconf=1]\n" + "Returns the total amount received by in transactions with at least [minconf] confirmations."); // Bitcoin address string strAddress = params[0].get_str(); @@ -207,15 +207,15 @@ struct tallyitem } }; -Value getallpayments(const Array& params) +Value getallreceived(const Array& params) { if (params.size() > 1) throw runtime_error( - "getallpayments [minconf=1]\n" + "getallreceived [minconf=1]\n" "[minconf] is the minimum number of confirmations before payments are included.\n" "Returns an array of objects containing:\n" " \"address\" : bitcoin address\n" - " \"amount\" : total amount paid to the address\n" + " \"amount\" : total amount received by the address\n" " \"conf\" : number of confirmations\n" " \"label\" : the label set for this address when it was created by getnewaddress"); @@ -294,8 +294,8 @@ pair pCallTable[] = make_pair("getnewaddress", &getnewaddress), make_pair("sendtoaddress", &sendtoaddress), make_pair("listtransactions", &listtransactions), - make_pair("getamountpaid", &getamountpaid), - make_pair("getallpayments", &getallpayments), + make_pair("getamountreceived", &getamountreceived), + make_pair("getallreceived", &getallreceived), }; map mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0])); @@ -571,11 +571,11 @@ int CommandLineRPC(int argc, char *argv[]) // Special case other types int n = params.size(); - if (strMethod == "sendtoaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "listtransactions" && n > 0) ConvertTo(params[0]); - if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); - if (strMethod == "getamountpaid" && n > 1) ConvertTo(params[1]); - if (strMethod == "getallpayments" && n > 0) ConvertTo(params[0]); + if (strMethod == "sendtoaddress" && n > 1) ConvertTo(params[1]); + if (strMethod == "listtransactions" && n > 0) ConvertTo(params[0]); + if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); + if (strMethod == "getamountreceived" && n > 1) ConvertTo(params[1]); + if (strMethod == "getallreceived" && n > 0) ConvertTo(params[0]); // Execute Value result = CallRPC(strMethod, params); diff --git a/serialize.h b/serialize.h index eb090ae2..f7377314 100644 --- a/serialize.h +++ b/serialize.h @@ -20,7 +20,7 @@ class CDataStream; class CAutoFile; static const int VERSION = 201; -static const char* pszSubVer = ".0"; +static const char* pszSubVer = ".1"; diff --git a/util.h b/util.h index 6a7fabc5..933c71be 100644 --- a/util.h +++ b/util.h @@ -68,6 +68,7 @@ static const bool fWindows = true; #define S_IWUSR 0200 #endif #define unlink _unlink +typedef int socklen_t; #else static const bool fWindows = false; #define WSAGetLastError() errno