wallet: refactor syncOutputDepth.
This commit is contained in:
parent
32c93af2c4
commit
2d74bda89b
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user