Browse Source

bugfix fee estimate

master
Adam Gibson 8 years ago
parent
commit
a46dbf5cfd
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 3
      jmclient/jmclient/taker.py
  2. 5
      scripts/sendpayment.py

3
jmclient/jmclient/taker.py

@ -355,7 +355,8 @@ class Taker(object):
if self.my_change_addr:
#Estimate fee per choice of next/3/6 blocks targetting.
estimated_fee = estimate_tx_fee(
len(sum(self.utxos.values(), [])), len(self.outputs) + 2)
len(sum(self.utxos.values(), [])), len(self.outputs) + 2,
txtype=self.wallet.get_txtype())
jlog.info("Based on initial guess: " + str(self.total_txfee) +
", we estimated a miner fee of: " + str(estimated_fee))
#reset total

5
scripts/sendpayment.py

@ -114,9 +114,10 @@ def main():
# Dynamically estimate a realistic fee if it currently is the default value.
# At this point we do not know even the number of our own inputs, so
# we guess conservatively with 2 inputs and 2 outputs each
# we guess conservatively with 2 inputs and 2 outputs each.
if options.txfee == -1:
options.txfee = max(options.txfee, estimate_tx_fee(2, 2))
options.txfee = max(options.txfee, estimate_tx_fee(2, 2,
txtype="p2sh-p2wpkh"))
log.debug("Estimated miner/tx fee for each cj participant: " + str(
options.txfee))
assert (options.txfee >= 0)

Loading…
Cancel
Save