Browse Source

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

The MMGen Project 3 years ago
parent
commit
4dc9b38041
1 changed files with 8 additions and 0 deletions
  1. 8 0
      mmgen/daemon.py

+ 8 - 0
mmgen/daemon.py

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