add lnchannel.can_send_ctx_updates. just drop illegal updates for now
This commit is contained in:
@@ -157,13 +157,12 @@ def create_test_channels(feerate=6000, local=None, remote=None):
|
||||
alice_second = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(alice_seed, lnutil.RevocationStore.START_INDEX - 1), "big"))
|
||||
bob_second = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(bob_seed, lnutil.RevocationStore.START_INDEX - 1), "big"))
|
||||
|
||||
alice.config[REMOTE].next_per_commitment_point = bob_second
|
||||
alice.config[REMOTE].current_per_commitment_point = bob_first
|
||||
bob.config[REMOTE].next_per_commitment_point = alice_second
|
||||
bob.config[REMOTE].current_per_commitment_point = alice_first
|
||||
alice.open_with_first_pcp(bob_first, sig_from_bob)
|
||||
bob.open_with_first_pcp(alice_first, sig_from_alice)
|
||||
|
||||
alice.hm.channel_open_finished()
|
||||
bob.hm.channel_open_finished()
|
||||
# from funding_locked:
|
||||
alice.config[REMOTE].next_per_commitment_point = bob_second
|
||||
bob.config[REMOTE].next_per_commitment_point = alice_second
|
||||
|
||||
# TODO: sweep_address in lnchannel.py should use static_remotekey
|
||||
alice.sweep_address = bitcoin.pubkey_to_address('p2wpkh', alice.config[LOCAL].payment_basepoint.pubkey.hex())
|
||||
|
||||
@@ -225,6 +225,8 @@ class TestPeer(ElectrumTestCase):
|
||||
def test_reestablish(self):
|
||||
alice_channel, bob_channel = create_test_channels()
|
||||
p1, p2, w1, w2, _q1, _q2 = self.prepare_peers(alice_channel, bob_channel)
|
||||
for chan in (alice_channel, bob_channel):
|
||||
chan.peer_state = peer_states.DISCONNECTED
|
||||
async def reestablish():
|
||||
await asyncio.gather(
|
||||
p1.reestablish_channel(alice_channel),
|
||||
@@ -254,6 +256,8 @@ class TestPeer(ElectrumTestCase):
|
||||
run(f())
|
||||
|
||||
p1, p2, w1, w2, _q1, _q2 = self.prepare_peers(alice_channel_0, bob_channel)
|
||||
for chan in (alice_channel_0, bob_channel):
|
||||
chan.peer_state = peer_states.DISCONNECTED
|
||||
async def reestablish():
|
||||
await asyncio.gather(
|
||||
p1.reestablish_channel(alice_channel_0),
|
||||
|
||||
Reference in New Issue
Block a user