Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions resources/scenarios/ln_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ def open_channel(self, ch, fee_rate):

channels = sorted(ch_by_block[target_block], key=lambda ch: ch["id"]["index"])
index = 0
fee_rate = 5006 # s/vB, decreases by 5 per tx for up to 1000 txs per block
fee_rate = 5006 # s/vB, decreases by 20 per tx for up to 250 txs per block
ch_threads = []
for ch in channels:
index += 1 # noqa
fee_rate -= 5
fee_rate -= 20
assert index == ch["id"]["index"], "Channel ID indexes are not consecutive"
assert fee_rate >= 1, "Too many TXs in block, out of fee range"
t = threading.Thread(target=open_channel, args=(self, ch, fee_rate))
Expand Down Expand Up @@ -311,7 +311,13 @@ def ln_all_chs(self, ln):

def update_policy(self, ln, txid_hex, policy, capacity):
self.log.info(f"Sending update from {ln.name} for channel with outpoint: {txid_hex}:0")
res = ln.update(txid_hex, policy, capacity)
res = None
while res is None:
try:
res = ln.update(txid_hex, policy, capacity)
break
except Exception:
sleep(1)
assert len(res["failed_updates"]) == 0, (
f" Failed updates: {res['failed_updates']}\n txid: {txid_hex}\n policy:{policy}"
)
Expand Down
2 changes: 1 addition & 1 deletion src/warnet/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def _import_network(graph_file_path, output_path):
}
tanks[source]["lnd"]["channels"].append(channel)
index += 1
if index > 1000:
if index > 250:
index = 1
block += 1
count += 1
Expand Down