mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Add routing timeout to .env
This commit is contained in:
parent
7c050b560a
commit
4ac3618fd7
@ -91,11 +91,15 @@ INVOICE_AND_ESCROW_DURATION = 30
|
||||
# Time to confim chat and confirm fiat (time to Fiat Sent confirmation) HOURS
|
||||
FIAT_EXCHANGE_DURATION = 24
|
||||
|
||||
# ROUTING
|
||||
# Proportional routing fee limit (fraction of total payout: % / 100)
|
||||
PROPORTIONAL_ROUTING_FEE_LIMIT = 0.0002
|
||||
# Base flat limit fee for routing in Sats (used only when proportional is lower than this)
|
||||
MIN_FLAT_ROUTING_FEE_LIMIT = 10
|
||||
MIN_FLAT_ROUTING_FEE_LIMIT_REWARD = 2
|
||||
# Routing timeouts
|
||||
REWARDS_TIMEOUT_SECONDS = 60
|
||||
PAYOUT_TIMEOUT_SECONDS = 60
|
||||
|
||||
# Reward tip. Reward for every finished trade in the referral program (Satoshis)
|
||||
REWARD_TIP = 100
|
||||
|
@ -238,7 +238,7 @@ class LNNode:
|
||||
|
||||
if payout["expires_at"] < timezone.now():
|
||||
payout["context"] = {
|
||||
"bad_invoice": f"The invoice provided has already expired"
|
||||
"bad_invoice": "The invoice provided has already expired"
|
||||
}
|
||||
return payout
|
||||
|
||||
@ -257,9 +257,10 @@ class LNNode:
|
||||
lnpayment.num_satoshis * float(config("PROPORTIONAL_ROUTING_FEE_LIMIT")),
|
||||
float(config("MIN_FLAT_ROUTING_FEE_LIMIT_REWARD")),
|
||||
)) # 200 ppm or 10 sats
|
||||
timeout_seconds = int(config("PAYOUT_TIMEOUT_SECONDS"))
|
||||
request = routerrpc.SendPaymentRequest(payment_request=lnpayment.invoice,
|
||||
fee_limit_sat=fee_limit_sat,
|
||||
timeout_seconds=30)
|
||||
timeout_seconds=timeout_seconds)
|
||||
|
||||
for response in cls.routerstub.SendPaymentV2(request,
|
||||
metadata=[("macaroon",
|
||||
|
@ -78,12 +78,14 @@ def follow_send_payment(hash):
|
||||
lnpayment.num_satoshis *
|
||||
float(config("PROPORTIONAL_ROUTING_FEE_LIMIT")),
|
||||
float(config("MIN_FLAT_ROUTING_FEE_LIMIT")),
|
||||
)) # 200 ppm or 10 sats
|
||||
)) # 1000 ppm or 10 sats
|
||||
timeout_seconds = int(config("REWARRDS_TIMEOUT_SECONDS"))
|
||||
|
||||
request = LNNode.routerrpc.SendPaymentRequest(
|
||||
payment_request=lnpayment.invoice,
|
||||
fee_limit_sat=fee_limit_sat,
|
||||
timeout_seconds=60,
|
||||
) # time out payment in 60 seconds
|
||||
timeout_seconds=timeout_seconds,
|
||||
)
|
||||
|
||||
order = lnpayment.order_paid
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user