Browse Source

option rename: --tx-confs -> --fee-estimate-confs

This change breaks compatibility.  Scripts may need to be adjusted.
The MMGen Project 2 years ago
parent
commit
c15c97a95e
6 changed files with 13 additions and 13 deletions
  1. 2 2
      mmgen/globalvars.py
  2. 2 2
      mmgen/main_txcreate.py
  3. 2 2
      mmgen/main_txdo.py
  4. 2 2
      mmgen/proto/btc/daemon.py
  5. 2 2
      mmgen/proto/btc/tx/new.py
  6. 3 3
      mmgen/tx/new.py

+ 2 - 2
mmgen/globalvars.py

@@ -68,7 +68,7 @@ class GlobalContext(Lockable):
 	usr_randchars   = 30
 	usr_randchars   = 30
 
 
 	tx_fee_adj   = 1.0
 	tx_fee_adj   = 1.0
-	tx_confs     = 3
+	fee_estimate_confs = 3
 
 
 	# Constant vars - some of these might be overridden in opts.py, but they don't change thereafter
 	# Constant vars - some of these might be overridden in opts.py, but they don't change thereafter
 
 
@@ -154,7 +154,7 @@ class GlobalContext(Lockable):
 		'debug',
 		'debug',
 		'minconf',
 		'minconf',
 		'quiet',
 		'quiet',
-		'tx_confs',
+		'fee_estimate_confs',
 		'tx_fee_adj',
 		'tx_fee_adj',
 		'use_internal_keccak_module',
 		'use_internal_keccak_module',
 		'usr_randchars' )
 		'usr_randchars' )

+ 2 - 2
mmgen/main_txcreate.py

@@ -34,8 +34,8 @@ opts_data = {
 -a, --tx-fee-adj=  f  Adjust transaction fee by factor 'f' (see below)
 -a, --tx-fee-adj=  f  Adjust transaction fee by factor 'f' (see below)
 -B, --no-blank        Don't blank screen before displaying unspent outputs
 -B, --no-blank        Don't blank screen before displaying unspent outputs
 -c, --comment-file=f  Source the transaction's comment from file 'f'
 -c, --comment-file=f  Source the transaction's comment from file 'f'
--C, --tx-confs=    c  Desired number of confirmations for fee estimation
-                      (default: {g.tx_confs})
+-C, --fee-estimate-confs=c Desired number of confirmations for fee estimation
+                      (default: {g.fee_estimate_confs})
 -d, --outdir=      d  Specify an alternate directory 'd' for output
 -d, --outdir=      d  Specify an alternate directory 'd' for output
 -D, --contract-data=D Path to hex-encoded contract data (ETH only)
 -D, --contract-data=D Path to hex-encoded contract data (ETH only)
 -E, --fee-estimate-mode=M Specify the network fee estimate mode.  Choices:
 -E, --fee-estimate-mode=M Specify the network fee estimate mode.  Choices:

+ 2 - 2
mmgen/main_txdo.py

@@ -37,8 +37,8 @@ opts_data = {
                        brainwallet input
                        brainwallet input
 -B, --no-blank         Don't blank screen before displaying unspent outputs
 -B, --no-blank         Don't blank screen before displaying unspent outputs
 -c, --comment-file=  f Source the transaction's comment from file 'f'
 -c, --comment-file=  f Source the transaction's comment from file 'f'
--C, --tx-confs=      c Desired number of confirmations for fee estimation
-                       (default: {g.tx_confs})
+-C, --fee-estimate-confs=c Desired number of confirmations for fee estimation
+                       (default: {g.fee_estimate_confs})
 -d, --outdir=        d Specify an alternate directory 'd' for output
 -d, --outdir=        d Specify an alternate directory 'd' for output
 -D, --contract-data= D Path to hex-encoded contract data (ETH only)
 -D, --contract-data= D Path to hex-encoded contract data (ETH only)
 -e, --echo-passphrase  Print passphrase to screen when typing it
 -e, --echo-passphrase  Print passphrase to screen when typing it

+ 2 - 2
mmgen/proto/btc/daemon.py

@@ -120,7 +120,7 @@ class bitcoin_core_daemon(CoinDaemon):
 			return ('importaddress',coinaddr,lbl,False)
 			return ('importaddress',coinaddr,lbl,False)
 
 
 	def estimatefee_args(self,rpc):
 	def estimatefee_args(self,rpc):
-		return (opt.tx_confs,)
+		return (opt.fee_estimate_confs,)
 
 
 	def sigfail_errmsg(self,e):
 	def sigfail_errmsg(self,e):
 		return e.args[0]
 		return e.args[0]
@@ -143,7 +143,7 @@ class bitcoin_cash_node_daemon(bitcoin_core_daemon):
 		return ('importaddress',coinaddr,lbl,False)
 		return ('importaddress',coinaddr,lbl,False)
 
 
 	def estimatefee_args(self,rpc):
 	def estimatefee_args(self,rpc):
-		return () if rpc.daemon_version >= 190100 else (opt.tx_confs,)
+		return () if rpc.daemon_version >= 190100 else (opt.fee_estimate_confs,)
 
 
 	def sigfail_errmsg(self,e):
 	def sigfail_errmsg(self,e):
 		return (
 		return (

+ 2 - 2
mmgen/proto/btc/tx/new.py

@@ -32,7 +32,7 @@ class New(Base,TxBase.New):
 
 
 	async def get_rel_fee_from_network(self):
 	async def get_rel_fee_from_network(self):
 		try:
 		try:
-			ret = await self.rpc.call('estimatesmartfee',opt.tx_confs,opt.fee_estimate_mode.upper())
+			ret = await self.rpc.call('estimatesmartfee',opt.fee_estimate_confs,opt.fee_estimate_mode.upper())
 			fee_per_kb = ret['feerate'] if 'feerate' in ret else -2
 			fee_per_kb = ret['feerate'] if 'feerate' in ret else -2
 			fe_type = 'estimatesmartfee'
 			fe_type = 'estimatesmartfee'
 		except:
 		except:
@@ -58,7 +58,7 @@ class New(Base,TxBase.New):
 			from_decimal = True )
 			from_decimal = True )
 		if opt.verbose:
 		if opt.verbose:
 			msg(fmt(f"""
 			msg(fmt(f"""
-				{fe_type.upper()} fee for {opt.tx_confs} confirmations: {fee_per_kb} {self.coin}/kB
+				{fe_type.upper()} fee for {opt.fee_estimate_confs} confirmations: {fee_per_kb} {self.coin}/kB
 				TX size (estimated): {tx_size} bytes
 				TX size (estimated): {tx_size} bytes
 				Fee adjustment factor: {opt.tx_fee_adj:.2f}
 				Fee adjustment factor: {opt.tx_fee_adj:.2f}
 				Absolute fee (fee_per_kb * adj_factor * tx_size / 1024): {ret} {self.coin}
 				Absolute fee (fee_per_kb * adj_factor * tx_size / 1024): {ret} {self.coin}

+ 3 - 3
mmgen/tx/new.py

@@ -151,13 +151,13 @@ class New(Base):
 		else:
 		else:
 			desc = 'Network-estimated ({}, {} conf{})'.format(
 			desc = 'Network-estimated ({}, {} conf{})'.format(
 				opt.fee_estimate_mode.upper(),
 				opt.fee_estimate_mode.upper(),
-				pink(str(opt.tx_confs)),
-				suf(opt.tx_confs) )
+				pink(str(opt.fee_estimate_confs)),
+				suf(opt.fee_estimate_confs) )
 			fee_per_kb,fe_type = await self.get_rel_fee_from_network()
 			fee_per_kb,fe_type = await self.get_rel_fee_from_network()
 
 
 			if fee_per_kb < 0:
 			if fee_per_kb < 0:
 				if not have_estimate_fail:
 				if not have_estimate_fail:
-					msg(self.fee_fail_fs.format(c=opt.tx_confs,t=fe_type))
+					msg(self.fee_fail_fs.format(c=opt.fee_estimate_confs,t=fe_type))
 					have_estimate_fail.append(True)
 					have_estimate_fail.append(True)
 				start_fee = None
 				start_fee = None
 			else:
 			else: