Created
September 23, 2017 13:59
-
-
Save cdecker/50244338b558aea7523270afd20e642a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tqdm import tqdm | |
from itertools import product | |
import math | |
NON_SEGWIT_SIZE = 1000000 | |
max_churn = 0 | |
best = (0, 0, 0) | |
for i, o in tqdm(product(range(1,10000), range(1,10000))): | |
txsize = 5 + i*41 + o*31 + 4 + (3 if i>253 else 1) + (3 if o>=253 else 1) | |
num_tx = math.floor(NON_SEGWIT_SIZE / txsize) | |
churn = num_tx*(i+o) | |
if churn > max_churn: | |
max_churn = churn | |
best = (i, o, num_tx) | |
print(best, max_churn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment