-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
commit:b263400
lnd[1]<----> lnd[0]<---->fiber[0]<---->fiber[1]
fiber[1] send btc to lnd[1],but lnd[1] cancel the invoice ,cause pending TLC to get stuck in the fiber channel.
- invoice = lnd[1].addinvoice(800)
- btc_invoice = fiber1.send_btc(invoice)
- lnd[1].cancelinvoice(invoice)
- fiber2.send_payment(btc_invoice)
- fiber1[0].get_cch_order(btc_invoice)-> return failed
- fiber2.get_payment(btc_invoice) -> return Inflight
- fiber1.get_invoice(btc_invoice) -> return Received
- fiber1.cancel_invoice(btc_invoice) -> succ
- fiber1.get_invoice(btc_invoice) -> return canceled
- fiber2.get_payment(btc_invoice) -> return Inflight
pending TLC to get stuck in the channel.
lndInvoice = self.LNDs[1].addinvoice(800)
send_payment_response = self.fiber1.get_client().send_btc(
{
"btc_pay_req": lndInvoice["payment_request"],
"currency": "Fibd",
}
)
self.LNDs[1].ln_cli_with_cmd(f"cancelinvoice {lndInvoice['r_hash']}")
payment = self.fiber2.get_client().send_payment({
"invoice": send_payment_response['incoming_invoice']['Fiber']
})
time.sleep(1)
btc_invoice = self.fiber1.get_client().get_invoice({
'payment_hash':payment['payment_hash']
})
print("btc invoice:",btc_invoice)
cch_order = self.fiber1.get_client().get_cch_order({"payment_hash": payment["payment_hash"]})
print("cch order:",cch_order)
self.fiber1.get_client().cancel_invoice({
'payment_hash': payment['payment_hash']
})
time.sleep(10)
self.fiber2.get_client().get_payment({
"payment_hash":payment['payment_hash']
})
expected:
cancel invoiceshould be able to roll back the TLC.- when get_cch_order return failed ,the pending TLC will be rolled back automatically.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done