fix holdinvoice always having 0 deadline

This commit is contained in:
daywalker90 2026-08-09 16:46:14 +02:00
parent 2fcc48ce34
commit 102de7345d
2 changed files with 7 additions and 1 deletions

View file

@ -538,7 +538,7 @@ pub async fn holdinvoice_accepted_handler(
let payment_hash_hash = Sha256::from_str(&payment_hash_str)?;
let mut lowest_htlc_expiry = 0;
let mut lowest_htlc_expiry = u32::MAX;
for peer in list_peer_channels {
if let Some(htlcs) = peer.htlcs {

View file

@ -1376,6 +1376,8 @@ async def test_hold_invoice(
assert lookup_hold.state.name == "PENDING"
assert lookup_hold.settled_at is None
getinfo = l2.rpc.getinfo()
(responses2, _res) = await fetch_event_responses(
client,
client_pubkey,
@ -1394,6 +1396,10 @@ async def test_hold_invoice(
if content["notification_type"] == "hold_invoice_accepted":
hold_events.append(content)
assert content["notification"]["payment_hash"] == payment_hash
assert len(hold_events) == 1
assert (
hold_events[0]["notification"]["settle_deadline"] > getinfo["blockheight"] + 1
)
lookup_hold = await nwc.lookup_invoice(
LookupInvoiceRequest(