Skip to content

Commit 9408c58

Browse files
committed
Added watchonly parameter to getBalance function
1 parent b8e35e4 commit 9408c58

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/bitcoinapi/bitcoinapi.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,18 @@ double BitcoinAPI::getbalance(const string& account, int minconf) {
437437
return result.asDouble();
438438
}
439439

440+
double BitcoinAPI::getbalance(const string& account, int minconf, bool includeWatchOnly) {
441+
string command = "getbalance";
442+
Value params, result;
443+
params.append(account);
444+
params.append(minconf);
445+
params.append(includeWatchOnly);
446+
result = sendcommand(command, params);
447+
448+
return result.asDouble();
449+
}
450+
451+
440452
double BitcoinAPI::getunconfirmedbalance() {
441453
string command = "getunconfirmedbalance";
442454
Value params, result;

src/bitcoinapi/bitcoinapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class BitcoinAPI
7575
/* === Accounting === */
7676
double getbalance();
7777
double getbalance(const std::string& account, int minconf = 1);
78+
double getbalance(const std::string& account, int minconf = 1, bool includeWatchOnly = false);
7879
double getunconfirmedbalance();
7980

8081
double getreceivedbyaccount(const std::string& account, int minconf = 1);

0 commit comments

Comments
 (0)