From c3b154ba28199b2e53135ccc152ce81f4113df80 Mon Sep 17 00:00:00 2001 From: n9lsjr Date: Mon, 19 Feb 2024 22:53:59 +0100 Subject: [PATCH] Add some logs --- utils/wallet.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/wallet.js b/utils/wallet.js index 86ef294..1d4468e 100644 --- a/utils/wallet.js +++ b/utils/wallet.js @@ -166,16 +166,21 @@ async function optimizeMessages(wallet, nbrOfTxs, fee = 10000, attempt = 0) { if (attempt > 10) { return false } + console.log("Optimizing!") if (wallet.getAddresses().length === 1) { + console.log("Creating subwallet!") const [spendKey, viewKey] = wallet.getPrimaryAddressPrivateKeys() const subWalletKeys = await crypto.generateDeterministicSubwalletKeys(spendKey, 1) await wallet.importSubWallet(subWalletKeys.private_key) + console.log("Subwallet created!") } const [walletHeight, localHeight, networkHeight] = wallet.getSyncStatus() let inputs = await wallet.subWallets.getSpendableTransactionInputs(wallet.getAddresses()[1], networkHeight) - + + console.log("Got inputs!", inputs) + if (inputs.length > 8) { return inputs.length }