From 2b307ce24fca992dc9f37d7c72bc2ee8281c12c7 Mon Sep 17 00:00:00 2001 From: BTChip Date: Wed, 24 Jun 2015 00:39:39 +0200 Subject: [PATCH 1/2] Use format_satoshis_plain instead of format_satoshis to avoid locale separator issues --- plugins/btchipwallet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/btchipwallet.py b/plugins/btchipwallet.py index bd4b72bf..57797967 100644 --- a/plugins/btchipwallet.py +++ b/plugins/btchipwallet.py @@ -16,7 +16,7 @@ from electrum.plugins import BasePlugin, hook from electrum.transaction import deserialize from electrum.wallet import BIP32_HD_Wallet, BIP32_Wallet -from electrum.util import format_satoshis +from electrum.util import format_satoshis_plain import hashlib try: @@ -396,8 +396,8 @@ class BTChipWallet(BIP32_HD_Wallet): while inputIndex < len(inputs): self.get_client().startUntrustedTransaction(firstTransaction, inputIndex, trustedInputs, redeemScripts[inputIndex]) - outputData = self.get_client().finalizeInput(output, format_satoshis(outputAmount), - format_satoshis(self.get_tx_fee(tx)), changePath, bytearray(rawTx.decode('hex'))) + outputData = self.get_client().finalizeInput(output, format_satoshis_plain(outputAmount), + format_satoshis_plain(self.get_tx_fee(tx)), changePath, bytearray(rawTx.decode('hex'))) if firstTransaction: transactionOutput = outputData['outputData'] if outputData['confirmationNeeded']: From 3a22fe758f09c32a71b3ac357ac1ceaaaa2fd9e3 Mon Sep 17 00:00:00 2001 From: BTChip Date: Thu, 25 Jun 2015 08:17:45 +0200 Subject: [PATCH 2/2] Only rescan the dongle when it has been disconnected --- plugins/btchipwallet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/btchipwallet.py b/plugins/btchipwallet.py index 57797967..2dd3fcee 100644 --- a/plugins/btchipwallet.py +++ b/plugins/btchipwallet.py @@ -430,9 +430,9 @@ class BTChipWallet(BIP32_HD_Wallet): if not confirmed: raise Exception('Aborted by user') pin = pin.encode() - self.client.bad = True - self.device_checked = False - self.get_client(True) + self.client.bad = True + self.device_checked = False + self.get_client(True) waitDialog.start("Signing ...") else: # Sign input with the provided PIN