Browse Source

XMR autosign offline: check daemon socket, skip wallet refresh

The MMGen Project 1 year ago
parent
commit
30494b8aff
3 changed files with 7 additions and 7 deletions
  1. 4 4
      mmgen/autosign.py
  2. 1 1
      mmgen/data/version
  3. 2 2
      mmgen/xmrwallet.py

+ 4 - 4
mmgen/autosign.py

@@ -128,10 +128,10 @@ class Signable:
 
 	class xmr_signable(transaction): # virtual class
 
-		def need_daemon_restart(self,new_idx):
+		def need_daemon_restart(self,m,new_idx):
 			old_idx = self.parent.xmr_cur_wallet_idx
 			self.parent.xmr_cur_wallet_idx = new_idx
-			return old_idx != new_idx
+			return old_idx != new_idx or m.wd.state != 'ready'
 
 		def print_summary(self,signables):
 			bmsg('\nAutosign summary:')
@@ -154,7 +154,7 @@ class Signable:
 					wallets = str(tx1.src_wallet_idx),
 					spec    = None ),
 			)
-			tx2 = await m.main( f, restart_daemon=self.need_daemon_restart(tx1.src_wallet_idx) )
+			tx2 = await m.main( f, restart_daemon=self.need_daemon_restart(m,tx1.src_wallet_idx) )
 			tx2.write(ask_write=False)
 			return tx2
 
@@ -176,7 +176,7 @@ class Signable:
 					wallets = str(wallet_idx),
 					spec    = None ),
 			)
-			obj = await m.main( f, wallet_idx, restart_daemon=self.need_daemon_restart(wallet_idx) )
+			obj = await m.main( f, wallet_idx, restart_daemon=self.need_daemon_restart(m,wallet_idx) )
 			obj.write()
 			return obj
 

+ 1 - 1
mmgen/data/version

@@ -1 +1 @@
-13.3.dev52
+13.3.dev53

+ 2 - 2
mmgen/xmrwallet.py

@@ -1642,7 +1642,7 @@ class MoneroWalletOps:
 			h = self.rpc(self,self.addr_data[0])
 			self.head_msg(tx.src_wallet_idx,h.fn)
 			if restart_daemon:
-				h.open_wallet()
+				h.open_wallet(refresh=False)
 			res = self.c.call(
 				'sign_transfer',
 				unsigned_txset = tx.data.unsigned_txset,
@@ -1831,7 +1831,7 @@ class MoneroWalletOps:
 			h = self.rpc(self,self.addr_data[0])
 			self.head_msg(wallet_idx,fn)
 			if restart_daemon:
-				h.open_wallet()
+				h.open_wallet(refresh=False)
 			m = MoneroWalletOutputsFile.Unsigned(
 				parent = self,
 				fn     = fn )