ln: use START_INDEX instead of 2**48-1
This commit is contained in:
@@ -91,10 +91,10 @@ def create_test_channels(feerate=6000, local=None, remote=None):
|
||||
alice_seed = os.urandom(32)
|
||||
bob_seed = os.urandom(32)
|
||||
|
||||
alice_cur = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(alice_seed, 2**48 - 1), "big"))
|
||||
alice_next = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(alice_seed, 2**48 - 2), "big"))
|
||||
bob_cur = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(bob_seed, 2**48 - 1), "big"))
|
||||
bob_next = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(bob_seed, 2**48 - 2), "big"))
|
||||
alice_cur = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(alice_seed, lnutil.RevocationStore.START_INDEX), "big"))
|
||||
alice_next = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(alice_seed, lnutil.RevocationStore.START_INDEX - 1), "big"))
|
||||
bob_cur = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(bob_seed, lnutil.RevocationStore.START_INDEX), "big"))
|
||||
bob_next = lnutil.secret_to_pubkey(int.from_bytes(lnutil.get_per_commitment_secret_from_seed(bob_seed, lnutil.RevocationStore.START_INDEX - 1), "big"))
|
||||
|
||||
return \
|
||||
lnhtlc.HTLCStateMachine(
|
||||
|
||||
@@ -440,7 +440,7 @@ class TestLNUtil(unittest.TestCase):
|
||||
seed = bitcoin.sha256(b"shachaintest")
|
||||
consumer = RevocationStore()
|
||||
for i in range(10000):
|
||||
secret = get_per_commitment_secret_from_seed(seed, 2**48 - i - 1)
|
||||
secret = get_per_commitment_secret_from_seed(seed, RevocationStore.START_INDEX - i)
|
||||
try:
|
||||
consumer.add_next_entry(secret)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user