disambiguate preimage after payment from hold preimage
This commit is contained in:
parent
e696a9bc82
commit
67ec82b6d9
|
@ -43,7 +43,7 @@ export async function getInvoice (parent, { id }, { me, models, lnd }) {
|
||||||
try {
|
try {
|
||||||
if (inv.confirmedAt) {
|
if (inv.confirmedAt) {
|
||||||
const lnInv = await getInvoiceFromLnd({ id: inv.hash, lnd })
|
const lnInv = await getInvoiceFromLnd({ id: inv.hash, lnd })
|
||||||
inv.preimage = lnInv.secret
|
inv.confirmedPreimage = lnInv.secret
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('error fetching invoice from LND', err)
|
console.error('error fetching invoice from LND', err)
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default gql`
|
||||||
lud18Data: JSONObject
|
lud18Data: JSONObject
|
||||||
hmac: String
|
hmac: String
|
||||||
isHeld: Boolean
|
isHeld: Boolean
|
||||||
preimage: String
|
confirmedPreimage: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type Withdrawl {
|
type Withdrawl {
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function Invoice ({ invoice, onPayment, info, successVerb }) {
|
||||||
}
|
}
|
||||||
}, [invoice.confirmedAt, invoice.isHeld, invoice.satsReceived])
|
}, [invoice.confirmedAt, invoice.isHeld, invoice.satsReceived])
|
||||||
|
|
||||||
const { nostr, comment, lud18Data, bolt11, preimage } = invoice
|
const { nostr, comment, lud18Data, bolt11, confirmedPreimage } = invoice
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -86,7 +86,7 @@ export function Invoice ({ invoice, onPayment, info, successVerb }) {
|
||||||
body={<span className='text-muted ms-3'>{comment}</span>}
|
body={<span className='text-muted ms-3'>{comment}</span>}
|
||||||
/>
|
/>
|
||||||
</div>}
|
</div>}
|
||||||
<Bolt11Info bolt11={bolt11} preimage={preimage} />
|
<Bolt11Info bolt11={bolt11} preimage={confirmedPreimage} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue