1
0

lnpeer: fix callback type hint

asyncio.create_task expects a Coroutine, not all Awaitables are
Coroutines.
This commit is contained in:
f321x
2025-12-19 14:55:40 +01:00
parent ff61596598
commit 14977e4cee

View File

@@ -8,7 +8,7 @@ from collections import OrderedDict, defaultdict
import asyncio
import os
import time
from typing import Tuple, Dict, TYPE_CHECKING, Optional, Union, Set, Callable, Awaitable, List
from typing import Tuple, Dict, TYPE_CHECKING, Optional, Union, Set, Callable, Coroutine, List, Any
from datetime import datetime
import functools
from functools import partial
@@ -2972,7 +2972,7 @@ class Peer(Logger, EventListener):
) -> Tuple[
Optional[Union[OnionRoutingFailure, OnionFailureCode, bytes]], # error types used to fail the set
Optional[bytes], # preimage to settle the set
Optional[Callable[[], Awaitable[None]]], # callback
Optional[Callable[[], Coroutine[Any, Any, None]]], # callback
]:
"""
Returns what to do next with the given set of htlcs: