Browse Source
LNPeerAddr: nicer str formatting for IPv6 hosts
hard-fail-on-bad-server-string
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
4 additions and
1 deletions
-
electrum/lnutil.py
|
|
@ -8,6 +8,8 @@ from collections import namedtuple |
|
|
|
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set |
|
|
|
import re |
|
|
|
|
|
|
|
from aiorpcx import NetAddress |
|
|
|
|
|
|
|
from .util import bfh, bh2u, inv_dict, UserFacingException |
|
|
|
from .crypto import sha256 |
|
|
|
from .transaction import (Transaction, PartialTransaction, PartialTxInput, TxOutpoint, |
|
|
@ -662,7 +664,8 @@ class LNPeerAddr(NamedTuple): |
|
|
|
pubkey: bytes |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return '{}@{}:{}'.format(bh2u(self.pubkey), self.host, self.port) |
|
|
|
host_and_port = str(NetAddress(self.host, self.port)) |
|
|
|
return '{}@{}'.format(self.pubkey.hex(), host_and_port) |
|
|
|
|
|
|
|
|
|
|
|
def get_compressed_pubkey_from_bech32(bech32_pubkey: str) -> bytes: |
|
|
|