mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 17:55:20 +00:00
lnbase: try sending open_channel
This commit is contained in:
parent
94bc353731
commit
70f7c11ac5
1 changed files with 7 additions and 1 deletions
|
@ -49,6 +49,7 @@ def make_handler(k, v):
|
||||||
pos = 0
|
pos = 0
|
||||||
for fieldname in v["payload"]:
|
for fieldname in v["payload"]:
|
||||||
poslenMap = v["payload"][fieldname]
|
poslenMap = v["payload"][fieldname]
|
||||||
|
if "feature" in poslenMap: continue
|
||||||
#print(poslenMap["position"], ma)
|
#print(poslenMap["position"], ma)
|
||||||
assert pos == calcexp(poslenMap["position"], ma)
|
assert pos == calcexp(poslenMap["position"], ma)
|
||||||
length = poslenMap["length"]
|
length = poslenMap["length"]
|
||||||
|
@ -65,7 +66,7 @@ with open(path) as f:
|
||||||
|
|
||||||
for k in structured:
|
for k in structured:
|
||||||
v = structured[k]
|
v = structured[k]
|
||||||
if k in ["open_channel","final_incorrect_cltv_expiry", "final_incorrect_htlc_amount"]:
|
if k in ["final_incorrect_cltv_expiry", "final_incorrect_htlc_amount"]:
|
||||||
continue
|
continue
|
||||||
if len(v["payload"]) == 0:
|
if len(v["payload"]) == 0:
|
||||||
continue
|
continue
|
||||||
|
@ -94,6 +95,7 @@ def gen_msg(msg_type, **kwargs):
|
||||||
lengths = {}
|
lengths = {}
|
||||||
for k in typ["payload"]:
|
for k in typ["payload"]:
|
||||||
poslenMap = typ["payload"][k]
|
poslenMap = typ["payload"][k]
|
||||||
|
if "feature" in poslenMap: continue
|
||||||
leng = calcexp(poslenMap["length"], lengths)
|
leng = calcexp(poslenMap["length"], lengths)
|
||||||
try:
|
try:
|
||||||
clone = dict(lengths)
|
clone = dict(lengths)
|
||||||
|
@ -327,6 +329,10 @@ class Peer(PrintError):
|
||||||
self.process_message(msg)
|
self.process_message(msg)
|
||||||
# send init
|
# send init
|
||||||
self.send_message(gen_msg("init", gflen=0, lflen=0))
|
self.send_message(gen_msg("init", gflen=0, lflen=0))
|
||||||
|
|
||||||
|
msg = gen_msg("open_channel")
|
||||||
|
self.send_message(msg)
|
||||||
|
|
||||||
# loop
|
# loop
|
||||||
while True:
|
while True:
|
||||||
self.ping_if_required()
|
self.ping_if_required()
|
||||||
|
|
Loading…
Add table
Reference in a new issue