1
0

Qt GUI: let users type tx output in script language

This commit is contained in:
ThomasV
2016-06-07 09:57:24 +02:00
parent 4e8c616090
commit a07a3f748e
6 changed files with 42 additions and 20 deletions

View File

@@ -418,7 +418,7 @@ class Commands:
if amount == '!':
assert len(outputs) == 1
inputs = self.wallet.get_spendable_coins(domain)
amount, fee = self.wallet.get_max_amount(self.config, inputs, address, fee)
amount, fee = self.wallet.get_max_amount(self.config, inputs, (TYPE_ADDRESS, address), fee)
else:
amount = int(COIN*Decimal(amount))
final_outputs.append((TYPE_ADDRESS, address, amount))

View File

@@ -681,7 +681,8 @@ class Abstract_Wallet(PrintError):
if fee is None:
for i in inputs:
self.add_input_info(i)
outputs = [(TYPE_ADDRESS, recipient, sendable)]
_type, addr = recipient
outputs = [(_type, addr, sendable)]
dummy_tx = Transaction.from_io(inputs, outputs)
fee = self.estimate_fee(config, dummy_tx.estimated_size())
amount = max(0, sendable - fee)