mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
Fix endless loop when creating an Account object for a non-existent account.
This commit is contained in:
@@ -163,7 +163,10 @@ Account.prototype.getNextSequence = function(callback) {
|
||||
var callback = typeof callback === 'function' ? callback : function(){};
|
||||
|
||||
function accountInfo(err, info) {
|
||||
if (err) {
|
||||
if (err && err.error === "actNotFound") {
|
||||
// New accounts will start out as sequence zero
|
||||
callback(null, 0);
|
||||
} else if (err) {
|
||||
callback(err);
|
||||
} else {
|
||||
callback(null, info.account_data.Sequence);
|
||||
|
||||
Reference in New Issue
Block a user