Preparation for moving the set of verified and unverified txs to the wallet.
The verifier will retain responsibility for verification, but will no longer hold the transaction sets itself. Change requires_fee to take a wallet. Add new function add_unverified_tx() Move get_confirmations() to the wallet from the verifier.
This commit is contained in:
@@ -769,7 +769,7 @@ class Transaction:
|
||||
return out
|
||||
|
||||
|
||||
def requires_fee(self, verifier):
|
||||
def requires_fee(self, wallet):
|
||||
# see https://en.bitcoin.it/wiki/Transaction_fees
|
||||
#
|
||||
# size must be smaller than 1 kbyte for free tx
|
||||
@@ -784,7 +784,7 @@ class Transaction:
|
||||
threshold = 57600000
|
||||
weight = 0
|
||||
for txin in self.inputs:
|
||||
age = verifier.get_confirmations(txin["prevout_hash"])[0]
|
||||
age = wallet.get_confirmations(txin["prevout_hash"])[0]
|
||||
weight += txin["value"] * age
|
||||
priority = weight / size
|
||||
print_error(priority, threshold)
|
||||
|
||||
Reference in New Issue
Block a user