[Pkg-bitcoin-commits] [electrum] 01/04: Imported Upstream version 2.6.4

Tristan Seligmann mithrandi at moszumanska.debian.org
Sun May 22 02:01:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

mithrandi pushed a commit to branch master
in repository electrum.

commit 1947b68fcf617e094f1d6600b0444d0ba83958b4
Author: Tristan Seligmann <mithrandi at debian.org>
Date:   Sun May 22 03:56:55 2016 +0200

    Imported Upstream version 2.6.4
---
 Electrum.egg-info/PKG-INFO               |   2 +-
 Electrum.egg-info/SOURCES.txt            |   1 +
 PKG-INFO                                 |   2 +-
 RELEASE-NOTES                            |   6 ++++++
 gui/kivy/uix/screens.py                  |   3 ++-
 gui/qt/history_widget.py                 |   1 +
 gui/qt/icons_rc.py                       |   2 +-
 gui/qt/installwizard.py                  |   1 +
 gui/qt/main_window.py                    |  11 ++++++-----
 lib/coinchooser.py                       |  18 +++++++++---------
 lib/commands.py                          |  10 ++++++++++
 lib/daemon.py                            |  28 ++++++++++++++--------------
 lib/locale/eo_UY/LC_MESSAGES/electrum.mo | Bin 32205 -> 2582 bytes
 lib/locale/it_IT/LC_MESSAGES/electrum.mo | Bin 33983 -> 34017 bytes
 lib/locale/pt_BR/LC_MESSAGES/electrum.mo | Bin 22165 -> 23793 bytes
 lib/locale/th_TH/LC_MESSAGES/electrum.mo | Bin 512 -> 512 bytes
 lib/transaction.py                       |   5 ++---
 lib/util.py                              |   2 ++
 lib/version.py                           |   2 +-
 lib/wl.py                                |  10 ++++++++++
 plugins/exchange_rate/qt.py              |  15 ++++++++++++---
 21 files changed, 80 insertions(+), 39 deletions(-)

diff --git a/Electrum.egg-info/PKG-INFO b/Electrum.egg-info/PKG-INFO
index e36327e..06a3229 100644
--- a/Electrum.egg-info/PKG-INFO
+++ b/Electrum.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Electrum
-Version: 2.6.3
+Version: 2.6.4
 Summary: Lightweight Bitcoin Wallet
 Home-page: https://electrum.org
 Author: Thomas Voegtlin
diff --git a/Electrum.egg-info/SOURCES.txt b/Electrum.egg-info/SOURCES.txt
index e93abd1..39ebac4 100644
--- a/Electrum.egg-info/SOURCES.txt
+++ b/Electrum.egg-info/SOURCES.txt
@@ -1503,6 +1503,7 @@ lib/version.py
 lib/wallet.py
 lib/websockets.py
 lib/wizard.py
+lib/wl.py
 lib/x509.py
 lib/locale/ar_SA/LC_MESSAGES/electrum.mo
 lib/locale/bg_BG/LC_MESSAGES/electrum.mo
