fix: use remote_per_commitment_point
This commit is contained in:
parent
205cd259fd
commit
f4c7702c0a
@ -684,6 +684,7 @@ class Peer(PrintError):
|
|||||||
payload = await self.channel_accepted[temp_channel_id]
|
payload = await self.channel_accepted[temp_channel_id]
|
||||||
finally:
|
finally:
|
||||||
del self.channel_accepted[temp_channel_id]
|
del self.channel_accepted[temp_channel_id]
|
||||||
|
remote_per_commitment_point = payload['first_per_commitment_point']
|
||||||
remote_funding_pubkey = payload["funding_pubkey"]
|
remote_funding_pubkey = payload["funding_pubkey"]
|
||||||
pubkeys = sorted([bh2u(funding_pubkey), bh2u(remote_funding_pubkey)])
|
pubkeys = sorted([bh2u(funding_pubkey), bh2u(remote_funding_pubkey)])
|
||||||
redeem_script = transaction.multisig_script(pubkeys, 2)
|
redeem_script = transaction.multisig_script(pubkeys, 2)
|
||||||
@ -699,13 +700,12 @@ class Peer(PrintError):
|
|||||||
self.print_error('revocation_pubkey', binascii.hexlify(revocation_pubkey))
|
self.print_error('revocation_pubkey', binascii.hexlify(revocation_pubkey))
|
||||||
local_delayedpubkey = derive_pubkey(delayed_payment_basepoint, per_commitment_point)
|
local_delayedpubkey = derive_pubkey(delayed_payment_basepoint, per_commitment_point)
|
||||||
self.print_error('local_delayedpubkey', binascii.hexlify(local_delayedpubkey))
|
self.print_error('local_delayedpubkey', binascii.hexlify(local_delayedpubkey))
|
||||||
remotepubkey = derive_pubkey(remote_payment_basepoint, per_commitment_point)
|
remotepubkey = derive_pubkey(remote_payment_basepoint, remote_per_commitment_point)
|
||||||
self.print_error('remotepubkey', binascii.hexlify(remotepubkey))
|
self.print_error('remotepubkey', binascii.hexlify(remotepubkey))
|
||||||
ctn = 0
|
ctn = 0
|
||||||
c_tx = make_commitment(
|
c_tx = make_commitment(
|
||||||
ctn,
|
ctn,
|
||||||
funding_pubkey, remote_funding_pubkey,
|
funding_pubkey, remote_funding_pubkey, remotepubkey,
|
||||||
remotepubkey,
|
|
||||||
base_point, remote_payment_basepoint,
|
base_point, remote_payment_basepoint,
|
||||||
revocation_pubkey, local_delayedpubkey,
|
revocation_pubkey, local_delayedpubkey,
|
||||||
funding_tx.txid(), funding_index, funding_satoshis,
|
funding_tx.txid(), funding_index, funding_satoshis,
|
||||||
|
|||||||
@ -175,6 +175,7 @@ class Test_LNBase(unittest.TestCase):
|
|||||||
# BOLT3, Appendix E
|
# BOLT3, Appendix E
|
||||||
base_secret = 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
base_secret = 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||||
per_commitment_secret = 0x1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
|
per_commitment_secret = 0x1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
|
||||||
|
revocation_basepoint_secret = 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||||
base_point = secret_to_pubkey(base_secret)
|
base_point = secret_to_pubkey(base_secret)
|
||||||
self.assertEqual(base_point, bfh('036d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e2'))
|
self.assertEqual(base_point, bfh('036d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e2'))
|
||||||
per_commitment_point = secret_to_pubkey(per_commitment_secret)
|
per_commitment_point = secret_to_pubkey(per_commitment_secret)
|
||||||
@ -183,7 +184,6 @@ class Test_LNBase(unittest.TestCase):
|
|||||||
self.assertEqual(localpubkey, bfh('0235f2dbfaa89b57ec7b055afe29849ef7ddfeb1cefdb9ebdc43f5494984db29e5'))
|
self.assertEqual(localpubkey, bfh('0235f2dbfaa89b57ec7b055afe29849ef7ddfeb1cefdb9ebdc43f5494984db29e5'))
|
||||||
localprivkey = derive_privkey(base_secret, per_commitment_point)
|
localprivkey = derive_privkey(base_secret, per_commitment_point)
|
||||||
self.assertEqual(localprivkey, 0xcbced912d3b21bf196a766651e436aff192362621ce317704ea2f75d87e7be0f)
|
self.assertEqual(localprivkey, 0xcbced912d3b21bf196a766651e436aff192362621ce317704ea2f75d87e7be0f)
|
||||||
revocation_basepoint_secret = 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
|
||||||
revocation_basepoint = secret_to_pubkey(revocation_basepoint_secret)
|
revocation_basepoint = secret_to_pubkey(revocation_basepoint_secret)
|
||||||
self.assertEqual(revocation_basepoint, bfh('036d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e2'))
|
self.assertEqual(revocation_basepoint, bfh('036d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e2'))
|
||||||
revocationpubkey = derive_blinded_pubkey(revocation_basepoint, per_commitment_point)
|
revocationpubkey = derive_blinded_pubkey(revocation_basepoint, per_commitment_point)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user