1
0

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:
Neil Booth
2015-05-07 08:52:34 +09:00
parent ffda5cd866
commit 79de458101
7 changed files with 52 additions and 52 deletions

View File

@@ -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)