@@ -1438,7 +1438,7 @@ async def settle_hold_invoice(self, preimage: str, wallet: Abstract_Wallet = Non
14381438 assert payment_hash in wallet .lnworker .payment_info , \
14391439 f"Couldn't find lightning invoice for { payment_hash = } "
14401440 assert payment_hash in wallet .lnworker .dont_settle_htlcs , f"Invoice { payment_hash = } not a hold invoice?"
1441- assert wallet .lnworker .is_accepted_mpp (bfh (payment_hash )), \
1441+ assert wallet .lnworker .is_complete_mpp (bfh (payment_hash )), \
14421442 f"MPP incomplete, cannot settle hold invoice { payment_hash } yet"
14431443 info : Optional ['PaymentInfo' ] = wallet .lnworker .get_payment_info (bfh (payment_hash ))
14441444 assert (wallet .lnworker .get_payment_mpp_amount_msat (bfh (payment_hash )) or 0 ) >= (info .amount_msat or 0 )
@@ -1465,7 +1465,7 @@ async def cancel_hold_invoice(self, payment_hash: str, wallet: Abstract_Wallet =
14651465 wallet .lnworker .set_payment_status (bfh (payment_hash ), PR_UNPAID )
14661466 wallet .lnworker .delete_payment_info (payment_hash )
14671467 wallet .set_label (payment_hash , None )
1468- while wallet .lnworker .is_accepted_mpp (bfh (payment_hash )):
1468+ while wallet .lnworker .is_complete_mpp (bfh (payment_hash )):
14691469 # wait until the htlcs got failed so the payment won't get settled accidentally in a race
14701470 await asyncio .sleep (0.1 )
14711471 del wallet .lnworker .dont_settle_htlcs [payment_hash ]
@@ -1490,18 +1490,18 @@ async def check_hold_invoice(self, payment_hash: str, wallet: Abstract_Wallet =
14901490 """
14911491 assert len (payment_hash ) == 64 , f"Invalid payment_hash length: { len (payment_hash )} != 64"
14921492 info : Optional ['PaymentInfo' ] = wallet .lnworker .get_payment_info (bfh (payment_hash ))
1493- is_accepted_mpp : bool = wallet .lnworker .is_accepted_mpp (bfh (payment_hash ))
1493+ is_complete_mpp : bool = wallet .lnworker .is_complete_mpp (bfh (payment_hash ))
14941494 amount_sat = (wallet .lnworker .get_payment_mpp_amount_msat (bfh (payment_hash )) or 0 ) // 1000
14951495 result = {
14961496 "status" : "unknown" ,
14971497 "received_amount_sat" : amount_sat ,
14981498 }
14991499 if info is None :
15001500 pass
1501- elif not is_accepted_mpp and not wallet .lnworker .get_preimage_hex (payment_hash ):
1502- # is_accepted_mpp is False for settled payments
1501+ elif not is_complete_mpp and not wallet .lnworker .get_preimage_hex (payment_hash ):
1502+ # is_complete_mpp is False for settled payments
15031503 result ["status" ] = "unpaid"
1504- elif is_accepted_mpp and payment_hash in wallet .lnworker .dont_settle_htlcs :
1504+ elif is_complete_mpp and payment_hash in wallet .lnworker .dont_settle_htlcs :
15051505 result ["status" ] = "paid"
15061506 payment_key : str = wallet .lnworker ._get_payment_key (bfh (payment_hash )).hex ()
15071507 htlc_status = wallet .lnworker .received_mpp_htlcs [payment_key ]
0 commit comments