diff options
author | Michael Bauer <michael@m-bauer.org> | 2013-11-24 12:48:52 +0100 |
---|---|---|
committer | Michael Bauer <michael@m-bauer.org> | 2013-12-08 18:51:45 +0100 |
commit | 6027b460e40e7769930d0e89f18f011fa0f6c262 (patch) | |
tree | 311b39159c8c4a55b2f928a0b33ec47768c295e9 /src | |
parent | fbbed19b78e3055103cdff8d31d24ced7e7e561b (diff) |
Add rpc command 'getunconfirmedbalance' to obtain total unconfirmed balance
Conflicts:
src/rpcserver.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/rpcserver.cpp | 1 | ||||
-rw-r--r-- | src/rpcserver.h | 1 | ||||
-rw-r--r-- | src/rpcwallet.cpp | 9 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index c746d8c8fb..403567203c 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -253,6 +253,7 @@ static const CRPCCommand vRPCCommands[] = { "encryptwallet", &encryptwallet, false, false, true }, { "validateaddress", &validateaddress, true, false, false }, { "getbalance", &getbalance, false, false, true }, + { "getunconfirmedbalance", &getunconfirmedbalance, false, false, true }, { "move", &movecmd, false, false, true }, { "sendfrom", &sendfrom, false, false, true }, { "sendmany", &sendmany, false, false, true }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 4d29e90c09..9087be9e88 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -135,6 +135,7 @@ extern json_spirit::Value verifymessage(const json_spirit::Array& params, bool f extern json_spirit::Value getreceivedbyaddress(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getreceivedbyaccount(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getbalance(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getunconfirmedbalance(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value movecmd(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value sendfrom(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value sendmany(const json_spirit::Array& params, bool fHelp); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index b4e522de8f..fe42b74dea 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -767,6 +767,15 @@ Value getbalance(const Array& params, bool fHelp) return ValueFromAmount(nBalance); } +Value getunconfirmedbalance(const Array ¶ms, bool fHelp) +{ + if (fHelp || params.size() > 0) + throw runtime_error( + "getunconfirmedbalance\n" + "Returns the server's total unconfirmed balance\n"); + return ValueFromAmount(pwalletMain->GetUnconfirmedBalance()); +} + Value movecmd(const Array& params, bool fHelp) { |