Commit graph

3591 commits

Author SHA1 Message Date
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
ThomasV
5f7d8cc462 reverse swap: check that received amount is higher than dust threshold 2020-09-03 16:40:11 +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
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
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
SomberNight
6802bcb960
windows dns hack: fix #6473 2020-08-25 16:57:10 +02:00
matejcik
a669c6b765
trezor: use init_device instead of ping to check connection (fixes #6457) (#6471) 2020-08-25 14:34:42 +00:00
SomberNight
42da407ee1
scripts: update quick_start.py to work with 4.0.x internals
fixes #6453
2020-08-25 16:22:59 +02:00
SomberNight
c64da9448f
wallet: get_full_history should populate acq_price/cap_gains if enabled
fixes #6370

qt history tab is calling get_full_history; so this is needed to populate cap_gains columns
2020-08-24 18:17:05 +02:00
SomberNight
df82d9c017
bip39 scan: follow-up prev
- use logger
- allow qt dialog to be GC-ed
- (trivial) add typing; minor formatting
2020-08-20 18:58:52 +02:00
Luke Childs
7b122d2679
Automated BIP39 Recovery, squashed 2020-08-20 17:50:39 +02:00
aaronisme
3ed5f32c6c fix the coldcard multi-sig show address issue 2020-08-18 15:42:39 +08:00
Benoit Verret
4b76541d4c Remove unused methods from Console
set_history(), get_history() and register_command() were never used.
2020-08-07 07:55:19 -04:00
Benoit Verret
822083d168 Remove empty startup message from console
Change >> to >>> as in a normal Python console.
Avoid printing an empty string which is why the console looked like:
>>
Network banner
>>

Instead of:
Network banner
>>>
2020-08-03 05:21:30 -04:00
Benoit Verret
86939c6007 Remove welcome_message from console.py
It is not used anymore.
The console prints network.banner instead.
2020-08-02 07:26:54 -04:00
ThomasV
f49e766b21
Merge pull request #6410 from cointradermonitor/cointradermonitor-new-brazilian-index
Brazilian Bitcoin index source included.
2020-07-29 18:01:22 +02:00
ThomasV
89a609b1fa
Merge pull request #6405 from itxtoledo/feature/more-price-sources
Feature: more price sources for BRL and remove scam broker
2020-07-29 18:00:37 +02:00
ThomasV
8703d10d65
Merge pull request #6395 from akshayaurora/patch-1
Re-size the wizard before next frame is displayed.
2020-07-29 17:58:59 +02:00
ThomasV
a7fa92b66f
Merge pull request #6387 from verretor/clear-console
Keep current input when clearing Python console
2020-07-29 17:49:45 +02:00
ThomasV
5bf47279e0
Merge pull request #6384 from verretor/clean-console
Clean console.py
2020-07-29 17:48:50 +02:00
ghost43
cdda1549e9
Merge pull request #6386 from benma/bitbox02_id
bitbox02: implement get_soft_device_id so multisig runs more smoothly
2020-07-23 00:15:26 +00:00
SomberNight
73cf007048
transaction: allow PSBT input to have both UTXO and WITNESS_UTXO
- make sure they are consistent
- only keep one of them internally (UTXO), and only serialise with UTXO (not both)

fixes #6429
2020-07-22 02:44:33 +02:00
Cointrader Monitor
c67eef6e40
Brazilian Bitcoin index source included.
Added Brazilian Bitcoin Index from Cointrader Monitor (https://cointradermonitor.com/api/pbb/v1/ticker) as a "BRL" Fiat source.
The index is calculated from the last price and volume from 30 brazilian exchanges. It is a well-known price index used by bitcoin brazilian users.
More information at https://cointradermonitor.com/
2020-07-19 01:52:31 +00:00