Update ice age
This commit is contained in:
parent
ac89506000
commit
43ebb25299
12
iceage.py
12
iceage.py
|
@ -1,12 +1,12 @@
|
||||||
import random
|
import random
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
diffs = [343.14 * 10**12]
|
diffs = [453.71 * 10**12]
|
||||||
hashpower = diffs[0] / 15
|
hashpower = diffs[0] / 15.73
|
||||||
times = [1493974999]
|
times = [1495425834]
|
||||||
|
|
||||||
|
|
||||||
for i in range(3653829, 6010000):
|
for i in range(3746966, 6010000):
|
||||||
blocktime = random.expovariate(hashpower / diffs[-1])
|
blocktime = random.expovariate(hashpower / diffs[-1])
|
||||||
adjfac = max(1 - int(blocktime / 10), -99) / 2048.
|
adjfac = max(1 - int(blocktime / 10), -99) / 2048.
|
||||||
newdiff = diffs[-1] * (1 + adjfac)
|
newdiff = diffs[-1] * (1 + adjfac)
|
||||||
|
@ -15,6 +15,6 @@ for i in range(3653829, 6010000):
|
||||||
diffs.append(newdiff)
|
diffs.append(newdiff)
|
||||||
times.append(times[-1] + blocktime)
|
times.append(times[-1] + blocktime)
|
||||||
if i % 10000 == 0:
|
if i % 10000 == 0:
|
||||||
print 'Block %d, approx ETH supply %d, time %r blocktime %.2f' % \
|
print('Block %d, approx ETH supply %d, time %r blocktime %.2f' % \
|
||||||
(i, 60102216 * 1.199 + 5.3 * i, datetime.datetime.utcfromtimestamp(times[-1]).isoformat().replace('T',' '), diffs[-1] / hashpower)
|
(i, 60102216 * 1.199 + 5.3 * i, datetime.datetime.utcfromtimestamp(times[-1]).isoformat().replace('T',' '), diffs[-1] / hashpower))
|
||||||
# print int(adjfac * 2048)
|
# print int(adjfac * 2048)
|
||||||
|
|
|
@ -41,9 +41,11 @@ def test_strat(strat, hashpower, gamma, reward, fees, uncle_rewards=1, uncle_coe
|
||||||
if me_blocks >= len(strat) or them_blocks >= len(strat[me_blocks]) or strat[me_blocks][them_blocks] == 1:
|
if me_blocks >= len(strat) or them_blocks >= len(strat[me_blocks]) or strat[me_blocks][them_blocks] == 1:
|
||||||
# Override
|
# Override
|
||||||
if me_blocks > them_blocks or (me_blocks == them_blocks and random.random() < gamma):
|
if me_blocks > them_blocks or (me_blocks == them_blocks and random.random() < gamma):
|
||||||
me_reward += me_blocks * reward - (reward if me_blocks and them_blocks else 0)
|
# me_reward += me_blocks * reward - (reward if me_blocks and them_blocks else 0)
|
||||||
|
me_reward += me_blocks * reward
|
||||||
me_fees += time_elapsed * fees
|
me_fees += time_elapsed * fees
|
||||||
divisor += me_blocks - (1 if me_blocks and them_blocks else 0)
|
# divisor += me_blocks - (1 if me_blocks and them_blocks else 0)
|
||||||
|
divisor += me_blocks
|
||||||
me_totblocks += me_blocks
|
me_totblocks += me_blocks
|
||||||
# Add uncles
|
# Add uncles
|
||||||
while me_blocks < 7 and them_blocks > 0:
|
while me_blocks < 7 and them_blocks > 0:
|
||||||
|
@ -55,9 +57,11 @@ def test_strat(strat, hashpower, gamma, reward, fees, uncle_rewards=1, uncle_coe
|
||||||
me_blocks += 1
|
me_blocks += 1
|
||||||
# Adopt
|
# Adopt
|
||||||
else:
|
else:
|
||||||
them_reward += them_blocks * reward - (reward if me_blocks and them_blocks else 0)
|
# them_reward += them_blocks * reward - (reward if me_blocks and them_blocks else 0)
|
||||||
|
them_reward += them_blocks * reward
|
||||||
them_fees += time_elapsed * fees
|
them_fees += time_elapsed * fees
|
||||||
divisor += them_blocks - (1 if me_blocks and them_blocks else 0)
|
# divisor += them_blocks - (1 if me_blocks and them_blocks else 0)
|
||||||
|
divisor += them_blocks
|
||||||
them_totblocks += them_blocks
|
them_totblocks += them_blocks
|
||||||
# Add uncles
|
# Add uncles
|
||||||
while them_blocks < 7 and me_blocks > 0:
|
while them_blocks < 7 and me_blocks > 0:
|
||||||
|
@ -73,9 +77,11 @@ def test_strat(strat, hashpower, gamma, reward, fees, uncle_rewards=1, uncle_coe
|
||||||
# Match
|
# Match
|
||||||
elif strat[me_blocks][them_blocks] == 2 and not last_is_me:
|
elif strat[me_blocks][them_blocks] == 2 and not last_is_me:
|
||||||
if random.random() < gamma:
|
if random.random() < gamma:
|
||||||
me_reward += me_blocks * reward + time_elapsed * fees - (reward if me_blocks and them_blocks else 0)
|
# me_reward += me_blocks * reward + time_elapsed * fees - (reward if me_blocks and them_blocks else 0)
|
||||||
|
me_reward += me_blocks * reward
|
||||||
me_totblocks += me_blocks
|
me_totblocks += me_blocks
|
||||||
divisor += me_blocks - (1 if me_blocks and them_blocks else 0)
|
# divisor += me_blocks - (1 if me_blocks and them_blocks else 0)
|
||||||
|
divisor += me_blocks
|
||||||
time_elapsed = 0
|
time_elapsed = 0
|
||||||
# Add uncles
|
# Add uncles
|
||||||
while me_blocks < 7 and them_blocks > 0:
|
while me_blocks < 7 and them_blocks > 0:
|
||||||
|
|
Loading…
Reference in New Issue