diff --git a/init.cpp b/init.cpp index 04bdd68cd..9c84dca16 100644 --- a/init.cpp +++ b/init.cpp @@ -175,7 +175,7 @@ bool AppInit2(int argc, char* argv[]) " -proxy= \t " + _("Connect through socks4 proxy\n") + " -addnode= \t " + _("Add a node to connect to\n") + " -connect= \t\t " + _("Connect only to the specified node\n") + - " -nolisten \t " + _("Don't accept connections from outside") + + " -nolisten \t " + _("Don't accept connections from outside\n") + " -paytxfee= \t " + _("Fee per KB to add to transactions you send\n") + " -server \t\t " + _("Accept command line and JSON-RPC commands\n") + " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") + diff --git a/net.cpp b/net.cpp index 0ba147bf7..d18b63eb5 100644 --- a/net.cpp +++ b/net.cpp @@ -741,7 +741,7 @@ void ThreadSocketHandler2(void* parg) CDataStream& vRecv = pnode->vRecv; unsigned int nPos = vRecv.size(); - if (nPos > 1000*GetArg("-maxreceivebuffer", 2*1000)) { + if (nPos > 1000*GetArg("-maxreceivebuffer", 10*1000)) { if (!pnode->fDisconnect) printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size()); pnode->CloseSocketDisconnect(); @@ -806,7 +806,7 @@ void ThreadSocketHandler2(void* parg) pnode->CloseSocketDisconnect(); } } - if (vSend.size() > 1000*GetArg("-maxsendbuffer", 256)) { + if (vSend.size() > 1000*GetArg("-maxsendbuffer", 10*1000)) { if (!pnode->fDisconnect) printf("socket send flood control disconnect (%d bytes)\n", vSend.size()); pnode->CloseSocketDisconnect(); diff --git a/rpc.cpp b/rpc.cpp index 1c6f228e5..dd94acc05 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -381,6 +381,12 @@ Value setaccount(const Array& params, bool fHelp) "Sets the account associated with the given address."); string strAddress = params[0].get_str(); + uint160 hash160; + bool isValid = AddressToHash160(strAddress, hash160); + if (!isValid) + throw JSONRPCError(-5, "Invalid bitcoin address"); + + string strAccount; if (params.size() > 1) strAccount = AccountFromValue(params[1]); diff --git a/util.cpp b/util.cpp index 8518e2797..8a2f9d525 100644 --- a/util.cpp +++ b/util.cpp @@ -313,7 +313,12 @@ void ParseString(const string& str, char c, vector& v) string FormatMoney(int64 n, bool fPlus) { - string str = strprintf("%.08f", double(n > 0 ? n : -n)/double(COIN)); + // Note: not using straight sprintf here because we do NOT want + // localized number formatting. + int64 n_abs = (n > 0 ? n : -n); + int64 quotient = n_abs/COIN; + int64 remainder = n_abs%COIN; + string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder); // Right-trim excess 0's before the decimal point: int nTrim = 0;