Commit graph

308 commits

Author SHA1 Message Date
SomberNight
24221f8fca
plugins: fix labels plugin FIXME re "just enabled plugin" 2020-05-25 17:31:13 +02:00
SomberNight
6457bb141d
wallet: (trivial) rename check_address 2020-05-22 17:19:48 +02:00
SomberNight
7951f2ed3b
lnworker.pay: small clean-up 2020-05-06 04:02:59 +02:00
SomberNight
5bf3115a4a
qt send tab: (fix) allow user to set lower fees if "not enough funds"
Previously if the user tried to pay an invoice, we tried to construct
a tx with the desired feerate. If this raise NotEnoughFunds, we would just
show the error and not let the user change the feerate.

related: https://github.com/spesmilo/electrum/issues/6136#issuecomment-622254754 (method 2)
2020-05-01 07:51:29 +02:00
SomberNight
0f6cbfba8e
qt update checker: do not keep main window ref so it can gc-ed
related: #4905
2020-05-01 06:39:55 +02:00
SomberNight
2105c6c4e6
qt exception window: turn Exception_Hook into singleton
related #4905
related Electron-Cash/Electron-Cash@6a3d76b0ab

conceptually did not really make sense that the Exception_Hook kept a reference
to an ~arbitrary main window (preventing gc)
2020-05-01 06:33:38 +02:00
ThomasV
ab5338b46b fix #6111, and show channels tab even if lightning is disabled (follow-up 527e0b9b89) 2020-04-29 11:41:57 +02:00
SomberNight
527e0b9b89
qt main window: only show "Channels" tab if wallet has lightning 2020-04-26 05:51:02 +02:00
SomberNight
100a216165
qt wallet>info: add text if lightning is not available for wallet 2020-04-26 05:49:34 +02:00
SomberNight
b59c3294b2
fix #6115: qt wallet>information was broken for imported wallets 2020-04-26 05:29:32 +02:00
Luke Childs
ca1046bce2
Add --serverfingerprint option (#6094)
* Add --fingerprint option

* Simplify conditional checks

* Improve warning wording

* Throw error instead of logging and returning

* --fingerprint => --serverfingerprint

* Only run fingerprint checks against main server

* Throw error if --serverfingerprint is set for a non SSL main server

* Fix linting errors

* Don't check certificate fingerprint in a seperate connection

* Disallow CA signed certs when a fingerprint is provided

* Show clear error and then exit for Qt GUI users

* Remove leading newlines from error dialog

* Always check is_main_server() when getting fingerprint

* Document how to generate SSL cert fingerprint
2020-04-24 14:11:40 +00:00
Evgeny Zinoviev
64733a39dc
set more restrictive file permissions for exported private keys (#6106) 2020-04-21 23:01:41 +00:00
SomberNight
b2cfaddff2
network.NetworkParameters: merge host+port+protocol into "server" field 2020-04-16 21:19:45 +02:00
ThomasV
9224404108 Move callback manager out of Network class 2020-04-14 18:29:51 +02:00
SomberNight
40dc54e8b8
macOS: duplicate Qt "Preferences" menu item
There is a standardised location along with reserved hotkey for "Preferences"
in applications on macOS. Let's put *another* preferences menu item there.

The duplicate items ensure that
- an electrum user coming from a different OS,
- a macOS user used to the standardised preferences location,
will both find "Preferences" easily.
2020-04-13 19:53:52 +02:00
TheCharlatan
a4fe14bb82
BitBox02 Electrum plugin support
This commit adds support for the BitBox02 hardware wallet.
It supports both single and multisig for the electrum gui wallet.

To use the plugin a local installation of the BitBox02 python library is
required. It can be found on PiPy under the name 'bitbox02' and can be
installed from the bitbox02-firmware repository in the py/bitbox02
directory.

All communication to and from the BitBox02 is noise encrypted, the keys
required for this are stored in the wallet config file under the
bitbox02 key.

The BitBox02 registers a multisig configuration before allowing
transaction signing. This multisig configuration includes the threshold,
cosigner xpubs, keypath, a variable to indicate for mainnet and testnet,
and a name that the user can choose during configuration registration.
The user is asked to register the multisig configuration either during
address verification or during transaction signing.

The check the xpub of the BitBox02 for other hardware wallets, a button
is added in the wallet info dialog.

The wallet encryption key is fetched in a separate api call, requiring a
slightly tweaked override version of the wallet encryption password.
2020-04-12 15:34:37 +02:00
ThomasV
bfffc7cb1e Rename 'On-chain' button, add tooltips (see #6053) 2020-04-12 12:57:07 +02:00
ThomasV
312ef15cd6 fix #6056 2020-04-11 12:02:38 +02:00
ThomasV
8f41aeb783 Replace wallet backup with channel backups
- channels can be backed up individually
 - backups are added to lnwatcher
 - AbstractChannel ancestor class
2020-04-10 14:45:23 +02:00
SomberNight
e68b6447cc
hww: catch exceptions when user clicks on hww qt status bar icon
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 167, in perform_hw1_preflight
    firmwareInfo = self.dongleObject.getFirmwareVersion()
  File "...\Python38\site-packages\btchip\btchip.py", line 561, in getFirmwareVersion
    response = self.dongle.exchange(bytearray(apdu))
  File "...\Python38\site-packages\btchip\btchipComm.py", line 127, in exchange
    raise BTChipException("Invalid status %04x" % sw, sw)
btchip.btchipException.BTChipException: Exception : Invalid status 6faa

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 120, in onPress
    self.func()
  File "...\electrum\electrum\plugins\hw_wallet\qt.py", line 260, in show_settings_dialog
    device_id = self.choose_device(window, keystore)
  File "...\electrum\electrum\plugins\hw_wallet\qt.py", line 253, in choose_device
    info = self.device_manager().select_device(self, keystore.handler, keystore)
  File "...\electrum\electrum\plugin.py", line 554, in select_device
    infos = self.unpaired_device_infos(handler, plugin, devices)
  File "...\electrum\electrum\plugin.py", line 545, in unpaired_device_infos
    soft_device_id=client.get_soft_device_id()))
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 88, in get_soft_device_id
    self._soft_device_id = self.request_root_fingerprint_from_device()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 197, in request_root_fingerprint_from_device
    child_of_root_xpub = self.get_xpub("m/0'", xtype='standard')
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 55, in catch_exception
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 103, in get_xpub
    self.checkDevice()
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 210, in checkDevice
    self.perform_hw1_preflight()
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 198, in perform_hw1_preflight
    raise UserFacingException("Dongle is temporarily locked - please unplug it and replug it again")
electrum.util.UserFacingException: Dongle is temporarily locked - please unplug it and replug it again
2020-04-01 21:08:50 +02:00
ThomasV
3d69f3b0be improve payment status callbacks:
- add 'computing route' status for lightning payments
 - use separate callbacks for invoice status and payment popups
 - show payment error and payment logs in kivy
2020-03-10 13:27:02 +01:00
ThomasV
0d160cceea Qt: test if lightinng is running 2020-03-06 11:23:26 +01:00
ThomasV
e48c7d01cd Qt: add 'View channel' to history menu, 'View funding transaction' to channel menu 2020-03-06 08:47:31 +01:00
SomberNight
7962e17df6
invoices: deal with expiration of "0" mess
Internally, we've been using an expiration of 0 to mean "never expires".
For LN invoices, BOLT-11 does not specify what an expiration of 0 means.
Other clients seem to treat it as "0 seconds" (i.e. already expired).
This means there is no way to create a BOLT-11 invoice that "never" expires.

For LN invoices,
- we now treat an expiration of 0, , as "0 seconds",
- when creating an invoice, if the user selected never, we will put 100 years as expiration
2020-03-04 14:24:07 +01:00
ThomasV
f67011d477 Qt: do not filter out paid invoices/requests. let user delete multiple items 2020-03-03 12:56:44 +01:00
ThomasV
a52ac0cc74 (minor) text change: 'Expires after' 2020-03-03 11:40:01 +01:00
ThomasV
abb0760616 Simplify receive tab:
- display receiving address in receiving tabs
 - display lightning invoice as 'address'
 - save last active tab in preferences
2020-03-03 11:10:48 +01:00
SomberNight
f90d96b346
Qt LN gossip sync indicator: hide if 100%; rescale 95%->100%; tooltip 2020-03-02 17:28:39 +01:00
SomberNight
09b3c80529
Qt main_window: handle event 'ln_gossip_sync_progress' if LN disabled
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 434, in on_network_qt
    self.update_lightning_icon()
  File "...\electrum\electrum\gui\qt\main_window.py", line 2091, in update_lightning_icon
    self.lightning_button.setMaximumWidth(25 + 4 * char_width_in_lineedit())
AttributeError: 'ElectrumWindow' object has no attribute 'lightning_button'
2020-03-01 04:28:13 +01:00
SomberNight
67d24bf129
add LN gossip sync progress estimate indicator to Qt GUI 2020-02-29 20:03:35 +01:00
SomberNight
e1dcdde272
Qt tx dialog: fix file extension when exporting (on MacOS...)
closes #5954

We are now giving every(?) hint possible to the MacOS file dialog...
The extension is put in the filename as before (which turned out not to be enough).
It is also set using QFileDialog.setDefaultSuffix, which again, turns out not to be enough.
In desperation, the file extension filter-list now contains *.psbt and *.txn as separate filters,
and the one with the expected extension is pre-selected. This seems enough...
2020-02-28 21:59:09 +01:00
SomberNight
88650ed8d6
network UntrustedServerReturnedError: add "DO NOT TRUST..." tag 2020-02-28 18:47:12 +01:00
ThomasV
ed29a45d50 Qt: disable preview button in open_channel 2020-02-24 12:29:56 +01:00
SomberNight
4c2e1970f2
qt receive tab: better "Clear" behaviour
Previously, the selection would not get cleared, and if the user clicked
again on the already selected item, the click would get ignored
(request would not get populated).
2020-02-23 21:18:46 +01:00
SomberNight
45a309ff25
qt channels_list: early exit if lightning is disabled
(note: signal is coming from a different wallet/window)

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\channels_list.py", line 142, in do_update_single_row
    self.update_can_send(self.parent.wallet.lnworker)
  File "...\electrum\electrum\gui\qt\channels_list.py", line 164, in update_can_send
    msg = _('Can send') + ' ' + self.parent.format_amount(lnworker.can_send())\
AttributeError: 'NoneType' object has no attribute 'can_send'
2020-02-23 20:30:14 +01:00
ThomasV
570167a2c4 restrict lightning to p2wpkh wallets 2020-02-20 21:17:25 +01:00
ThomasV
feb47b0a6f Add lightning tx dialog (qt and kivy) 2020-02-18 13:02:18 +01:00
SomberNight
16626a3386
lnutil.split_host_port: fix for IPv6 connection string 2020-02-17 19:43:21 +01:00
ThomasV
4dc74870e1 Catch exceptions raised in LNWorker._pay_to_route
Reset payment status if an exception is caught.
Also, do not pass status to the 'invoice_status' network callback.
This fixes #5869, #5870, #5964.
2020-02-17 12:33:43 +01:00
ThomasV
2dad87cbb4 Automate backups:
- backup wallet file on each channel creation
 - on android, a backup password is entered in settings
 - on desktop, the backup path is in settings
2020-02-15 16:28:15 +01:00
ThomasV
62eceeb573 Save and read lighting backups (Qt) 2020-02-15 16:28:15 +01:00
SomberNight
111ef9ebb1
follow-up fixes to storage-db separation
e1ce3aace7
2020-02-13 20:00:12 +01:00
ThomasV
a600873cf9 move wrapper definition outside of main_window class 2020-02-11 11:08:33 +01:00
ThomasV
e1ce3aace7 Separate db from storage
- storage is content-agnostic
 - db and storage are passed to wallet contructor
2020-02-10 17:45:23 +01:00
SomberNight
f9960a5fe2
qt: don't clear send tab in broadcast_done
no longer needed as fields are already cleared when user clicks Save/Pay
2020-02-07 20:11:08 +01:00
ThomasV
8118bd1d72 use setEnabled() for Qt menu items: Network, Lightning, Watchtower 2020-02-02 22:40:23 +01:00
SomberNight
2880c26d87
qt broadcast tx: don't complain about being "offline" for partial tx 2020-01-21 15:12:25 +01:00
SomberNight
2e654c9440
qt main_window: trivial clean-up re is_onchain 2020-01-21 14:22:25 +01:00
SomberNight
e9645db182
qt send tab: show "Pay" button even in watch-only wallets 2020-01-21 14:16:23 +01:00
SomberNight
6d270364c6
qt paytoedit: properly handle multiple max ('!') outputs 2020-01-18 04:15:44 +01:00