Fix missing wallet error logging

This commit is contained in:
ekzyis 2024-12-13 11:30:28 +01:00
parent ec213907fc
commit 64ba7a56cb
1 changed files with 13 additions and 8 deletions

View File

@ -37,17 +37,22 @@ export function useWalletConfigurator (wallet) {
let serverConfig = serverWithShared let serverConfig = serverWithShared
if (canSend({ def: wallet.def, config: clientConfig })) { if (canSend({ def: wallet.def, config: clientConfig })) {
let transformedConfig = await validateWallet(wallet.def, clientWithShared, { skipGenerated: true }) try {
if (transformedConfig) { let transformedConfig = await validateWallet(wallet.def, clientWithShared, { skipGenerated: true })
clientConfig = Object.assign(clientConfig, transformedConfig)
}
if (wallet.def.testSendPayment && validateLightning) {
transformedConfig = await wallet.def.testSendPayment(clientConfig, { me, logger })
if (transformedConfig) { if (transformedConfig) {
clientConfig = Object.assign(clientConfig, transformedConfig) clientConfig = Object.assign(clientConfig, transformedConfig)
} }
// validate again to ensure generated fields are valid if (wallet.def.testSendPayment && validateLightning) {
await validateWallet(wallet.def, clientConfig) transformedConfig = await wallet.def.testSendPayment(clientConfig, { me, logger })
if (transformedConfig) {
clientConfig = Object.assign(clientConfig, transformedConfig)
}
// validate again to ensure generated fields are valid
await validateWallet(wallet.def, clientConfig)
}
} catch (err) {
logger.error(err.message)
throw err
} }
} else if (canReceive({ def: wallet.def, config: serverConfig })) { } else if (canReceive({ def: wallet.def, config: serverConfig })) {
const transformedConfig = await validateWallet(wallet.def, serverConfig) const transformedConfig = await validateWallet(wallet.def, serverConfig)