What changed, and why it matters
This commit changes only a Python type hint in the Lightning Network peer code. It replaces 'Awaitable' with 'Coroutine' in a function signature annotation to better match what asyncio.create_task expects. Type hints do not affect runtime behavior, so this cannot by itself introduce or fix a security vulnerability. It is a code-quality/correctness improvement for static analysis tools and developers.
No security action required. Treat as a normal code-quality/type-correctness patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In electrum/lnpeer.py, the return-type annotation for a callback was changed from Callable[[], Awaitable[None]] to Callable[[], Coroutine[Any, Any, None]]. The accompanying commit message explains that asyncio.create_task requires a Coroutine rather than an arbitrary Awaitable. This is purely a typing change: no runtime logic, control flow, or data handling was modified. The diff shows only the import line and the type annotation changed (+2/-2 lines).
Changed components
electrum/lnpeer.py type annotationsInspect captured patch +2 / −2
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py
index 39a17db..9c2731c 100644
--- a/electrum/lnpeer.py
+++ b/electrum/lnpeer.py
@@ -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:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.