Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions resources/scenarios/ln_framework/ln.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def get(self, uri):
)
return self.conn.getresponse().read().decode("utf8")

def post(self, uri, data):
def post(self, uri, data, wait_for_completion=True):
body = json.dumps(data)
post_header = self.headers
post_header["Content-Length"] = str(len(body))
Expand All @@ -330,8 +330,9 @@ def post(self, uri, data):
data = res.read(1)
if len(data) == 0:
break
else:
stream += data.decode("utf8")
if not wait_for_completion and data.decode("utf8") == "\n":
break
stream += data.decode("utf8")
except Exception:
break
return stream
Expand Down Expand Up @@ -405,7 +406,9 @@ def createinvoice(self, sats, label) -> str:

def payinvoice(self, payment_request) -> str:
response = self.post(
"/v1/channels/transaction-stream", data={"payment_request": payment_request}
"/v2/router/send",
data={"payment_request": payment_request, "fee_limit_sat": 2100000000},
wait_for_completion=False,
)
res = json.loads(response)
return res
Expand Down
Loading