From f1dea9fc9b9e9ade6aa221ba577743d1ecf4d111 Mon Sep 17 00:00:00 2001 From: benarc Date: Wed, 24 Nov 2021 09:56:24 +0000 Subject: [PATCH] weighted chance to account for transaction fees --- lnbits/extensions/satsdice/lnurl.py | 2 +- lnbits/extensions/satsdice/templates/satsdice/index.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/satsdice/lnurl.py b/lnbits/extensions/satsdice/lnurl.py index 03ff25d9..ec37854e 100644 --- a/lnbits/extensions/satsdice/lnurl.py +++ b/lnbits/extensions/satsdice/lnurl.py @@ -148,7 +148,7 @@ async def api_lnurlw_callback( return {"status": "ERROR", "reason": "no withdraw"} if link.used: return {"status": "ERROR", "reason": "spent"} - + print("winner") paylink = await get_satsdice_pay(link.satsdice_pay) await update_satsdice_withdraw(link.id, used=1) diff --git a/lnbits/extensions/satsdice/templates/satsdice/index.html b/lnbits/extensions/satsdice/templates/satsdice/index.html index f383f0df..622127e2 100644 --- a/lnbits/extensions/satsdice/templates/satsdice/index.html +++ b/lnbits/extensions/satsdice/templates/satsdice/index.html @@ -329,7 +329,8 @@ chanceValueCalc() { this.chanceValue = ( (1 / this.multiValue) * 100 - - this.formDialog.data.haircut + this.formDialog.data.haircut - + (1 / this.multiValue) * 10 ).toFixed(2) return this.chanceValue } @@ -446,7 +447,7 @@ key === 'success_url') && (value === null || value === '') ) - + LNbits.api .request( 'PUT',