feat: show pending/in-flight payments for LDK Node in hourglass view

This commit is contained in:
Evan Kaloudis
2026-03-26 20:01:33 -04:00
parent 83053f0daf
commit 1e046ec4d1
2 changed files with 32 additions and 3 deletions
+25
View File
@@ -469,6 +469,31 @@ export default class ChannelsStore {
this.loading = false;
});
if (
this.settingsStore.implementation === 'embedded-ldk-node' &&
setPendingHtlcs
) {
try {
const data = await BackendUtils.getPayments();
const pendingPayments = (data?.payments || []).filter(
(p: any) => p.status === 'IN_FLIGHT'
);
runInAction(() => {
for (const p of pendingPayments) {
this.pendingHTLCs.push({
incoming: false,
amount: p.value_sat || p.value || 0,
hash_lock: p.payment_hash || '',
expiration_height: 0
});
}
});
} catch (e) {
console.log('LDK Node: Failed to fetch pending payments', e);
}
}
return channels;
};
+7 -3
View File
@@ -99,9 +99,13 @@ export default class PendingHTLCs extends React.PureComponent<
const displayName = item.incoming
? localeString('views.PendingHTLCs.incoming')
: localeString('views.PendingHTLCs.outgoing');
const subTitle = `${localeString(
'views.PendingHTLCs.expirationHeight'
)}: ${numberWithCommas(item.expiration_height)}`;
const subTitle = item.expiration_height
? `${localeString(
'views.PendingHTLCs.expirationHeight'
)}: ${numberWithCommas(
item.expiration_height
)}`
: '';
return (
<React.Fragment>