Commit graph

3580 commits

Author SHA1 Message Date
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
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
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
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
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
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
SomberNight
7b91da9966
Qt tx dialog: handle "empty" locktime field
fix https://github.com/spesmilo/electrum/issues/5486#issuecomment-696276020
2020-09-23 13:31:39 +02:00
SomberNight
9380b331e4
LNWatcher: implement diagnostic_name; for nicer log lines 2020-09-18 20:54:09 +02:00
MrNaif2018
6bd1a04aee
Pass wallet to invoice_status/request_status (#6595)
* Pass wallet to invoice_status/request_status

* Check for same wallet in qt gui

Co-authored-by: ghost43 <somber.night@protonmail.com>
2020-09-18 17:28:51 +00:00
Benoît Verret
ddc94197aa
Keep console input when switching server (#6607)
Console input was being replaced by an empty line every time the
server used changed.
2020-09-18 16:30:43 +00:00
SomberNight
1ea4e42a96
Qt history/address tab: defer refreshing while editing (e.g. label)
This functionality was originally added in 0371a3dc32,
but was lost with #4915 in version 3.3.
2020-09-16 18:26:08 +02:00
SomberNight
caa68e2fe8
(trivial) config.get_netaddress: use NetAddress.from_string 2020-09-16 17:38:20 +02:00
Benoît Verret
77287e0fc7
Fix multiline script error (#6581)
Syntax errors emerged when running multiline scripts in the console
when using the run() command.
2020-09-15 17:23:22 +00:00
SomberNight
35f1f2905b
lnpeer: forbid creating Peer with ourselves (self-connect)
related: #6583
2020-09-15 18:35:16 +02:00
ghost43
3eba26b398
LN cooperative close: avoid address-reuse (#6590)
Previously if we coop-closed multiple channels in the same session,
they would reuse the wallet address.
2020-09-15 15:37:47 +00:00
ghost43
fc89c8ffa9
win binary: build zbar ourselves (#6593)
This allows bundling much newer zbar that includes many fixes.
related: #6018

This is largely based on
https://github.com/Electron-Cash/Electron-Cash/pull/1362
https://github.com/Electron-Cash/Electron-Cash/pull/1363
https://github.com/Electron-Cash/Electron-Cash/pull/1365
eda015908e
2020-09-15 15:35:57 +00:00
SomberNight
ea3e3ddbb8
lnpeer: handle cooperative close edge-case
fix #6317
2020-09-13 16:55:37 +02:00
SomberNight
261ad804ca
invoices: always validate that LNInvoice.invoice can be decoded
related: #6559

The LNInvoice.from_json() method previously did not validate, which is
used by e.g. wallet.import_invoices.
2020-09-11 19:57:42 +02:00
SomberNight
f9ce058479
prepare release 4.0.3 2020-09-11 15:47:29 +02:00
SomberNight
9931df9f25
storage: fix update-password edge-case
fixes #6400
2020-09-11 13:44:06 +02:00
SomberNight
9eb152ed98
keystore: improve check_password.
and add tests that exercise it

maybe fixes #4128
2020-09-11 13:42:12 +02:00
SomberNight
9b4414fb2e
keystore: add comment about find_my_pubkey_in_txinout quirk (re PSBT) 2020-09-09 18:34:40 +02:00
ghost43
9e0e941533
Merge pull request #6563 from SomberNight/202009_deps
update some dependencies
2020-09-09 16:03:06 +00:00
Henrik Grimler
48a7e5cc2b
gui: update stdio and text after db and storage separation (#6567)
e1ce3aace7 updated the qt and kivy guis, but not stdio or text one.
2020-09-09 15:54:42 +00:00
ghost43
21c3572600
hardware devices: run all device communication on dedicated thread (#6561)
hidapi/libusb etc are not thread-safe.

related: #6554
2020-09-08 15:52:53 +00:00
SomberNight
7e534f4865
dependencies: rm pyaes from requirements
Since #6014, pyaes is not really needed anymore.

As we currently require either one of pycryptodomex or cryptography,
even if pyaes is available, it will not be used.
We could strip it out completely from crypto.py...

In any case, pyaes is still pulled in by some hw wallet dependencies indirectly;
but the core library no longer depends on it.
2020-09-08 16:44:20 +02:00
SomberNight
53a5a21ee8
hardware: update device conn. status faster (through GUI indicator)
Qt status bar icon will now refresh to reflect disconnected device
during next scan
2020-09-07 17:16:06 +02:00
SomberNight
9bba65199e
Qt QR code: when saving QR code as image file, don't include stretch
The stretch to the right of the QR was included in the image previously.
This resolves the FIXME.
2020-09-06 17:55:11 +02:00
SomberNight
2d739981c2
lnhtlc: fix prev: too much copy-paste 2020-09-05 17:49:02 +02:00
SomberNight
aba2e0f55a
lnhtlc: add all_htlcs_ever, get_htlc_by_id, was_htlc_failed and use them
towards encapsulation of hm.log
2020-09-04 19:29:14 +02:00
SomberNight
51f42a25f9
lnhtlc: add lock to make methods thread-safe
many methods are accessed from both the asyncio thread and the GUI thread

fixes #6373
2020-09-04 19:29:11 +02:00
SomberNight
a7199696d3
json_db: exempt keystore from StoredDict conversion
The keystore logic would need to be significantly changed to nicely
interoperate with StoredDict/json_db logic.
(just see KeyStore.__init__() and KeyStore.dump())
For now we exempt the keystore from the recursive StoredDict conversion, as
it is a smaller change that is also easier to review for correctness.

fixes #6066
fixes #6401

also reverts 2d3c2eeea9 (which was an even hackier workaround for #6066)
2020-09-04 16:11:01 +02:00
SomberNight
8dc3fadd13
tests: add tests for #6066 and #6401. latter is failing atm.
see #6066
see #6401
2020-09-03 18:04:27 +02:00