-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnotherMiner.py
31 lines (27 loc) · 993 Bytes
/
AnotherMiner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#AnotherMiner
import Signatures
import Miner
import threading
import time
import TxBlock
my_ip='localhost'
wallets=[(my_ip,5006),(my_ip,5005)]
Miner.verbose = True
my_pr,my_pu = Signatures.generate_keys()
tMS = threading.Thread(target=Miner.minerServer, args=((my_ip,5007),))
tNF = threading.Thread(target=Miner.nonceFinder, args=(wallets, my_pu))
tMS.start()
time.sleep(4)
tNF.start()
time.sleep(20)
Miner.StopAll()
tMS.join()
tNF.join()
print(TxBlock.findLongestBlockchain(Miner.head_blocks)
.previousBlock.previousBlock.previousBlock.previousBlock.nonce)
print(TxBlock.findLongestBlockchain(Miner.head_blocks)
.previousBlock.previousBlock.previousBlock.nonce)
print(TxBlock.findLongestBlockchain(Miner.head_blocks)
.previousBlock.previousBlock.nonce)
print(TxBlock.findLongestBlockchain(Miner.head_blocks).previousBlock.nonce)
print(TxBlock.findLongestBlockchain(Miner.head_blocks).nonce)