add amount to livestream

This commit is contained in:
Tiago Vasconcelos 2023-01-06 12:45:55 +00:00
parent c8cdf2f1d2
commit 1032ad3417

View file

@ -86,16 +86,19 @@ async def lnurl_callback(
ls = await get_livestream_by_track(track_id)
extra_amount = amount_received - int(
amount_received * (100 - ls.fee_pct) / 100
) # msats
extra_amount = amount_received - int(amount_received * (100 - ls.fee_pct) / 100)
payment_hash, payment_request = await create_invoice(
wallet_id=ls.wallet,
amount=int(amount_received / 1000), # sats
amount=int(amount_received / 1000),
memo=await track.fullname(),
unhashed_description=(await track.lnurlpay_metadata()).encode(),
extra={"tag": "livestream", "track": track.id, "comment": comment},
extra={
"tag": "livestream",
"track": track.id,
"comment": comment,
"amount": int(extra_amount / 1000),
},
)
if amount_received < track.price_msat: