Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ethereumAPI import EthereumAPI
- BLOCK_TARGET_NUMBER = 180000
- billion = 10**11
- bounds = []
- bounds.append(75 * billion)
- bounds.append(80 * billion)
- bounds.append(85 * billion)
- e = EthereumAPI()
- blocks_remaining = BLOCK_TARGET_NUMBER - int(e.number(),0)
- print blocks_remaining
- print int(e.blockByNumber(160000)["difficulty"],0)
- dif = float(int(e.blockByNumber(int(e.number(),0))["difficulty"],0))
- changes = []
- periods_back = 30
- divide_by = 10
- print blocks_remaining / divide_by
- for i in range(periods_back * divide_by):
- dif = int(e.blockByNumber(int(e.number(),0) - i * (blocks_remaining / divide_by))["difficulty"],0)
- dif_new = int(e.blockByNumber(int(e.number(),0) - i * (blocks_remaining / divide_by) - blocks_remaining)["difficulty"],0)
- changes.append(dif / float(dif_new))
- #dif = float(dif_new)
- changes.sort()
- #print changes
- dif = int(e.blockByNumber(int(e.number(),0))["difficulty"],0)
- last = 0
- for i in bounds:
- for j in range(len(changes)):
- if dif * changes[j] > i:
- print float(j)/len(changes) - last
- last = float(j)/len(changes)
- break;
- #print 0
- #last = 0
- print 1 - last
- #print 0.225 + 0.475 + 0.275 + 0.025
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement