1
0
This commit is contained in:
ThomasV
2016-02-03 10:29:31 +01:00
parent 3ee61c4c6e
commit 2a507b91c1
2 changed files with 10 additions and 6 deletions

View File

@@ -657,12 +657,12 @@ class Abstract_Wallet(PrintError):
def dummy_address(self):
return self.addresses(False)[0]
def get_max_amount(self, config, inputs, fee):
def get_max_amount(self, config, inputs, recipient, fee):
sendable = sum(map(lambda x:x['value'], inputs))
for i in inputs:
self.add_input_info(i)
output = (TYPE_ADDRESS, self.dummy_address(), sendable)
dummy_tx = Transaction.from_io(inputs, [output])
outputs = [(TYPE_ADDRESS, recipient, sendable)]
dummy_tx = Transaction.from_io(inputs, outputs)
if fee is None:
fee = self.estimate_fee(config, dummy_tx.estimated_size())
amount = max(0, sendable - fee)