|
|
@ -892,7 +892,7 @@ class Abstract_Wallet(PrintError): |
|
|
|
keypairs[pubkey] = privkey |
|
|
|
|
|
|
|
if not inputs: |
|
|
|
return |
|
|
|
raise BaseException(_('No inputs found. (Note that inputs need to be confirmed)')) |
|
|
|
|
|
|
|
total = sum(i.get('value') for i in inputs) |
|
|
|
if fee is None: |
|
|
@ -900,6 +900,12 @@ class Abstract_Wallet(PrintError): |
|
|
|
tx = Transaction.from_io(inputs, outputs) |
|
|
|
fee = self.estimate_fee(config, tx.estimated_size()) |
|
|
|
|
|
|
|
if total - fee < 0: |
|
|
|
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d\nDust Threshold: %d'%(total, fee)) |
|
|
|
|
|
|
|
if total - fee < self.dust_threshold(): |
|
|
|
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d\nDust Threshold: %d'%(total, fee, self.dust_threshold())) |
|
|
|
|
|
|
|
outputs = [(TYPE_ADDRESS, recipient, total - fee)] |
|
|
|
tx = Transaction.from_io(inputs, outputs) |
|
|
|
tx.sign(keypairs) |
|
|
|