Browse Source

rpc_init(): skip tw initialization where possible

The MMGen Project 1 year ago
parent
commit
dce9e25919

+ 1 - 1
examples/coin-daemon-info.py

@@ -45,7 +45,7 @@ from mmgen.util import make_timestr
 
 async def get_rpc(cfg):
 	try:
-		return await rpc_init(cfg)
+		return await rpc_init( cfg, ignore_wallet=True )
 	except SocketError as e:
 		return False
 

+ 1 - 1
examples/halving-calculator.py

@@ -59,7 +59,7 @@ async def main():
 	proto = cfg._proto
 
 	from mmgen.rpc import rpc_init
-	c = await rpc_init(cfg,proto)
+	c = await rpc_init( cfg, proto, ignore_wallet=True )
 
 	tip = await c.call('getblockcount')
 	assert tip > 1, 'block tip must be > 1'

+ 1 - 1
examples/whitepaper.py

@@ -25,7 +25,7 @@ async def main():
 
 	assert cfg.coin == 'BTC' and cfg.network == 'mainnet', 'This script works only on BTC mainnet!'
 
-	c = await rpc_init(cfg)
+	c = await rpc_init( cfg, ignore_wallet=True )
 
 	tx = await c.call('getrawtransaction',txid,True)
 

+ 2 - 2
mmgen/autosign.py

@@ -79,7 +79,7 @@ class Signable:
 			tx1 = UnsignedTX( cfg=self.cfg, filename=f )
 			if tx1.proto.sign_mode == 'daemon':
 				from .rpc import rpc_init
-				tx1.rpc = await rpc_init( self.cfg, tx1.proto )
+				tx1.rpc = await rpc_init( self.cfg, tx1.proto, ignore_wallet=True )
 			from .tx.sign import txsign
 			tx2 = await txsign( self.cfg, tx1, self.parent.wallet_files[:], None, None )
 			if tx2:
@@ -293,7 +293,7 @@ class Autosign:
 				from .rpc import rpc_init
 				from .exception import SocketError
 				try:
-					await rpc_init( self.cfg, proto )
+					await rpc_init( self.cfg, proto, ignore_wallet=True )
 				except SocketError as e:
 					from .daemon import CoinDaemon
 					d = CoinDaemon( self.cfg, proto=proto, test_suite=self.cfg.test_suite )

+ 1 - 1
mmgen/main_txsign.py

@@ -137,7 +137,7 @@ async def main():
 
 		if tx1.proto.sign_mode == 'daemon':
 			from .rpc import rpc_init
-			tx1.rpc = await rpc_init(cfg,tx1.proto)
+			tx1.rpc = await rpc_init( cfg, tx1.proto, ignore_wallet=True )
 
 		if cfg.tx_id:
 			msg(tx1.txid)

+ 2 - 2
mmgen/msg.py

@@ -251,7 +251,7 @@ class coin_msg:
 
 			if self.proto.sign_mode == 'daemon':
 				from .rpc import rpc_init
-				self.rpc = await rpc_init(self.cfg,self.proto)
+				self.rpc = await rpc_init( self.cfg, self.proto, ignore_wallet=True )
 
 			from .wallet import Wallet
 			from .addrlist import KeyAddrList
@@ -315,7 +315,7 @@ class coin_msg:
 
 			if self.proto.sign_mode == 'daemon':
 				from .rpc import rpc_init
-				self.rpc = await rpc_init(self.cfg,self.proto)
+				self.rpc = await rpc_init( self.cfg, self.proto, ignore_wallet=True )
 
 			for k,v in sigs.items():
 				ret = await self.do_verify(

+ 1 - 1
test/unit_tests_d/ut_tx_deserialize.py

@@ -34,7 +34,7 @@ async def test_tx(tx_proto,tx_hex,desc,n):
 				return True
 		return False
 
-	rpc = await rpc_init( cfg, proto=tx_proto )
+	rpc = await rpc_init( cfg, proto=tx_proto, ignore_wallet=True )
 	d = await rpc.call('decoderawtransaction',tx_hex)
 
 	if has_nonstandard_outputs(d['vout']): return False