1
0

create class for ShortChannelID and use it

This commit is contained in:
SomberNight
2019-09-06 18:09:05 +02:00
parent 251db638af
commit 509df9ddaf
8 changed files with 110 additions and 76 deletions

View File

@@ -32,7 +32,8 @@ from Cryptodome.Cipher import ChaCha20
from . import ecc
from .crypto import sha256, hmac_oneshot
from .util import bh2u, profiler, xor_bytes, bfh
from .lnutil import get_ecdh, PaymentFailure, NUM_MAX_HOPS_IN_PAYMENT_PATH, NUM_MAX_EDGES_IN_PAYMENT_PATH
from .lnutil import (get_ecdh, PaymentFailure, NUM_MAX_HOPS_IN_PAYMENT_PATH,
NUM_MAX_EDGES_IN_PAYMENT_PATH, ShortChannelID)
if TYPE_CHECKING:
from .lnrouter import RouteEdge
@@ -51,7 +52,7 @@ class InvalidOnionMac(Exception): pass
class OnionPerHop:
def __init__(self, short_channel_id: bytes, amt_to_forward: bytes, outgoing_cltv_value: bytes):
self.short_channel_id = short_channel_id
self.short_channel_id = ShortChannelID(short_channel_id)
self.amt_to_forward = amt_to_forward
self.outgoing_cltv_value = outgoing_cltv_value