forked from farhad2161/Randbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
48 lines (36 loc) · 1.47 KB
/
main.py
File metadata and controls
48 lines (36 loc) · 1.47 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import threading
import bitlib
def run(name):
print("{} started!".format(name))
while True:
private_key = bitlib.BitGen.generate_private_key()
wif = bitlib.BitGen.private2wif(private_key)
address = bitlib.BitGen.private2address(private_key)
balance = bitnet.get_balance(address)
message = "private:{},wif:{},address:{},balance:{}".format(
private_key, wif, address, balance)
if bitconf.log:
log_message = "{},{}".format(name, message)
print(log_message)
bitlog.log(log_message)
if balance.isdigit() == False:
print(balance)
continue
if balance != "0":
f = open("success.txt", "a")
f.write(message + "\n")
f.close()
print(message)
bitmail.send_email("Found", message)
if __name__ == '__main__':
bitconf = bitlib.BitConf()
bitconf.load()
bitmail = bitlib.BitMail(bitconf.smtp_host, bitconf.smtp_port, bitconf.smtp_username, bitconf.smtp_password,
bitconf.smtp_mail_from, bitconf.smtp_mail_to)
bitnet = bitlib.BitNet(bitconf.api_url, bitconf.http_proxy_url, bitconf.http_proxy_port)
bitlog = bitlib.BitLog()
bitmail.send_email("Started", "I am running")
for x in range(bitconf.thread_count):
thread_name = "Thread-{}".format(x + 1)
mythread = threading.Thread(target=run, args=(thread_name,))
mythread.start()