mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -353,6 +353,12 @@ Amount.prototype.issuer = function() {
|
||||
return this._issuer;
|
||||
};
|
||||
|
||||
Amount.prototype.to_number = function(allow_nan) {
|
||||
var s = this.to_text(allow_nan);
|
||||
|
||||
return ('string' === typeof s) ? Number(s) : s;
|
||||
}
|
||||
|
||||
// Convert only value to JSON wire format.
|
||||
Amount.prototype.to_text = function(allow_nan) {
|
||||
if (isNaN(this._value)) {
|
||||
|
||||
@@ -806,13 +806,15 @@ Remote.prototype.ledger_accept = function () {
|
||||
|
||||
// Return a request to refresh the account balance.
|
||||
Remote.prototype.request_account_balance = function (account, current) {
|
||||
return (this.request_ledger_entry('account_root'))
|
||||
var request = this.request_ledger_entry('account_root');
|
||||
|
||||
return request
|
||||
.account_root(account)
|
||||
.ledger_choose(current)
|
||||
.on('success', function (message) {
|
||||
// If the caller also waits for 'success', they might run before this.
|
||||
request.emit('account_balance', message.node.Balance);
|
||||
});
|
||||
// If the caller also waits for 'success', they might run before this.
|
||||
request.emit('account_balance', Amount.from_json(message.node.Balance));
|
||||
});
|
||||
};
|
||||
|
||||
// Return the next account sequence if possible.
|
||||
|
||||
Reference in New Issue
Block a user