WIP: fix LDK send payment negative amount

This commit is contained in:
Overtorment 2021-10-05 20:56:55 +01:00
parent 73702277c8
commit f04412881c
No known key found for this signature in database
GPG key ID: AB15F43F78CCBC06

View file

@ -305,7 +305,7 @@ export class LightningLdkWallet extends LightningCustodianWallet {
if (!result) throw new Error('Failed');
// ok, it was sent. now, waiting for an event that it was _actually_ paid:
for (let c = 0; c < 50; c++) {
for (let c = 0; c < 60; c++) {
await new Promise(resolve => setTimeout(resolve, 500)); // sleep
for (const sentPayment of RnLdk.sentPayments || []) {
const paidHash = LightningLdkWallet.preimage2hash(sentPayment.payment_preimage);
@ -314,7 +314,7 @@ export class LightningLdkWallet extends LightningCustodianWallet {
this._listPayments.push(
Object.assign({}, sentPayment, {
memo: decoded.description || 'Lightning payment',
value: freeAmount || -1,
value: (freeAmount || decoded.num_satoshis) * -1,
received: +new Date(),
payment_preimage: sentPayment.payment_preimage,
payment_hash: decoded.payment_hash,