From 23c9dbb40b8e63d61ae17dee3025fbe97f10c8b0 Mon Sep 17 00:00:00 2001 From: n9lsjr Date: Mon, 19 Feb 2024 23:19:38 +0100 Subject: [PATCH] More detailed logs, fix --- utils/wallet.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/utils/wallet.js b/utils/wallet.js index 1d4468e..8f6ff1a 100644 --- a/utils/wallet.js +++ b/utils/wallet.js @@ -167,20 +167,22 @@ async function optimizeMessages(wallet, nbrOfTxs, fee = 10000, attempt = 0) { return false } console.log("Optimizing!") - if (wallet.getAddresses().length === 1) { + if (wallet.subWallets.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!") + console.log("Subwallet created!", wallet.subWallets.getAddresses()) } - + const [walletHeight, localHeight, networkHeight] = wallet.getSyncStatus() - - let inputs = await wallet.subWallets.getSpendableTransactionInputs(wallet.getAddresses()[1], networkHeight) + console.log("Got addresses", wallet.getAddresses()) + console.log("Test get addresses", wallet.subWallets.getAddresses()) - console.log("Got inputs!", inputs) + let inputs = await wallet.subWallets.getSpendableTransactionInputs(wallet.subWallets.getAddresses()[1], networkHeight) + console.log("Got inputs!", inputs) + if (inputs.length > 8) { return inputs.length }