diff options
| author | Wladimir J. van der Laan <[email protected]> | 2013-12-20 14:42:52 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2013-12-20 14:43:01 +0100 |
| commit | 23981b1f47a6b1ace419934a07282c5a15441f94 (patch) | |
| tree | 82c53bae3b6ca8600af531ebc94f755d8693da8a /src | |
| parent | Merge pull request #3437 (diff) | |
| parent | Add rpc command 'getunconfirmedbalance' to obtain total unconfirmed balance (diff) | |
| download | discoin-23981b1f47a6b1ace419934a07282c5a15441f94.tar.xz discoin-23981b1f47a6b1ace419934a07282c5a15441f94.zip | |
Merge pull request #3369
6027b46 Add rpc command 'getunconfirmedbalance' to obtain total unconfirmed balance (Michael Bauer)
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 d1fa81628..9f2100a8d 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -276,6 +276,7 @@ static const CRPCCommand vRPCCommands[] = { "walletlock", &walletlock, true, false, true }, { "encryptwallet", &encryptwallet, false, false, true }, { "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 4d29e90c0..9087be9e8 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 32db0b46a..8ad5c9c51 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -646,6 +646,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) { |