-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfullscan.py
38 lines (33 loc) · 1.02 KB
/
fullscan.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
32
33
34
35
36
37
38
#!/usr/bin/python3
from utils import *
import threading
from dataclasses import dataclass
height = get_height()
remaining = height - ringct_start
threads = 4
split = int(remaining / threads)
class ScanThread (threading.Thread):
def __init__(self, start_height):
threading.Thread.__init__(self)
self.start_height = start_height
def run(self):
scan_blocks(self.start_height)
def scan_blocks(start_height):
end_height = start_height + split
current_height = start_height
while current_height < end_height:
block = get_block_by_height(current_height)
record_any_transactions(block)
current_height += 1
print("End thread.")
print("Monero Decoy Scanner (MDS) v" + version)
print("Starting scan...")
current_thread = 0
while current_thread < threads:
try:
start_height = ringct_start + (split * current_thread)
scan_thread = ScanThread(start_height)
scan_thread.start()
except:
print("Error: unable to start thread")
current_thread += 1