Minor fixes

This commit is contained in:
minibits-cash
2025-11-26 11:27:27 +01:00
parent 74c7eaf927
commit 3ee5b5f27c
2 changed files with 16 additions and 10 deletions
+3 -3
View File
@@ -284,9 +284,9 @@ import { SerializedDLEQ } from '@cashu/cashu-ts'
p.isSpent = true
}
// Automatically clean if any were in mint-pending list
const secrets = proofs.map(p => p.secret)
self.pendingByMintSecrets.replace(
self.pendingByMintSecrets.filter(s => !secrets.includes(s))
const secrets = new Set(proofs.map(p => p.secret))
self.pendingByMintSecrets.replace(
self.pendingByMintSecrets.filter(s => !secrets.has(s))
)
},
+13 -7
View File
@@ -1295,13 +1295,19 @@ const handlePendingQueue = async (): Promise<void> => {
message: 'Lightning invoice expired',
createdAt: new Date(),
}
const txData = tx.data ? [...JSON.parse(tx.data), update] : [update]
tx.update({
status: TransactionStatus.EXPIRED,
data: JSON.stringify(txData),
})
try {
const txData = tx.data ? [...JSON.parse(tx.data), update] : [update]
tx.update({
status: TransactionStatus.EXPIRED,
data: JSON.stringify(txData),
})
} catch(e: any) {
tx.update({
status: TransactionStatus.EXPIRED,
data: JSON.stringify(update),
})
}
}
}