This repository was archived by the owner on May 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ def __str__(self):
63
63
def calc_difficulty (parent , timestamp ):
64
64
config = parent .config
65
65
offset = parent .difficulty // config ['BLOCK_DIFF_FACTOR' ]
66
- if parent .number >= (config ['HOMESTEAD_FORK_BLKNUM' ] - 1 ):
66
+ if parent .number >= (config ['METROPOLIS_FORK_BLKNUM' ] - 1 ):
67
+ sign = max (len (parent .uncles ) - ((timestamp - parent .timestamp ) // config ['METROPOLIS_DIFF_ADJUSTMENT_CUTOFF' ]), - 99 )
68
+ elif parent .number >= (config ['HOMESTEAD_FORK_BLKNUM' ] - 1 ):
67
69
sign = max (1 - ((timestamp - parent .timestamp ) // config ['HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF' ]), - 99 )
68
70
else :
69
71
sign = 1 if timestamp - parent .timestamp < config ['DIFF_ADJUSTMENT_CUTOFF' ] else - 1
Original file line number Diff line number Diff line change 54
54
METROPOLIS_BLOCKHASH_STORE = 0x20 ,
55
55
METROPOLIS_WRAPAROUND = 65536 ,
56
56
METROPOLIS_GETTER_CODE = decode_hex ('6000355460205260206020f3' ),
57
+ METROPOLIS_DIFF_ADJUSTMENT_CUTOFF = 9 ,
58
+ # Metropolis fork
57
59
)
58
60
assert default_config ['NEPHEW_REWARD' ] == \
59
61
default_config ['BLOCK_REWARD' ] // 32
You can’t perform that action at this time.
0 commit comments