1
0

transaction: introduce TxOutput namedtuple

This commit is contained in:
SomberNight
2018-07-31 18:24:37 +02:00
parent f64062b6f1
commit 2eb72d496f
21 changed files with 122 additions and 109 deletions

View File

@@ -26,7 +26,7 @@ from collections import defaultdict, namedtuple
from math import floor, log10
from .bitcoin import sha256, COIN, TYPE_ADDRESS, is_address
from .transaction import Transaction
from .transaction import Transaction, TxOutput
from .util import NotEnoughFunds, PrintError
@@ -178,7 +178,7 @@ class CoinChooserBase(PrintError):
# size of the change output, add it to the transaction.
dust = sum(amount for amount in amounts if amount < dust_threshold)
amounts = [amount for amount in amounts if amount >= dust_threshold]
change = [(TYPE_ADDRESS, addr, amount)
change = [TxOutput(TYPE_ADDRESS, addr, amount)
for addr, amount in zip(change_addrs, amounts)]
self.print_error('change:', change)
if dust: