diff --git a/lib/bcoin/walletdb.js b/lib/bcoin/walletdb.js index cf2cea5b..92e89e8d 100644 --- a/lib/bcoin/walletdb.js +++ b/lib/bcoin/walletdb.js @@ -620,7 +620,8 @@ WalletDB.prototype.getAccounts = function getAccounts(id, callback) { parse: function(value, key) { var name = key.split('/')[2]; var index = value.readUInt32LE(0, true); - accounts[index] = name; + assert(index === accounts.length); + accounts.push(name); } }, function(err) { if (err)