1
0
Commit Graph

13464 Commits

Author SHA1 Message Date
SomberNight
9bc4182924 crypto: check version of pycryptodomex/cryptography at runtime
As these pkgs are often provided by the OS package manager (e.g. apt),
the version limits specified in requirements*.txt and setup.py will never
get applied.
2020-10-15 16:25:06 +02:00
SomberNight
e4e6c4fb1b update locale submodule 2020-10-15 16:19:14 +02:00
SomberNight
4d0afffbcd rerun freeze_packages 2020-10-15 15:57:39 +02:00
SomberNight
1d187d36f0 (fix) allow opening LN wallet with --offline 2020-10-15 14:20:51 +02:00
ghost43
97c79d52f9 Merge pull request #6649 from benma/bitbox02-9.2.0
BitBox02 v9.2.0: support for signing messages and for p2wsh-p2sh legacy multisig accounts
2020-10-15 10:08:24 +00:00
Marko Bencun
a8f8175674 plugins/bitbox02: add support for signing a message 2020-10-14 20:33:54 +02:00
Marko Bencun
8fa019f65b plugins/bitbox02: add support for p2wsh-p2sh multisig 2020-10-14 20:33:54 +02:00
Marko Bencun
2c0ae4abdd contrib/requirements/requirements-hw.txt: bump bitbox02 dep to 5.0.0
Adds the api functions to sign a message and use p2wsh-p2sh legacy
segwit multisig.
2020-10-14 20:33:54 +02:00
SomberNight
a59aec9194 update release notes 2020-10-14 20:04:49 +02:00
SomberNight
bde415cae7 wallet: don't try to get_input_tx from network when offline
related: https://github.com/spesmilo/electrum/issues/6648#issuecomment-708499893

