This commit is contained in:
boufni95 2026-02-04 19:59:22 +00:00
parent 070aa758d8
commit 1f09bcc679
3 changed files with 9 additions and 1 deletions

View file

@ -164,7 +164,9 @@ export class Swaps {
await this.storage.paymentStorage.FailInvoiceSwap(swapOpId, result.error, txId)
this.log("invoice swap failed", { swapOpId, error: result.error })
}
}, () => payAddress(swap.address, swap.transaction_amount).then(res => { txId = res.txId }).catch(err => { close(); this.log("error paying address", err) }))
}, () => payAddress(swap.address, swap.transaction_amount)
.then(res => { txId = res.txId })
.catch(err => { close(); this.log("error paying address", err.message || err) }))
}
ResumeInvoiceSwaps = async () => {

View file

@ -271,6 +271,10 @@ export class AdminManager {
return { quotes }
}
TMP_FIX_ADMIN_TX_ID = async () => {
await this.storage.paymentStorage.SetInvoiceSwapTxId("6089e1e5-2178-418e-ae19-d32ac5eb1a84", "f997b521ce1374a85e40a0fee5ad40692338b0f5965002b9f07d141cdbe03036")
}
async PayAdminInvoiceSwap(req: Types.PayAdminInvoiceSwapRequest): Promise<Types.AdminInvoiceSwapResponse> {
const txId = await new Promise<string>(res => {
this.swaps.PayInvoiceSwap("admin", req.swap_operation_id, req.sat_per_v_byte, async (addr, amt) => {
@ -288,6 +292,7 @@ export class AdminManager {
}
await this.storage.paymentStorage.SetInvoiceSwapTxId(req.swap_operation_id, txId, lockupTxHex)
this.log("saved admin swap txid", { swapOpId: req.swap_operation_id, txId })
res(tx.txid)
return { txId: tx.txid }
})

View file

@ -80,6 +80,7 @@ export const initMainHandler = async (log: PubLogger, settingsManager: SettingsM
await mainHandler.appUserManager.CleanupInactiveUsers()
await mainHandler.appUserManager.CleanupNeverActiveUsers()
await swaps.ResumeInvoiceSwaps()
await adminManager.TMP_FIX_ADMIN_TX_ID()
await mainHandler.paymentManager.watchDog.Start()
return { mainHandler, apps, localProviderClient, wizard, adminManager }
}