From: Chris Duncan Date: Fri, 8 Nov 2024 18:43:39 +0000 (-0800) Subject: Break up sweep statements for legibility. X-Git-Tag: v0.0.20~40 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=bba3292fb468d6281c39335b3c47cb25d707ab37;p=libnemo.git Break up sweep statements for legibility. --- diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 20065ad..c9ba788 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -152,7 +152,7 @@ export async function sweep (rpc: Rpc | string | URL, wallet: Blake2bWallet | Bi account.representative.address, account.frontier ) - blockQueue.push(new Promise(async resolve => { + const blockRequest = new Promise(async (resolve) => { try { await block.pow(rpc) await block.sign(account.index) @@ -163,7 +163,8 @@ export async function sweep (rpc: Rpc | string | URL, wallet: Blake2bWallet | Bi } finally { resolve(null) } - })) + }) + blockQueue.push(blockRequest) } } await Promise.allSettled(blockQueue)