daemon.py: restrict start() and stop() methods to test suite and regtest

This commit is contained in:
The MMGen Project 2021-10-05 11:57:33 +00:00
commit 4dc9b38041
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -441,6 +441,14 @@ class CoinDaemon(Daemon):
+ self.shared_args
+ list(cmds) )
def start(self,*args,**kwargs):
assert self.test_suite or self.network == 'regtest', 'start() restricted to test suite and regtest'
return super().start(*args,**kwargs)
def stop(self,*args,**kwargs):
assert self.test_suite or self.network == 'regtest', 'stop() restricted to test suite and regtest'
return super().stop(*args,**kwargs)
def pre_start(self):
os.makedirs(self.datadir,exist_ok=True)