electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit ab9bf07a792bb2637201eed420158d71a9880c22
parent bf1d51695953297421dc7453835af10de9354ce3
Author: SomberNight <somber.night@protonmail.com>
Date:   Wed, 24 Feb 2021 16:46:59 +0100

(trivial) lnrouter: fix type of TrampolineEdge.short_channel_id

also, use keyword arguments inside attr.ib() as PyCharm was complaining

Diffstat:
Melectrum/lnrouter.py | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/electrum/lnrouter.py b/electrum/lnrouter.py @@ -99,17 +99,20 @@ class RouteEdge(PathEdge): features = LnFeatures(self.node_features) return features.supports(LnFeatures.VAR_ONION_OPT) - def is_trampoline(self): + def is_trampoline(self) -> bool: return False @attr.s class TrampolineEdge(RouteEdge): invoice_routing_info = attr.ib(type=bytes, default=None) invoice_features = attr.ib(type=int, default=None) - short_channel_id = attr.ib(0) + # this is re-defined from parent just to specify a default value: + short_channel_id = attr.ib(default=ShortChannelID(8), repr=lambda val: str(val)) + def is_trampoline(self): return True + LNPaymentPath = Sequence[PathEdge] LNPaymentRoute = Sequence[RouteEdge]