diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index d29ca615..264ff272 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -1956,7 +1956,7 @@ Wallet.prototype._setLookahead = async function setLookahead(acct, lookahead) { */ Wallet.prototype.syncOutputDepth = async function syncOutputDepth(details) { - let accounts = new Map(); + let map = new Map(); let derived = []; if (!details) @@ -1971,14 +1971,13 @@ Wallet.prototype.syncOutputDepth = async function syncOutputDepth(details) { if (path.index === -1) continue; - if (!accounts.has(path.account)) - accounts.set(path.account, []); + if (!map.has(path.account)) + map.set(path.account, []); - accounts.get(path.account).push(path); + map.get(path.account).push(path); } - for (let paths of accounts.values()) { - let acct = paths[0].account; + for (let [acct, paths] of map) { let receive = -1; let change = -1; let nested = -1;