Skip to content

Commit

Permalink
Merge pull request #418 from pinheadmz/walletheight1
Browse files Browse the repository at this point in the history
wallet: return wdb height in rpc getwalletinfo
  • Loading branch information
boymanjor authored Mar 31, 2020
2 parents 3db8bf8 + dceb8d2 commit 24a9d23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wallet/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ class RPC extends RPCBase {
keypoololdest: 0,
keypoolsize: 0,
unlocked_until: wallet.master.until,
paytxfee: Amount.coin(this.wdb.feeRate, true)
paytxfee: Amount.coin(this.wdb.feeRate, true),
height: this.wdb.height
};
}

Expand Down
6 changes: 6 additions & 0 deletions test/wallet-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,11 @@ describe('Wallet RPC Methods', function() {

assert.strictEqual(verify, true);
});

it('should get wallet info', async () => {
const info = await wclient.execute('getwalletinfo', []);
assert.strictEqual(info.walletid, 'primary');
assert.strictEqual(info.height, node.chain.height);
});
});
});

0 comments on commit 24a9d23

Please sign in to comment.