Browse Source

Remove txfee_default: used as user estimation for initial

tx_fee estimate, but removing this option and replacing
    it by the existing estimation (using tx_fee config setting)
    makes more sense.
master
AlexCato 6 years ago
parent
commit
5c0b9ebcfc
  1. 14
      jmclient/jmclient/taker.py
  2. 5
      scripts/joinmarket-qt.py
  3. 15
      scripts/qtsupport.py

14
jmclient/jmclient/taker.py

@ -203,7 +203,6 @@ class Taker(object):
self.outputs = []
self.cjfee_total = 0
self.maker_txfee_contributions = 0
self.txfee_default = 5000
self.latest_tx = None
self.txid = None
@ -293,7 +292,8 @@ class Taker(object):
#to make failures unlikely while keeping the occurence of failure to
#find sufficient utxos extremely rare. Indeed, a doubling of 'normal'
#txfee indicates undesirable behaviour on maker side anyway.
self.total_txfee = 2 * self.txfee_default * self.n_counterparties
self.total_txfee = estimate_tx_fee(3, 2,
txtype=self.wallet_service.get_txtype()) * self.n_counterparties
total_amount = self.cjamount + self.total_cj_fee + self.total_txfee
jlog.info('total estimated amount spent = ' + str(total_amount))
try:
@ -315,13 +315,9 @@ class Taker(object):
jlog.debug("Estimated ins: "+str(est_ins))
est_outs = 2*self.n_counterparties + 1
jlog.debug("Estimated outs: "+str(est_outs))
estimated_fee = estimate_tx_fee(est_ins, est_outs,
self.total_txfee = estimate_tx_fee(est_ins, est_outs,
txtype=self.wallet_service.get_txtype())
jlog.debug("We have a fee estimate: "+str(estimated_fee))
jlog.debug("And a requested fee of: "+str(
self.txfee_default * self.n_counterparties))
self.total_txfee = max([estimated_fee,
self.n_counterparties * self.txfee_default])
jlog.debug("We have a fee estimate: "+str(self.total_txfee))
total_value = sum([va['value'] for va in self.input_utxos.values()])
allowed_types = ["reloffer", "absoffer"] if jm_single().config.get(
"POLICY", "segwit") == "false" else ["swreloffer", "swabsoffer"]
@ -941,7 +937,6 @@ class P2EPTaker(Taker):
# enough for fees, even more rare. "Stuck" coins due to edge cases
# are not an issue since the wallet has direct-send sweep.
self.n_counterparties = 1
self.txfee_default = 10000
self.total_cj_fee = 0
# Preparing bitcoin data here includes choosing utxos/coins.
# We don't trust the user on the selection algo choice; we want it
@ -954,7 +949,6 @@ class P2EPTaker(Taker):
return (False, )
self.outputs = []
self.cjfee_total = 0
self.txfee_default = 5000
self.latest_tx = None
self.txid = None

5
scripts/joinmarket-qt.py

@ -96,9 +96,8 @@ def update_config_for_gui():
operation of the command line version.
'''
gui_config_names = ['gaplimit', 'history_file', 'check_high_fee',
'max_mix_depth', 'txfee_default', 'order_wait_time',
'checktx']
gui_config_default_vals = ['6', 'jm-tx-history.txt', '2', '5', '5000', '30',
'max_mix_depth', 'order_wait_time', 'checktx']
gui_config_default_vals = ['6', 'jm-tx-history.txt', '2', '5', '30',
'true']
if "GUI" not in jm_single().config.sections():
jm_single().config.add_section("GUI")

15
scripts/qtsupport.py

@ -55,7 +55,6 @@ config_types = {'rpc_port': int,
'gaplimit': int,
'check_high_fee': int,
'max_mix_depth': int,
'txfee_default': int,
'order_wait_time': int,
"no_daemon": int,
"daemon_port": int,}
@ -79,22 +78,18 @@ config_tips = {
'socks5_port': 'port for SOCKS5 proxy (or comma separated list)',
'maker_timeout_sec': 'timeout for waiting for replies from makers',
'merge_algorithm': 'for dust sweeping, try merge_algorithm = gradual, \n' +
'for more rapid dust sweeping, try merge_algorithm = greedy \n' +
'for most rapid dust sweeping, try merge_algorithm = greediest \n' +
' but dont forget to bump your miner fees!',
'for more rapid dust sweeping, try merge_algorithm = greedy, \n' +
'for most rapid dust sweeping, try merge_algorithm = greediest \n',
'tx_fees':
'the fee estimate is based on a projection of how many satoshis \n' +
'per kB are needed to get in one of the next N blocks, N set here \n' +
'as the value of "tx_fees". This estimate is high if you set N=1, \n' +
'so we choose N=3 for a more reasonable figure, \n' +
'as our default. Note that for clients not using a local blockchain \n' +
'instance, we retrieve an estimate from the API at blockcypher.com, currently. \n',
'so we choose N=3 for a more reasonable figure as our default.\n' +
'Alternative: Any value higher than 1000 will be interpreted as \n' +
'fee value in satoshi per KB. This overrides the dynamic estimation.',
'gaplimit': 'How far forward to search for used addresses in the HD wallet',
'check_high_fee': 'Percent fee considered dangerously high, default 2%',
'max_mix_depth': 'Total number of mixdepths in the wallet, default 5',
'txfee_default': 'Number of satoshis per counterparty for an initial\n' +
'tx fee estimate; this value is not usually used and is best left at\n' +
'the default of 5000',
'order_wait_time': 'How long to wait for orders to arrive on entering\n' +
'the message channel, default is 30s',
'no_daemon': "1 means don't use a separate daemon; set to 0 only if you\n" +

Loading…
Cancel
Save