From f8518c78d8dfbe0b5769fc59d71b54d30075ff89 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 9 Nov 2017 22:15:47 +0100 Subject: [PATCH] remove Transaction.requires_fee() --- gui/qt/main_window.py | 2 +- lib/transaction.py | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 0e758ed7..4bad81e8 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1354,7 +1354,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): if use_rbf: tx.set_rbf(True) - if fee < self.wallet.relayfee() * tx.estimated_size() / 1000 and tx.requires_fee(self.wallet): + if fee < self.wallet.relayfee() * tx.estimated_size() / 1000: self.show_error(_("This transaction requires a higher fee, or it will not be propagated by the network")) return diff --git a/lib/transaction.py b/lib/transaction.py index 9d89a680..120bb102 100644 --- a/lib/transaction.py +++ b/lib/transaction.py @@ -941,29 +941,6 @@ class Transaction: } return out - def requires_fee(self, wallet): - # see https://en.bitcoin.it/wiki/Transaction_fees - # - # size must be smaller than 1 kbyte for free tx - size = len(self.serialize(-1))/2 - if size >= 10000: - return True - # all outputs must be 0.01 BTC or larger for free tx - for addr, value in self.get_outputs(): - if value < 1000000: - return True - # priority must be large enough for free tx - threshold = 57600000 - weight = 0 - for txin in self.inputs(): - height, conf, timestamp = wallet.get_tx_height(txin["prevout_hash"]) - weight += txin["value"] * conf - priority = weight / size - print_error(priority, threshold) - - return priority < threshold - - def tx_from_str(txt): "json or raw hexadecimal"