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) {
|
Wallet.prototype.syncOutputDepth = async function syncOutputDepth(details) {
|
||||||
let accounts = new Map();
|
let map = new Map();
|
||||||
let derived = [];
|
let derived = [];
|
||||||
|
|
||||||
if (!details)
|
if (!details)
|
||||||
@ -1971,14 +1971,13 @@ Wallet.prototype.syncOutputDepth = async function syncOutputDepth(details) {
|
|||||||
if (path.index === -1)
|
if (path.index === -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!accounts.has(path.account))
|
if (!map.has(path.account))
|
||||||
accounts.set(path.account, []);
|
map.set(path.account, []);
|
||||||
|
|
||||||
accounts.get(path.account).push(path);
|
map.get(path.account).push(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let paths of accounts.values()) {
|
for (let [acct, paths] of map) {
|
||||||
let acct = paths[0].account;
|
|
||||||
let receive = -1;
|
let receive = -1;
|
||||||
let change = -1;
|
let change = -1;
|
||||||
let nested = -1;
|
let nested = -1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user