Commit graph

12902 commits

Author SHA1 Message Date
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
ThomasV
9d2ede8796 fix arg order in sign_version 2020-09-11 18:24:28 +02:00
ThomasV
950ed9a456 sign_packages: upgrade python 2020-09-11 18:07:22 +02:00
SomberNight
f9ce058479
prepare release 4.0.3 2020-09-11 15:47:29 +02:00
ThomasV
413fcfbf9b update locale submodule 2020-09-11 15:18:03 +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
9204102663
binaries: pip install build requirements first
I no longer trust pip to install packages from a requirements.txt file in the correct order.
For reproducibility, let's install pip/setuptools/wheels/cython first.

see https://github.com/pypa/pip/issues/2362#issuecomment-418423458
see #5859 and #6382
2020-09-08 16:44:35 +02:00
SomberNight
829f7c7443
rerun freeze_packages 2020-09-08 16:44:31 +02:00
SomberNight
cb2f92f710
windows binaries: update pyinstaller to 4.0 2020-09-08 16:44:28 +02:00
SomberNight
4f46741c52
binaries: bump python version (3.7.7->3.7.9) 2020-09-08 16:44:24 +02: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
1cc8c2c055
binaries: bundle 'cryptography' instead of 'pycryptodomex' in binaries
related: #6538

(this allows testing the binaries; to consider whether we can drop pycryptodomex)
2020-09-08 16:43:46 +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
ThomasV
5f7d8cc462 reverse swap: check that received amount is higher than dust threshold 2020-09-03 16:40:11 +02:00
ThomasV
6d67e77136
Merge pull request #6552 from verretor/console-constructs
Fix handling of constructs in console
2020-09-03 14:26:36 +02:00
Benoit Verret
9e35f1f8ac Fix handling of constructs in console
- Replace "...." by "... " in multiline constructs.
- Execute constructs after one empty line and not two or three. It
  was more or less random before.
