aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compat/glibcxx_compat.cpp2
-rw-r--r--src/m4/bitcoin_find_bdb48.m44
-rw-r--r--src/qt/guiutil.cpp4
-rw-r--r--src/qt/peertablemodel.cpp10
-rw-r--r--src/rpcserver.cpp191
-rw-r--r--src/rpcserver.h1
-rw-r--r--src/rpcwallet.cpp2
7 files changed, 124 insertions, 90 deletions
diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp
index 417166aeda..cbe059735b 100644
--- a/src/compat/glibcxx_compat.cpp
+++ b/src/compat/glibcxx_compat.cpp
@@ -64,6 +64,8 @@ template istream& istream::_M_extract(unsigned short&);
out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT { }
+length_error::~length_error() _GLIBCXX_USE_NOEXCEPT { }
+
// Used with permission.
// See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d
diff --git a/src/m4/bitcoin_find_bdb48.m4 b/src/m4/bitcoin_find_bdb48.m4
index 72ec49b635..5223163fe5 100644
--- a/src/m4/bitcoin_find_bdb48.m4
+++ b/src/m4/bitcoin_find_bdb48.m4
@@ -44,7 +44,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[
AC_MSG_WARN([Found Berkeley DB other than 4.8; wallets opened by this build will not be portable!])
],[
- AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore)])
+ AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)])
])
else
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx)
@@ -60,7 +60,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
])
done
if test "x$BDB_LIBS" = "x"; then
- AC_MSG_ERROR(libdb_cxx missing)
+ AC_MSG_ERROR([libdb_cxx missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
fi
AC_SUBST(BDB_LIBS)
])
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 38fbc48a4d..7837e4229e 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -124,6 +124,10 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
SendCoinsRecipient rv;
rv.address = uri.path();
+ // Trim any following forward slash which may have been added by the OS
+ if (rv.address.endsWith("/")) {
+ rv.address.truncate(rv.address.length() - 1);
+ }
rv.amount = 0;
#if QT_VERSION < 0x050000
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index 54b46867ea..cfa05300cf 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -75,8 +75,14 @@ public:
}
// Try to retrieve the CNodeStateStats for each node.
- BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats)
- stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats);
+ {
+ TRY_LOCK(cs_main, lockMain);
+ if (lockMain)
+ {
+ BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats)
+ stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats);
+ }
+ }
if (sortColumn >= 0)
// sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily)
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index e7ed73310c..56064941f6 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -135,11 +135,18 @@ vector<unsigned char> ParseHexO(const Object& o, string strKey)
string CRPCTable::help(string strCommand) const
{
string strRet;
+ string category;
set<rpcfn_type> setDone;
+ vector<pair<string, const CRPCCommand*> > vCommands;
+
for (map<string, const CRPCCommand*>::const_iterator mi = mapCommands.begin(); mi != mapCommands.end(); ++mi)
+ vCommands.push_back(make_pair(mi->second->category + mi->first, mi->second));
+ sort(vCommands.begin(), vCommands.end());
+
+ BOOST_FOREACH(const PAIRTYPE(string, const CRPCCommand*)& command, vCommands)
{
- const CRPCCommand *pcmd = mi->second;
- string strMethod = mi->first;
+ const CRPCCommand *pcmd = command.second;
+ string strMethod = pcmd->name;
// We already filter duplicates, but these deprecated screw up the sort order
if (strMethod.find("label") != string::npos)
continue;
@@ -162,8 +169,20 @@ string CRPCTable::help(string strCommand) const
// Help text is returned in an exception
string strHelp = string(e.what());
if (strCommand == "")
+ {
if (strHelp.find('\n') != string::npos)
strHelp = strHelp.substr(0, strHelp.find('\n'));
+
+ if (category != pcmd->category)
+ {
+ if (!category.empty())
+ strRet += "\n";
+ category = pcmd->category;
+ string firstLetter = category.substr(0,1);
+ boost::to_upper(firstLetter);
+ strRet += "== " + firstLetter + category.substr(1) + " ==\n";
+ }
+ }
strRet += strHelp + "\n";
}
}
@@ -213,103 +232,105 @@ Value stop(const Array& params, bool fHelp)
static const CRPCCommand vRPCCommands[] =
-{ // name actor (function) okSafeMode threadSafe reqWallet
- // ------------------------ ----------------------- ---------- ---------- ---------
+{ // category name actor (function) okSafeMode threadSafe reqWallet
+ // --------------------- ------------------------ ----------------------- ---------- ---------- ---------
/* Overall control/query calls */
- { "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */
- { "help", &help, true, true, false },
- { "stop", &stop, true, true, false },
+ { "control", "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */
+ { "control", "help", &help, true, true, false },
+ { "control", "stop", &stop, true, true, false },
/* P2P networking */
- { "getnetworkinfo", &getnetworkinfo, true, false, false },
- { "addnode", &addnode, true, true, false },
- { "getaddednodeinfo", &getaddednodeinfo, true, true, false },
- { "getconnectioncount", &getconnectioncount, true, false, false },
- { "getnettotals", &getnettotals, true, true, false },
- { "getpeerinfo", &getpeerinfo, true, false, false },
- { "ping", &ping, true, false, false },
+ { "network", "getnetworkinfo", &getnetworkinfo, true, false, false },
+ { "network", "addnode", &addnode, true, true, false },
+ { "network", "getaddednodeinfo", &getaddednodeinfo, true, true, false },
+ { "network", "getconnectioncount", &getconnectioncount, true, false, false },
+ { "network", "getnettotals", &getnettotals, true, true, false },
+ { "network", "getpeerinfo", &getpeerinfo, true, false, false },
+ { "network", "ping", &ping, true, false, false },
/* Block chain and UTXO */
- { "getblockchaininfo", &getblockchaininfo, true, false, false },
- { "getbestblockhash", &getbestblockhash, true, false, false },
- { "getblockcount", &getblockcount, true, false, false },
- { "getblock", &getblock, true, false, false },
- { "getblockhash", &getblockhash, true, false, false },
- { "getchaintips", &getchaintips, true, false, false },
- { "getdifficulty", &getdifficulty, true, false, false },
- { "getrawmempool", &getrawmempool, true, false, false },
- { "gettxout", &gettxout, true, false, false },
- { "gettxoutsetinfo", &gettxoutsetinfo, true, false, false },
- { "verifychain", &verifychain, true, false, false },
+ { "blockchain", "getblockchaininfo", &getblockchaininfo, true, false, false },
+ { "blockchain", "getbestblockhash", &getbestblockhash, true, false, false },
+ { "blockchain", "getblockcount", &getblockcount, true, false, false },
+ { "blockchain", "getblock", &getblock, true, false, false },
+ { "blockchain", "getblockhash", &getblockhash, true, false, false },
+ { "blockchain", "getchaintips", &getchaintips, true, false, false },
+ { "blockchain", "getdifficulty", &getdifficulty, true, false, false },
+ { "blockchain", "getrawmempool", &getrawmempool, true, false, false },
+ { "blockchain", "gettxout", &gettxout, true, false, false },
+ { "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true, false, false },
+ { "blockchain", "verifychain", &verifychain, true, false, false },
/* Mining */
- { "getblocktemplate", &getblocktemplate, true, false, false },
- { "getmininginfo", &getmininginfo, true, false, false },
- { "getnetworkhashps", &getnetworkhashps, true, false, false },
- { "prioritisetransaction", &prioritisetransaction, true, false, false },
- { "submitblock", &submitblock, true, true, false },
+ { "mining", "getblocktemplate", &getblocktemplate, true, false, false },
+ { "mining", "getmininginfo", &getmininginfo, true, false, false },
+ { "mining", "getnetworkhashps", &getnetworkhashps, true, false, false },
+ { "mining", "prioritisetransaction", &prioritisetransaction, true, false, false },
+ { "mining", "submitblock", &submitblock, true, true, false },
+
+#ifdef ENABLE_WALLET
+ /* Coin generation */
+ { "generating", "getgenerate", &getgenerate, true, false, false },
+ { "generating", "gethashespersec", &gethashespersec, true, false, false },
+ { "generating", "setgenerate", &setgenerate, true, true, false },
+#endif
/* Raw transactions */
- { "createrawtransaction", &createrawtransaction, true, false, false },
- { "decoderawtransaction", &decoderawtransaction, true, false, false },
- { "decodescript", &decodescript, true, false, false },
- { "getrawtransaction", &getrawtransaction, true, false, false },
- { "sendrawtransaction", &sendrawtransaction, false, false, false },
- { "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */
+ { "rawtransactions", "createrawtransaction", &createrawtransaction, true, false, false },
+ { "rawtransactions", "decoderawtransaction", &decoderawtransaction, true, false, false },
+ { "rawtransactions", "decodescript", &decodescript, true, false, false },
+ { "rawtransactions", "getrawtransaction", &getrawtransaction, true, false, false },
+ { "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, false, false },
+ { "rawtransactions", "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */
/* Utility functions */
- { "createmultisig", &createmultisig, true, true , false },
- { "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */
- { "verifymessage", &verifymessage, true, false, false },
- { "estimatefee", &estimatefee, true, true, false },
- { "estimatepriority", &estimatepriority, true, true, false },
+ { "util", "createmultisig", &createmultisig, true, true , false },
+ { "util", "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */
+ { "util", "verifymessage", &verifymessage, true, false, false },
+ { "util", "estimatefee", &estimatefee, true, true, false },
+ { "util", "estimatepriority", &estimatepriority, true, true, false },
#ifdef ENABLE_WALLET
/* Wallet */
- { "addmultisigaddress", &addmultisigaddress, true, false, true },
- { "backupwallet", &backupwallet, true, false, true },
- { "dumpprivkey", &dumpprivkey, true, false, true },
- { "dumpwallet", &dumpwallet, true, false, true },
- { "encryptwallet", &encryptwallet, true, false, true },
- { "getaccountaddress", &getaccountaddress, true, false, true },
- { "getaccount", &getaccount, true, false, true },
- { "getaddressesbyaccount", &getaddressesbyaccount, true, false, true },
- { "getbalance", &getbalance, false, false, true },
- { "getnewaddress", &getnewaddress, true, false, true },
- { "getrawchangeaddress", &getrawchangeaddress, true, false, true },
- { "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
- { "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
- { "gettransaction", &gettransaction, false, false, true },
- { "getunconfirmedbalance", &getunconfirmedbalance, false, false, true },
- { "getwalletinfo", &getwalletinfo, false, false, true },
- { "importprivkey", &importprivkey, true, false, true },
- { "importwallet", &importwallet, true, false, true },
- { "importaddress", &importaddress, true, false, true },
- { "keypoolrefill", &keypoolrefill, true, false, true },
- { "listaccounts", &listaccounts, false, false, true },
- { "listaddressgroupings", &listaddressgroupings, false, false, true },
- { "listlockunspent", &listlockunspent, false, false, true },
- { "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
- { "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
- { "listsinceblock", &listsinceblock, false, false, true },
- { "listtransactions", &listtransactions, false, false, true },
- { "listunspent", &listunspent, false, false, true },
- { "lockunspent", &lockunspent, true, false, true },
- { "move", &movecmd, false, false, true },
- { "sendfrom", &sendfrom, false, false, true },
- { "sendmany", &sendmany, false, false, true },
- { "sendtoaddress", &sendtoaddress, false, false, true },
- { "setaccount", &setaccount, true, false, true },
- { "settxfee", &settxfee, true, false, true },
- { "signmessage", &signmessage, true, false, true },
- { "walletlock", &walletlock, true, false, true },
- { "walletpassphrasechange", &walletpassphrasechange, true, false, true },
- { "walletpassphrase", &walletpassphrase, true, false, true },
-
- /* Wallet-enabled mining */
- { "getgenerate", &getgenerate, true, false, false },
- { "gethashespersec", &gethashespersec, true, false, false },
- { "setgenerate", &setgenerate, true, true, false },
+ { "wallet", "addmultisigaddress", &addmultisigaddress, true, false, true },
+ { "wallet", "backupwallet", &backupwallet, true, false, true },
+ { "wallet", "dumpprivkey", &dumpprivkey, true, false, true },
+ { "wallet", "dumpwallet", &dumpwallet, true, false, true },
+ { "wallet", "encryptwallet", &encryptwallet, true, false, true },
+ { "wallet", "getaccountaddress", &getaccountaddress, true, false, true },
+ { "wallet", "getaccount", &getaccount, true, false, true },
+ { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true, false, true },
+ { "wallet", "getbalance", &getbalance, false, false, true },
+ { "wallet", "getnewaddress", &getnewaddress, true, false, true },
+ { "wallet", "getrawchangeaddress", &getrawchangeaddress, true, false, true },
+ { "wallet", "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
+ { "wallet", "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
+ { "wallet", "gettransaction", &gettransaction, false, false, true },
+ { "wallet", "getunconfirmedbalance", &getunconfirmedbalance, false, false, true },
+ { "wallet", "getwalletinfo", &getwalletinfo, false, false, true },
+ { "wallet", "importprivkey", &importprivkey, true, false, true },
+ { "wallet", "importwallet", &importwallet, true, false, true },
+ { "wallet", "importaddress", &importaddress, true, false, true },
+ { "wallet", "keypoolrefill", &keypoolrefill, true, false, true },
+ { "wallet", "listaccounts", &listaccounts, false, false, true },
+ { "wallet", "listaddressgroupings", &listaddressgroupings, false, false, true },
+ { "wallet", "listlockunspent", &listlockunspent, false, false, true },
+ { "wallet", "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
+ { "wallet", "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
+ { "wallet", "listsinceblock", &listsinceblock, false, false, true },
+ { "wallet", "listtransactions", &listtransactions, false, false, true },
+ { "wallet", "listunspent", &listunspent, false, false, true },
+ { "wallet", "lockunspent", &lockunspent, true, false, true },
+ { "wallet", "move", &movecmd, false, false, true },
+ { "wallet", "sendfrom", &sendfrom, false, false, true },
+ { "wallet", "sendmany", &sendmany, false, false, true },
+ { "wallet", "sendtoaddress", &sendtoaddress, false, false, true },
+ { "wallet", "setaccount", &setaccount, true, false, true },
+ { "wallet", "settxfee", &settxfee, true, false, true },
+ { "wallet", "signmessage", &signmessage, true, false, true },
+ { "wallet", "walletlock", &walletlock, true, false, true },
+ { "wallet", "walletpassphrasechange", &walletpassphrasechange, true, false, true },
+ { "wallet", "walletpassphrase", &walletpassphrase, true, false, true },
#endif // ENABLE_WALLET
};
diff --git a/src/rpcserver.h b/src/rpcserver.h
index 176852ca8f..2248e8aeb2 100644
--- a/src/rpcserver.h
+++ b/src/rpcserver.h
@@ -71,6 +71,7 @@ typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool f
class CRPCCommand
{
public:
+ std::string category;
std::string name;
rpcfn_type actor;
bool okSafeMode;
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 667ca33ce1..215da2ea12 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -1518,7 +1518,7 @@ Value gettransaction(const Array& params, bool fHelp)
" \"hex\" : \"data\" (string) Raw data for transaction\n"
"}\n"
- "\nbExamples\n"
+ "\nExamples:\n"
+ HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
+ HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
);