diff --git a/PKG-INFO b/PKG-INFO
index e36327e..06a3229 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Electrum
-Version: 2.6.3
+Version: 2.6.4
 Summary: Lightweight Bitcoin Wallet
 Home-page: https://electrum.org
 Author: Thomas Voegtlin
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index f0a3d43..c1108b6 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,3 +1,9 @@
+# Release 2.6.4 (bugfixes)
+ * fix coinchooser bug (#1703)
+ * fix daemon JSONRPC (#1731)
+ * fix command-line broadcast (#1728)
+ * QT: add colors to labels
+
 # Release 2.6.3 (bugfixes)
  * fix command line parsing of transactions
  * fix signtransaction --privkey (#1715)
diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py
index b09d8c1..bb2a669 100644
--- a/gui/kivy/uix/screens.py
+++ b/gui/kivy/uix/screens.py
@@ -164,7 +164,8 @@ class HistoryScreen(CScreen):
             ri.icon = icon
             ri.date = date_time
             ri.message = message
-            ri.value = value
+            ri.value = value or 0
+            ri.value_known = value is not None
             ri.quote_text = quote_text
             ri.confirmations = conf
             ri.tx_hash = tx
diff --git a/gui/qt/history_widget.py b/gui/qt/history_widget.py
index e747afc..f1bf679 100644
--- a/gui/qt/history_widget.py
+++ b/gui/qt/history_widget.py
@@ -92,6 +92,7 @@ class HistoryWidget(MyTreeWidget):
                 if i!=2:
                     item.setFont(i, QFont(MONOSPACE_FONT))
             if value < 0:
+                item.setForeground(3, QBrush(QColor("#BC1E1E")))
                 item.setForeground(4, QBrush(QColor("#BC1E1E")))
             if tx_hash:
                 item.setData(0, Qt.UserRole, tx_hash)
diff --git a/gui/qt/icons_rc.py b/gui/qt/icons_rc.py
index aa8a6fb..96860bc 100644
--- a/gui/qt/icons_rc.py
+++ b/gui/qt/icons_rc.py
@@ -2,7 +2,7 @@
 
 # Resource object code
 #
-# Created: dim. mars 20 13:48:38 2016
+# Created: mar. avr. 12 08:35:55 2016
 #      by: The Resource Compiler for PyQt (Qt v4.8.6)
 #
 # WARNING! All changes made in this file will be lost!
diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py
index 7843a59..23a5ca6 100644
--- a/gui/qt/installwizard.py
+++ b/gui/qt/installwizard.py
@@ -235,6 +235,7 @@ class InstallWizard(QDialog, MessageBoxMixin, WizardBase):
                 self.emit(QtCore.SIGNAL('synchronized'), msg)
             self.connect(self, QtCore.SIGNAL('synchronized'), self.show_message)
             t = threading.Thread(target = task)
+            t.daemon = True
             t.start()
         else:
             msg = _("This wallet was restored offline. It may "
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
index 047d12b..b0c024a 100644
--- a/gui/qt/main_window.py
+++ b/gui/qt/main_window.py
@@ -2244,9 +2244,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
 
 
     def tx_from_text(self, txt):
-        from electrum.transaction import tx_from_str
+        from electrum.transaction import tx_from_str, Transaction
         try:
-            return tx_from_str(txt)
+            tx = tx_from_str(txt)
+            return Transaction(tx)
         except:
             traceback.print_exc(file=sys.stdout)
             self.show_critical(_("Electrum was unable to parse your transaction"))
@@ -2406,7 +2407,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
 
 
     def do_import_labels(self):
-        labelsFile = self.getOpenFileName(_("Open labels file"), "*.dat")
+        labelsFile = self.getOpenFileName(_("Open labels file"), "*.json")
         if not labelsFile: return
         try:
             f = open(labelsFile, 'r')
@@ -2422,10 +2423,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
     def do_export_labels(self):
         labels = self.wallet.labels
         try:
-            fileName = self.getSaveFileName(_("Select file to save your labels"), 'electrum_labels.dat', "*.dat")
+            fileName = self.getSaveFileName(_("Select file to save your labels"), 'electrum_labels.json', "*.json")
             if fileName:
                 with open(fileName, 'w+') as f:
-                    json.dump(labels, f)
+                    json.dump(labels, f, indent=4, sort_keys=True)
                 self.show_message(_("Your labels where exported to") + " '%s'" % str(fileName))
         except (IOError, os.error), reason:
             self.show_critical(_("Electrum was unable to export your labels.") + "\n" + str(reason))
diff --git a/lib/coinchooser.py b/lib/coinchooser.py
index 99d3ecb..0db5be8 100644
--- a/lib/coinchooser.py
+++ b/lib/coinchooser.py
@@ -25,7 +25,6 @@
 
 from collections import defaultdict, namedtuple
 from math import floor, log10
-import struct
 
 from bitcoin import sha256, COIN, TYPE_ADDRESS
 from transaction import Transaction
@@ -50,22 +49,23 @@ class PRNG:
         result, self.pool = self.pool[:n], self.pool[n:]
         return result
 
-    def random(self):
-        # Returns random double in [0, 1)
-        four = self.get_bytes(4)
-        return struct.unpack("I", four)[0] / 4294967296.0
-
     def randint(self, start, end):
         # Returns random integer in [start, end)
-        return start + int(self.random() * (end - start))
+        n = end - start
+        r = 0
+        p = 1
+        while p < n:
+            r = self.get_bytes(1)[0] + (r << 8)
+            p = p << 8
+        return start + (r % n)
 
     def choice(self, seq):
-        return seq[int(self.random() * len(seq))]
+        return seq[self.randint(0, len(seq))]
 
     def shuffle(self, x):
         for i in reversed(xrange(1, len(x))):
             # pick an element in x[:i+1] with which to exchange x[i]
-            j = int(self.random() * (i+1))
+            j = self.randint(0, i+1)
             x[i], x[j] = x[j], x[i]
 
 
diff --git a/lib/commands.py b/lib/commands.py
index 776b1c7..cabdc6e 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -216,6 +216,7 @@ class Commands:
     @command('wp')
     def signtransaction(self, tx, privkey=None):
         """Sign a transaction. The wallet keys will be used unless a private key is provided."""
+        tx = Transaction(tx)
         if privkey:
             pubkey = bitcoin.public_key_from_private_key(privkey)
             h160 = bitcoin.hash_160(pubkey.decode('hex'))
@@ -228,11 +229,13 @@ class Commands:
     @command('')
     def deserialize(self, tx):
         """Deserialize a serialized transaction"""
+        tx = Transaction(tx)
         return tx.deserialize()
 
     @command('n')
     def broadcast(self, tx, timeout=30):
         """Broadcast a transaction to the network. """
+        tx = Transaction(tx)
         return self.network.broadcast(tx, timeout)
 
     @command('')
@@ -612,6 +615,11 @@ class Commands:
         self.network.send([('blockchain.address.subscribe', [address])], callback)
         return True
 
+    @command('wn')
+    def is_synchronized(self):
+        """ return wallet synchronization status """
+        return self.wallet.is_up_to_date()
+
     @command('')
     def help(self):
         # for the python console
@@ -757,6 +765,8 @@ def get_parser():
     for cmdname in sorted(known_commands.keys()):
         cmd = known_commands[cmdname]
         p = subparsers.add_parser(cmdname, parents=[parent_parser], help=cmd.help, description=cmd.description)
+        if cmdname == 'restore':
+            p.add_argument("-o", "--offline", action="store_true", dest="offline", default=False, help="Run offline")
         #p.set_defaults(func=run_cmdline)
         if cmd.requires_password:
             p.add_argument("-W", "--password", dest="password", default=None, help="password")
diff --git a/lib/daemon.py b/lib/daemon.py
index 2b692d6..f9a0fd6 100644
--- a/lib/daemon.py
+++ b/lib/daemon.py
@@ -110,8 +110,10 @@ class Daemon(DaemonThread):
             self.network.start()
         self.gui = None
         self.wallets = {}
-        # Setup server
-        cmd_runner = Commands(self.config, None, self.network)
+        # Setup JSONRPC server
+        path = config.get_wallet_path()
+        default_wallet = self.load_wallet(path)
+        cmd_runner = Commands(self.config, default_wallet, self.network)
         host = config.get('rpchost', 'localhost')
         port = config.get('rpcport', 0)
         server = SimpleJSONRPCServer((host, port), logRequests=False,
@@ -174,19 +176,17 @@ class Daemon(DaemonThread):
             wallet = self.wallets[path]
         else:
             storage = WalletStorage(path)
-            if get_wizard:
-                if storage.file_exists:
-                    wallet = Wallet(storage)
-                    action = wallet.get_action()
-                else:
-                    action = 'new'
-                if action:
-                    wizard = get_wizard()
-                    wallet = wizard.run(self.network, storage)
-                else:
-                    wallet.start_threads(self.network)
-            else:
+            if storage.file_exists:
                 wallet = Wallet(storage)
+                action = wallet.get_action()
+            else:
+                action = 'new'
+            if action:
+                if get_wizard is None:
+                    return None
+                wizard = get_wizard()
+                wallet = wizard.run(self.network, storage)
+            else:
                 wallet.start_threads(self.network)
             if wallet:
                 self.wallets[path] = wallet
diff --git a/lib/locale/eo_UY/LC_MESSAGES/electrum.mo b/lib/locale/eo_UY/LC_MESSAGES/electrum.mo
index 8433539..ac0dee0 100644
Binary files a/lib/locale/eo_UY/LC_MESSAGES/electrum.mo and b/lib/locale/eo_UY/LC_MESSAGES/electrum.mo differ
diff --git a/lib/locale/it_IT/LC_MESSAGES/electrum.mo b/lib/locale/it_IT/LC_MESSAGES/electrum.mo
index 58a9f03..04da659 100644
Binary files a/lib/locale/it_IT/LC_MESSAGES/electrum.mo and b/lib/locale/it_IT/LC_MESSAGES/electrum.mo differ
diff --git a/lib/locale/pt_BR/LC_MESSAGES/electrum.mo b/lib/locale/pt_BR/LC_MESSAGES/electrum.mo
index b0ba703..82f9fd1 100644
Binary files a/lib/locale/pt_BR/LC_MESSAGES/electrum.mo and b/lib/locale/pt_BR/LC_MESSAGES/electrum.mo differ
diff --git a/lib/locale/th_TH/LC_MESSAGES/electrum.mo b/lib/locale/th_TH/LC_MESSAGES/electrum.mo
index c02ad27..ee4cd8b 100644
Binary files a/lib/locale/th_TH/LC_MESSAGES/electrum.mo and b/lib/locale/th_TH/LC_MESSAGES/electrum.mo differ
diff --git a/lib/transaction.py b/lib/transaction.py
index a5235aa..ed0e7db 100644
--- a/lib/transaction.py
+++ b/lib/transaction.py
@@ -872,8 +872,7 @@ def tx_from_str(txt):
     except:
         is_hex = False
     if is_hex:
-        return Transaction(txt)
+        return txt
     tx_dict = json.loads(str(txt))
     assert "hex" in tx_dict.keys()
-    tx = Transaction(tx_dict["hex"])
-    return tx
+    return tx_dict["hex"]
diff --git a/lib/util.py b/lib/util.py
index fbc1acf..70aaa59 100644
--- a/lib/util.py
+++ b/lib/util.py
@@ -361,6 +361,8 @@ block_explorer_info = {
                         {'tx': 'tx', 'addr': 'address'}),
     'TradeBlock.com': ('https://tradeblock.com/blockchain',
                         {'tx': 'tx', 'addr': 'address'}),
+    'system default': ('blockchain:',
+                        {'tx': 'tx', 'addr': 'address'}),
 }
 
 def block_explorer(config):
diff --git a/lib/version.py b/lib/version.py
index 2fca4cd..0deda4f 100644
--- a/lib/version.py
+++ b/lib/version.py
@@ -1,4 +1,4 @@
-ELECTRUM_VERSION = '2.6.3'  # version of the client package
+ELECTRUM_VERSION = '2.6.4'  # version of the client package
 PROTOCOL_VERSION = '0.10'   # protocol version requested
 NEW_SEED_VERSION = 11       # electrum versions >= 2.0
 OLD_SEED_VERSION = 4        # electrum versions < 2.0
diff --git a/lib/wl.py b/lib/wl.py
new file mode 100644
index 0000000..cd1f332
--- /dev/null
+++ b/lib/wl.py
@@ -0,0 +1,10 @@
+
+from mnemonic import Mnemonic
+from old_mnemonic import words as old_wordlist
+
+words1 = set(Mnemonic('en').wordlist)
+words2 = set(old_wordlist)
+words = words1.union(words2)
+for w in sorted(words):
+    p = '*' if (w in words2 and not w in words1) else ''
+    print p+w
diff --git a/plugins/exchange_rate/qt.py b/plugins/exchange_rate/qt.py
index 69749b8..393efad 100644
--- a/plugins/exchange_rate/qt.py
+++ b/plugins/exchange_rate/qt.py
@@ -22,6 +22,8 @@ class Plugin(FxPlugin, QObject):
     def connect_fields(self, window, btc_e, fiat_e, fee_e):
 
         def edit_changed(edit):
+            if edit.follows:
+                return
             edit.setStyleSheet(BLACK_FG)
             fiat_e.is_last_edited = (edit == fiat_e)
             amount = edit.get_amount()
@@ -35,16 +37,23 @@ class Plugin(FxPlugin, QObject):
                     fiat_e.setText("")
             else:
                 if edit is fiat_e:
+                    btc_e.follows = True
                     btc_e.setAmount(int(amount / Decimal(rate) * COIN))
-                    if fee_e: window.update_fee()
                     btc_e.setStyleSheet(BLUE_FG)
+                    btc_e.follows = False
+                    if fee_e:
+                        window.update_fee()
                 else:
+                    fiat_e.follows = True
                     fiat_e.setText(self.ccy_amount_str(
                         amount * Decimal(rate) / COIN, False))
                     fiat_e.setStyleSheet(BLUE_FG)
+                    fiat_e.follows = False
 
-        fiat_e.textEdited.connect(partial(edit_changed, fiat_e))
-        btc_e.textEdited.connect(partial(edit_changed, btc_e))
+        btc_e.follows = False
+        fiat_e.follows = False
+        fiat_e.textChanged.connect(partial(edit_changed, fiat_e))
+        btc_e.textChanged.connect(partial(edit_changed, btc_e))
         fiat_e.is_last_edited = False
 
     @hook

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/electrum.git



More information about the Pkg-bitcoin-commits mailing list