changes to commands

This commit is contained in:
Evan Duffield 2014-04-11 11:10:10 -07:00
parent 9be9626366
commit 9f94fec86b

View File

@ -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"