Skip to content

Instantly share code, notes, and snippets.

@cdecker
Created September 23, 2017 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdecker/50244338b558aea7523270afd20e642a to your computer and use it in GitHub Desktop.
Save cdecker/50244338b558aea7523270afd20e642a to your computer and use it in GitHub Desktop.
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