2020-09-03 06:39:57 -04:00
MrNaif2018
ba649fa8ab
Added for_broadcast argument to payto/paytomany (#6532)
The payto command now takes a flag "addtransaction" whether the returned transaction should be added to the wallet history.
Previously payto did not have a side-effect, and as the flag is opt-in, that will stay the default.

closes #6529
2020-09-01 19:25:36 +00:00
Johannes Zweng
2c7da6afde
add missing wallet.save_db() after adding or rm'ing payment requests (#6435) 2020-09-01 17:24:51 +00:00
SomberNight
c9bf1d4c80
scripts: add script to showcase bruteforcing wallet file password 2020-09-01 18:15:37 +02:00
SomberNight
f265acd234
DeviceMgr.scan_devices: do all scanning on hidapi thread
e.g. the trezor custom enumerate function calls hid.enumerate() which is not thread safe (?).
see comment on line 330
2020-08-31 22:17:44 +02:00
SomberNight
6d86f4dc18
wallet set_tx_label_based_on_invoices: don't overwrite custom label
related: #6545
2020-08-31 22:00:52 +02:00
SomberNight
55eb62bb90
wallet.get_relevant_invoice_keys_for_tx: take lock in callee not caller 2020-08-31 21:58:47 +02:00
SomberNight
6b4edc650a
qt history: fixes for tx context-menu "View invoice" if more than one
fixes #6516

coalesce "View invoice" options into submenu if there are multiple;
also make sure lambda uses bound argument
2020-08-31 20:55:14 +02:00
SomberNight
72950bf379
sdist: bundle make_libsecp256k1.sh in tar.gz
closes #6323
2020-08-30 18:49:18 +02:00
SomberNight
f36cc5b6e0
trezor: cache whether TrezorBridge is available to speedup scan_devices
If the Bridge is unavailable, on my machine it takes 2 seconds to timeout.
i.e. call_bridge("enumerate") and BridgeTransport.enumerate() both take 2 seconds each.
With this change, if the Bridge is unavailable, DeviceMgr.scan_devices() takes 4 seconds less.
In below log, with 6 different hw devices connected, scan time was originally ~7.5 seconds;
with this change it became ~3.5 seconds.

Now the time is dominated by WebUsbTransport.enumerate(), called by Trezor,
KeepKey, SafeT, ~1.1 seconds each.

-----

I | plugin.DeviceMgr | scan_devices() entered. 1598666278.6756
I | plugin.DeviceMgr | scan_devices(). _scan_devices_with_hid() DONE. 1598666278.7583
I | plugin.DeviceMgr | scan_devices(). starting custom enumeration loop. 1598666278.7593
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method SafeTPlugin.enumerate of <electrum.plugins.safe_t.qt.Plugin object at 0x000001F60060A730>>. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration entered. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration. call_bridge('enumerate') DONE. 1598666281.9385
>> trezorlib enumerating <class 'trezorlib.transport.bridge.BridgeTransport'> DONE at 1598666283.9500.
>> trezorlib enumerating <class 'trezorlib.transport.webusb.WebUsbTransport'> DONE at 1598666285.0427.
>> trezorlib enumerating <class 'trezorlib.transport.hid.HidTransport'> DONE at 1598666285.1198.
>> trezorlib enumerating <class 'trezorlib.transport.udp.UdpTransport'> DONE at 1598666285.1237.
I | plugins.trezor.qt.Plugin | trezor custom enumeration. trezorlib.transport.enumerate_devices() DONE. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method TrezorPlugin.enumerate of <electrum.plugins.trezor.qt.Plugin object at 0x000001F60C16F4C0>>. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method KeepKeyPlugin.enumerate of <electrum.plugins.keepkey.qt.Plugin object at 0x000001F60BADF130>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method ColdcardPlugin.detect_simulator of <electrum.plugins.coldcard.qt.Plugin object at 0x000001F60BAA5AC0>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration loop DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). find out what was disconnected DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). Unpair disconnected devices DONE. 1598666286.2251
2020-08-29 04:22:55 +02:00
SomberNight
c313c702fd
qt wallet>info: use QStackedWidget, one stack item for each keystore
Instead of single mpk_text widget for each ks and changing the contents
when switching, create an mpk_text widget for each ks and switch between those.
This allows putting the "show xpub on device" button inside mpk_text.
2020-08-28 20:10:58 +02:00
SomberNight
5215582b83
qt wallet>info: show derivation path prefix for keystore
closes #4700
2020-08-28 18:22:26 +02:00
SomberNight
64a94e9522
Qt Receive tab: hide "receive_tabs" widget when empty 2020-08-27 19:54:30 +02:00
SomberNight
5d723401f8
util.NetworkRetryManager: fix potential overflow
e.g. consider:
>>> 1.5 * 2 ** 2000
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: int too large to convert to float
2020-08-27 17:57:19 +02:00
ThomasV
fdaf6e775c
Merge pull request #6489 from verretor/console-remove-methods
Remove unused methods from Console
2020-08-27 10:00:35 +02:00
ThomasV
5313438140 fix display of Zpub in Kivy during multisig wallet creation (see #6456) 2020-08-26 20:26:59 +02:00
SomberNight
13fe8e466d
transaction: simply PartialTransaction constructor
rm footgun (see prev commit)
2020-08-26 19:55:05 +02:00
SomberNight
54d2fa0e7d
commands: fix signtransaction cmd
fixes #6502
2020-08-26 19:48:35 +02:00
ThomasV
b7c2820951 Qt: add Key_Enter wherever Key_Return is used 2020-08-26 19:37:52 +02:00
ThomasV
6cfe822caf
Merge pull request #6522 from wakiyamap/change_sourceforge_url
Change sourceforge URL
2020-08-26 17:58:33 +02:00
SomberNight
4acf884790
blockchain.py: maybe fix rare deadlock
Saw a deadlock near a swap_with_parent(), could not reproduce.
get_branch_size() and get_parent_heights() could have been the culprits as
they take locks in differing orders and are called from gui/network threads.
2020-08-25 20:29:08 +02:00
SomberNight
36178df875
sql: test read-write permissions for given path and raise early
maybe fix #6485
2020-08-25 18:18:07 +02:00