Skip to content
Snippets Groups Projects
Unverified Commit c0f8c901 authored by Benjamin Loison's avatar Benjamin Loison
Browse files

Add `KEEPING_ALL_BLOCKS_SINCE_LAST_M_HIGHER_BLOCKS` switch

parent e4ce1730
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ import config
# Bitcoin parameters
κ = 256
KEEPING_ALL_BLOCKS_SINCE_LAST_M_HIGHER_BLOCKS = True
# Minimal target difference
sanityTargetDifferenceThreshold = 0.03408116026637664
......@@ -30,9 +32,19 @@ def Dissolve(m, k, C, previous_score, previous_ℓ):
else:
CStar[CIndex].level_min -= 1
break
# TODO: add a switch for my interpretation
for μ in range( + 1):
D[μ] = uparrow(CStar, μ)
if KEEPING_ALL_BLOCKS_SINCE_LAST_M_HIGHER_BLOCKS:
D[] = uparrow(CStar, )
previousCStarμ = D[]
for μ in range( - 1, -1, -1):
b = previousCStarμ[-m]
CStarμ = uparrow(CStar, μ)
CStarμSinceb = [block for block in CStarμ if block.height >= b.height]
chains = {chainsIndex: chain for chainsIndex, chain in enumerate([CStarμ[-2 * m:], CStarμSinceb])}
D[μ] = U(chains)
previousCStarμ = CStarμ
else:
for μ in range( + 1):
D[μ] = uparrow(CStar, μ)
else:
= 0
D[0] = CStar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment