mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
changes to commands
This commit is contained in:
parent
9be9626366
commit
9f94fec86b
16
src/robo.py
16
src/robo.py
@ -10,31 +10,31 @@ restart_daemon = 0
|
||||
last_block = 0
|
||||
while True:
|
||||
amount = str(round(random()*10, 1))
|
||||
obj2 = json.loads(check_output(["./darkcoind", "getinfo"]).strip())
|
||||
obj = json.loads(check_output(["./darkcoind", "getpoolinfo"]).strip())
|
||||
obj2 = json.loads(check_output(["./darkcoind", "-datadir=datadir2", "getinfo"]).strip())
|
||||
obj = json.loads(check_output(["./darkcoind", "-datadir=datadir2", "getpoolinfo"]).strip())
|
||||
|
||||
print obj
|
||||
print obj2['blocks'], obj['masternode']
|
||||
|
||||
if last_block != obj2['blocks']:
|
||||
print "subscribe to masternode"
|
||||
check_output(["./darkcoind", "darksendsub"])
|
||||
check_output(["./darkcoind", "-datadir=datadir2", "darksendsub"])
|
||||
last_block = obj2['blocks']
|
||||
|
||||
if obj['entries'] > 0:
|
||||
if obj['entries'] > 0 and obj['state'] == 2:
|
||||
amount = round((random()*10), 3)
|
||||
addr = check_output(["./darkcoind", "getaccountaddress", str(address_current)]).strip()
|
||||
addr = check_output(["./darkcoind", "-datadir=datadir2", "getaccountaddress", str(address_current)]).strip()
|
||||
address_current += 1
|
||||
print "Pool is active, sending %s to %s" % (amount, addr)
|
||||
call(["./darkcoind", "darksend", addr, str(amount)])
|
||||
call(["./darkcoind", "-datadir=datadir2", "darksend", addr, str(amount)])
|
||||
restart_daemon += 1
|
||||
|
||||
if restart_daemon >= 15:
|
||||
print "Restarting daemon"
|
||||
sleep(10)
|
||||
call(["./darkcoind", "stop"])
|
||||
call(["./darkcoind", "-datadir=datadir2", "stop"])
|
||||
sleep(10)
|
||||
call(["./darkcoind", "-daemon"])
|
||||
call(["./darkcoind", "-datadir=datadir2", "-daemon"])
|
||||
sleep(60)
|
||||
restart_daemon = 0
|
||||
print "Restarted"
|
||||
|
Loading…
Reference in New Issue
Block a user