1
0

channel_db: add TTLs to channel_updates_for_private_channels

eclair sends CHANNEL_DISABLED if its peer is offline. E.g. we might be
trying to pay a mobile phone with the app closed. In that case we
should not cache the CHANNEL_DISABLED for too long.
This commit is contained in:
SomberNight
2023-08-15 16:33:24 +00:00
parent 1dd0608718
commit 98ccad68c1
4 changed files with 59 additions and 17 deletions

View File

@@ -25,7 +25,7 @@
import io
import hashlib
from typing import Sequence, List, Tuple, NamedTuple, TYPE_CHECKING, Dict, Any, Optional
from typing import Sequence, List, Tuple, NamedTuple, TYPE_CHECKING, Dict, Any, Optional, Union
from enum import IntEnum
from . import ecc
@@ -356,7 +356,7 @@ class FailedToDecodeOnionError(Exception): pass
class OnionRoutingFailure(Exception):
def __init__(self, code: int, data: bytes):
def __init__(self, code: Union[int, 'OnionFailureCode'], data: bytes):
self.code = code
self.data = data