Trying to fetch the prev tx from the network is a blocking operation with
a 10 sec timeout - we should not hang for 10 seconds if there is no network connection.
2020-10-14 19:30:10 +02:00
bitromortac
292016d283 network dialog: include protocol in server address field (#6624)
* network-dialog: include protocol in server field

In this way it is now possible again to use plain server connections
without reverting it automatically to tls connections.

* qt network dialog: hide trailing protocol ":s" in TextEdit

This hides some complexity from casual users, while still allowing
advanced users to set the protocol.

Co-authored-by: SomberNight <somber.night@protonmail.com>
2020-10-14 16:28:31 +00:00
ghost43
83143f421a Merge pull request #6641 from SomberNight/202010_dscancel
wallet: implement cancelling tx by double-spending to self ("dscancel")
2020-10-13 17:42:10 +00:00
SomberNight
082b2b3585 qt console: fix copying text using Ctrl+C
follow-up #6643
2020-10-13 19:21:32 +02:00
SomberNight
c69ce73814 qt coins tab: label(utxo) to consider both label(txid) and label(addr)
related: #6644
2020-10-13 18:57:59 +02:00
SomberNight
4b6c86ecbe wallet: make labels private, and access to need lock
e.g. labels plugin iterated over wallet.labels on asyncio thread while user could trigger an edit from Qt thread
2020-10-13 18:57:55 +02:00
ghost43
da4f11dbd3 android build: update list of apt deps for buildozer (#6645)
compare https://github.com/kivy/buildozer/blob/0.39/docs/source/installation.rst
and https://github.com/kivy/buildozer/blob/1.2.0/docs/source/installation.rst
2020-10-13 16:31:53 +00:00
SomberNight
8eb4247ac4 kivy: allow setting password for watch-only wallets
closes #6622

This has been only disabled for historical reasons: for a long time,
wallets in kivy were only keystore-encrypted, but watch-only wallets
do not have a keystore. Now they are storage-encrypted so passwords make sense.
2020-10-13 17:19:47 +02:00
Benoît Verret
15de954d6a Handle KeyboardInterrupt in Python Console (#6643)
Use Ctrl+C to raise a KeyboardInterrupt.
This is especially useful to escape constructs.

Example:
>>> for i in range(0, 3):
...
KeyboardInterrupt
>>>
2020-10-12 17:28:44 +00:00
ghost43
653a24a49b windows build: for the "setup" exe, put another "-debug" exe inside (#6603)
The "setup" Windows binary we distribute allows users to "install" Electrum
on their system. The distributable is created by NSIS. During
installation a bunch of files will get unpacked in %programfiles(x86)%/Electrum,
including an "inner" exe that will be the entrypoint for the user to start
the application. A shortcut is also created for the inner exe.

With this change, there will now be two inner EXEs. One the same as before,
the other with a "-debug" suffix in its name. The debug exe is built as a
"console" application (as opposed to a "windowed" application), so when
launched via double-click a black console window would appear; and also
importantly stdin/stdout are handled properly for it (unlike for "windowed"
programs). (see #2592)

There will not be a shortcut or similar for the debug exe; it would just
be there as a debugging option we can instruct users to use when needed.
In particular early crashes during startup are hard to debug without
stdout/stderr. (see e.g. #6601)
2020-10-12 15:20:30 +00:00
SomberNight
67cd73cae0 kivy: implement dscancel 2020-10-09 19:01:48 +02:00
SomberNight
3a4f07c345 wallet: implement cancelling tx by double-spending to self ("dscancel") 2020-10-09 17:36:37 +02:00
SomberNight
ca5b93f07d wallet: cpfp to send to a change address instead of receive address 2020-10-09 17:34:20 +02:00
SomberNight
772199a766 wallet: fix clear_history 2020-10-09 16:22:59 +02:00
SomberNight
ad03c1e3cb wallet: (fix) bump_fee and cpfp now returns tx with all wallet-info
Previously e.g. bip32 derivation info was missing for change outputs in partial tx returned by bump_fee.
This was not exposed to users as the GUI TxDialog calls `tx.add_info_from_wallet(self.wallet)`.
2020-10-08 19:30:02 +02:00
ThomasV
4f1814e869 Merge pull request #6640 from EagleTM/patch-1
Remove rogue phishing server enode.duckdns.org
2020-10-08 08:51:41 +02:00
EagleTM
65741c893b Remove rogue phishing server enode.duckdns.org 2020-10-08 08:44:51 +02:00
SomberNight
d3eefefed4 simplify prev 2020-10-07 20:39:00 +02:00
SomberNight
05ebd0f5b2 storage: try to handle user deleting/renaming wallet file while running
related: #4110, #6358
2020-10-07 19:41:22 +02:00
SomberNight
6443bb7d8d SqlDB: fix thread-safety issues re asyncio.Future
exceptions below are raised when running python3 with "-X dev":

Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 999, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "...\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "...\electrum\electrum\sql_db.py", line 55, in run_sql
    future.set_result(result)
  File "...\Python38\lib\asyncio\base_events.py", line 721, in call_soon
    self._check_thread()
  File "...\Python38\lib\asyncio\base_events.py", line 758, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 3009, in closeEvent
    self.clean_up()  #
  File "...\electrum\electrum\gui\qt\main_window.py", line 3026, in clean_up
    self.gui_object.close_window(self)
  File "...\electrum\electrum\gui\qt\__init__.py", line 340, in close_window
    self.daemon.stop_wallet(window.wallet.storage.path)
  File "...\electrum\electrum\daemon.py", line 518, in stop_wallet
    wallet.stop()
  File "...\electrum\electrum\wallet.py", line 344, in stop
    self.lnworker.stop()
  File "...\electrum\electrum\lnworker.py", line 602, in stop
    super().stop()
  File "...\electrum\electrum\lnworker.py", line 273, in stop
    self.listen_server.close()
  File "...\Python38\lib\asyncio\base_events.py", line 337, in close
    self._loop._stop_serving(sock)
  File "...\Python38\lib\asyncio\proactor_events.py", line 849, in _stop_serving
    future.cancel()
  File "...\Python38\lib\asyncio\windows_events.py", line 80, in cancel
    return super().cancel()
  File "...\Python38\lib\asyncio\base_events.py", line 721, in call_soon
    self._check_thread()
  File "...\Python38\lib\asyncio\base_events.py", line 758, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
2020-10-06 19:24:10 +02:00
SomberNight
52f4189176 qt TorDetector: close socket
ResourceWarning below is shown when running python3 with "-X dev":

...\electrum\electrum\gui\qt\network_dialog.py:457: ResourceWarning: unclosed <socket.socket fd=3276, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 55693), raddr=('127.0.0.1', 9050)>
  if TorDetector.is_tor_port(net_addr):
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2020-10-06 19:15:20 +02:00
SomberNight
e60aede77e ledger: workaround to avoid on-device warning for unusual der path
related: #6512
2020-10-06 17:55:29 +02:00
zebra-lucky
546c0e1bb6 tx: add deserialize to locktime/version properties (#6633) 2020-10-06 15:10:46 +00:00
ThomasV
15a77e2f47 Merge pull request #6635 from SomberNight/202010_cli_wallet_arg_order
CLI: allow specifying --wallet at any arg position, as before
2020-10-06 14:34:26 +02:00
SomberNight
83e61d6743 cli: allow specifying --wallet at any arg position, as before
Before commit 46ffab0b55 all of these used to work:
./run_electrum -o signmessage tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" -w ~/.electrum/testnet/wallets/test_segwit_2 --testnet
./run_electrum -o signmessage -w ~/.electrum/testnet/wallets/test_segwit_2 tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" --testnet
./run_electrum -w ~/.electrum/testnet/wallets/test_segwit_2 -o signmessage tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" --testnet
Since then, the last one no longer works.

Related: 9d2ede8796
2020-10-05 18:02:37 +02:00
SomberNight
19f17a2bff fix main script hanging (not exiting after exception) in some cases
Previously an unhandled exception in the main script could cause the main thread to die
but the process to hang, as the event loop thread would keep running.

example:
$ ./run_electrum -o signmessage tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "mymsg" -w ~/.electrum/testnet/wallets/test_segwit_2
Traceback (most recent call last):
  File "./run_electrum", line 424, in <module>
    init_cmdline(config_options, wallet_path, False)
  File "./run_electrum", line 146, in init_cmdline
    db = WalletDB(storage.read(), manual_upgrades=False)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 72, in __init__
    self.load_data(raw)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 103, in load_data
    self._after_upgrade_tasks()
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 189, in _after_upgrade_tasks
    self._load_transactions()
  File "/home/user/wspace/electrum/electrum/util.py", line 406, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "/home/user/wspace/electrum/electrum/util.py", line 402, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1139, in _load_transactions
    self.data = StoredDict(self.data, self, [])
  File "/home/user/wspace/electrum/electrum/json_db.py", line 79, in __init__
    self.__setitem__(k, v)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 44, in wrapper
    return func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 105, in __setitem__
    v = self.db._convert_dict(self.path, key, v)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1182, in _convert_dict
    v = dict((k, Invoice.from_json(x)) for k, x in v.items())
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1182, in <genexpr>
    v = dict((k, Invoice.from_json(x)) for k, x in v.items())
  File "/home/user/wspace/electrum/electrum/invoices.py", line 110, in from_json
    return OnchainInvoice(**x)
  File "<attrs generated init electrum.invoices.OnchainInvoice>", line 8, in __init__
  File "/home/user/wspace/electrum/electrum/invoices.py", line 68, in _decode_outputs
    output = PartialTxOutput.from_legacy_tuple(*output)
  File "/home/user/wspace/electrum/electrum/transaction.py", line 131, in from_legacy_tuple
    return cls.from_address_and_value(addr, val)
  File "/home/user/wspace/electrum/electrum/transaction.py", line 104, in from_address_and_value
    return cls(scriptpubkey=bfh(bitcoin.address_to_script(address)),
  File "/home/user/wspace/electrum/electrum/bitcoin.py", line 422, in address_to_script
    raise BitcoinException(f"invalid bitcoin address: {addr}")
electrum.util.BitcoinException: invalid bitcoin address: tb1qckp4ztmstwtyxzml3dmfvegeq5mfxwu2h3q94l
2020-10-05 17:07:33 +02:00
ThomasV
84dc181b6e Merge pull request #6615 from bitromortac/dumpgraph
Fix dumpgraph command: give out json encoded nodes and channels
2020-10-02 09:59:36 +02:00
bitromortac
c422d7c671 commands: use channeldb.to_dict for dumpgraph 2020-10-02 06:58:10 +02:00
bitromortac
1eae324ddb channeldb: implement dictionary conversion
Implements a way to represent the graph (excluding one own's node) in
terms of a dict, which is json encodeable. Address tuples are converted
to NamedTuples to have automatic annotation in the address outputs.
2020-10-02 06:58:09 +02:00
ThomasV
2a1699c0e5 Merge pull request #6617 from verretor/console-history
Save indented lines in console history
2020-09-30 16:18:24 +02:00
Benoit Verret
4f1c687102 Save indented lines in console history
Mimic the behavior of the standard Python console by storing
indented lines in history.
2020-09-30 09:17:04 -04:00
SomberNight
aae06116f9 follow-up prev 2020-09-25 11:23:23 +02:00
SomberNight
5a7c3dc4d0 network: make MAX_INCOMING_MSG_SIZE configurable from config
requested in https://github.com/spesmilo/electrum/issues/4315#issuecomment-698730778
2020-09-25 11:15:04 +02:00
bitromortac
193b17f0e4 util: move json_normalize to util 2020-09-24 07:32:18 +02:00
SomberNight
52bd0eb1a6 lnworker: minor improvements to 'lightning_listen' handling 2020-09-24 02:17:45 +02:00
SomberNight
c010aa327e lnworker: (fix) a listening node would busy-loop if remote DC-ed early
StreamReader.read() returns b'' on EOF, resulting in a busy loop
2020-09-24 01:52:35 +02:00
SomberNight
a81b0ecc59 daemon/rpc: include "jsonrpc" key in rpc responses
fixes #6612
2020-09-23 21:39:31 +02:00
SomberNight
ae57941981 (trivial) follow-up 7b91da9966 2020-09-23 15:25:13 +02:00
SomberNight
7afcfe7943 build: update some packages in dockerfiles
Ubuntu no longer serves old version
2020-09-23 15:21:29 +02:00
SomberNight
364fca6a58 transaction: fix regression: witness_utxo was not included in QR code
fixes #6600
2020-09-23 15:11:53 +02:00
SomberNight
c4c22312c4 transaction: impl tx.to_qr_data(): move logic from GUI to tx class 2020-09-23 14:57:46 +02:00