rpc: fix wallet and account balances.
This commit is contained in:
parent
e6f869ce09
commit
0ead568225
@ -323,7 +323,7 @@ RPC.prototype.getinfo = co(function* getinfo(args) {
|
|||||||
version: constants.USER_VERSION,
|
version: constants.USER_VERSION,
|
||||||
protocolversion: constants.VERSION,
|
protocolversion: constants.VERSION,
|
||||||
walletversion: 0,
|
walletversion: 0,
|
||||||
balance: +utils.btc(balance.total),
|
balance: +utils.btc(balance.unconfirmed),
|
||||||
blocks: this.chain.height,
|
blocks: this.chain.height,
|
||||||
timeoffset: time.offset,
|
timeoffset: time.offset,
|
||||||
connections: this.pool.peers.all.length,
|
connections: this.pool.peers.all.length,
|
||||||
@ -2913,7 +2913,7 @@ RPC.prototype.getbalance = co(function* getbalance(args) {
|
|||||||
if (minconf)
|
if (minconf)
|
||||||
value = balance.confirmed;
|
value = balance.confirmed;
|
||||||
else
|
else
|
||||||
value = balance.total;
|
value = balance.unconfirmed;
|
||||||
|
|
||||||
return +utils.btc(value);
|
return +utils.btc(value);
|
||||||
});
|
});
|
||||||
@ -3173,7 +3173,7 @@ RPC.prototype.getwalletinfo = co(function* getwalletinfo(args) {
|
|||||||
return {
|
return {
|
||||||
walletid: this.wallet.id,
|
walletid: this.wallet.id,
|
||||||
walletversion: 0,
|
walletversion: 0,
|
||||||
balance: +utils.btc(balance.total),
|
balance: +utils.btc(balance.unconfirmed),
|
||||||
unconfirmed_balance: +utils.btc(balance.unconfirmed),
|
unconfirmed_balance: +utils.btc(balance.unconfirmed),
|
||||||
txcount: this.wallet.state.tx,
|
txcount: this.wallet.state.tx,
|
||||||
keypoololdest: 0,
|
keypoololdest: 0,
|
||||||
@ -3326,7 +3326,7 @@ RPC.prototype.listaccounts = co(function* listaccounts(args) {
|
|||||||
for (i = 0; i < accounts.length; i++) {
|
for (i = 0; i < accounts.length; i++) {
|
||||||
account = accounts[i];
|
account = accounts[i];
|
||||||
balance = yield this.wallet.getBalance(account);
|
balance = yield this.wallet.getBalance(account);
|
||||||
map[account] = +utils.btc(balance.total);
|
map[account] = +utils.btc(balance.unconfirmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user