Commit graph

12039 commits

Author SHA1 Message Date
ThomasV
0062c6d695 lnworker: fix detection of already paid invoices 2019-09-19 11:57:47 +02:00
ThomasV
d6d5b99944 lnworker: fee_msat is expected for all entries in history 2019-09-19 11:06:44 +02:00
ThomasV
46346eacd7 settings: add vbox with stretch 2019-09-19 10:02:25 +02:00
ThomasV
d1a70bf1df settings: move block explorer to 'Transactions' tab 2019-09-19 09:11:46 +02:00
SomberNight
e9a1c05d23
bitcoin.relayfee: minor clean-up 2019-09-18 22:08:19 +02:00
SomberNight
8c1adc2f50
fix dns issue on Windows
closes #5638
2019-09-18 19:11:40 +02:00
SomberNight
c81f5395af
Merge pull request #5440 from Coldcard/multisig
Add multisig support for Coldcard plugin
2019-09-18 18:35:05 +02:00
SomberNight
26ff7a6265
coldcard tx dialog: "export PSBT" button should not raise on foreign ks
tested trezor/coldcard mixed multisig and it worked; no reason to enforce
that the first keystore must be coldcard (order should not matter)
2019-09-18 18:29:33 +02:00
SomberNight
1236b07abf
coldcard: show multisig address: more intuitive error msg
cause of error is probably almost always what msg says
2019-09-18 18:29:32 +02:00
SomberNight
9c83bc1008
coldcard qt: change receive_menu to be similar to other hw plugins
you should not interact with the hw device in the GUI thread if possible...
right-click was lagging
2019-09-18 18:29:32 +02:00
SomberNight
4e6cc93746
coldcard: do link_wallet in load_wallet hook instead
make_unsigned_transaction might not run in some code paths
(e.g. when user uses "Load transaction" UI function)
2019-09-18 18:29:31 +02:00
SomberNight
47c3ac6f1b
coldcard: follow-up prev 2019-09-18 18:29:31 +02:00
Peter D. Gray
c77fe6aafd
build_psbt.py: provide witness vs redeem or both scripts 2019-09-18 18:29:30 +02:00
Peter D. Gray
1692584ae0
coldcard/build_psbt.py: bugfix: dont assume all keystores implement get_derivation, see BIP32Keystore 2019-09-18 18:29:30 +02:00
Peter D. Gray
4baab751a4
Add multisig support for Coldcard plugin
-----

Squashed commit of the following:

commit 69c0d48108314db6f0e100bea2ce5a9a3a0e9a1f
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Aug 2 14:51:33 2019 -0400

    deterministic-build/requirements-hw.txt: update to version 0.7.9 of ckcc-protocol for Coldcard

commit 5cd2c528698dfb4ad248844be3c741c25aa33e38
Merge: 5e2a36a3e 537b35586
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Aug 2 14:41:59 2019 -0400

    Merge branch 'multisig' of github.com:Coldcard/electrum into multisig

commit 5e2a36a3ee28780a11f789f69896e6e795621bfc
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Aug 2 14:41:49 2019 -0400

    Some fixes for p2wsh-p2sh and p2wsh cases

commit 537b35586e0b1e11622a8e7d718b6fd37d47f952
Merge: a9e3ca47e 2a80f6a3a
Author: nvk <rodolfo@rnvk.org>
Date:   Tue Jul 23 11:40:39 2019 -0400

    Merge branch 'master' into multisig

commit a9e3ca47e189bcf0556703a4f2ca0c084638eb73
Author: Peter D. Gray <peter@conalgo.com>
Date:   Mon Jun 24 13:36:41 2019 -0400

    Bugfix: not all keystores have labels

commit 57783ec158af5ca8d63d596638bc3b6ee63b053f
Author: Peter D. Gray <peter@conalgo.com>
Date:   Mon Jun 24 13:36:04 2019 -0400

    Add address format to export data, and bugfix: use xfp_for_keystore()

commit 6f1f7673eaa340d14497b11c2453f03a73b38850
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Jun 21 09:06:49 2019 -0400

    Revert "bugfix: P2SH inputs can be signed with extra signatures, more than required"

    This reverts commit 75b6b663eca9e7b5edc9a463f7acd8f1c0f0a61a.

commit c322fb6dd2783e1103f5bf69ce60a365fbaf4bfe
Author: Peter D. Gray <peter@conalgo.com>
Date:   Thu Jun 20 12:57:19 2019 -0400

    Require latest CKCC protocol

commit 69a5b781ebc182851d2e25319b549ec58ea23eb1
Author: Peter D. Gray <peter@conalgo.com>
Date:   Thu Jun 20 12:40:27 2019 -0400

    gui/qt/main_window.py: add co-signer keystore label to wallet info display, and a hook for different buttons

commit 55d506d264dbb341602630c3429134e493995272
Author: Peter D. Gray <peter@conalgo.com>
Date:   Thu Jun 20 12:36:10 2019 -0400

    PSBT Combining/cleanup

commit 75b6b663eca9e7b5edc9a463f7acd8f1c0f0a61a
Author: Peter D. Gray <peter@conalgo.com>
Date:   Thu Jun 20 10:18:02 2019 -0400

    bugfix: P2SH inputs can be signed with extra signatures, more than required

commit 1bde362ddbbfd86520a7cb7bc51e0bcef06be078
Author: Peter D. Gray <peter@conalgo.com>
Date:   Wed Jun 19 09:47:26 2019 -0400

    Combines signed PSBT files

commit cc5c0532e52fbe282e862e20c250cc88ed435cad
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Jun 14 13:04:32 2019 -0400

    Working towards multisig

commit cb20da5428ba97237006683133e10b0758999966
Author: Peter D. Gray <peter@conalgo.com>
Date:   Fri Jun 14 13:04:18 2019 -0400

    Refactor/import PSBT handling code into own files

commit 558ef82bb0a8c16fb4e8bd0a6a80190498f1ce57
Author: Peter D. Gray <peter@conalgo.com>
Date:   Tue May 28 13:26:10 2019 -0400

    plugins/hw_wallet/qt.py: show keystore label in tooltip

commit 269299df4a9eb5960b6c6ec0afcbf3ef69ad0be3
Author: Peter D. Gray <peter@conalgo.com>
Date:   Mon May 27 09:32:43 2019 -0400

    Swap endian of xpub fingprint values, so they are shown as BE32 in capitalized hex, rather than 0x%08x (LE32)
2019-09-18 18:29:29 +02:00
SomberNight
bd83ca0286
qt: (trivial) some type hints 2019-09-18 02:10:53 +02:00
SomberNight
30bb7dd6f4
ecc: small clean-up 2019-09-18 02:09:15 +02:00
SomberNight
1669dd9782
simplify prev
following @markblundeberg's suggestion
https://github.com/Electron-Cash/Electron-Cash/pull/1621#issuecomment-532070318
2019-09-17 19:27:28 +02:00
SomberNight
65d896be5a
ecc: also use libsecp256k1 for point addition
time taken to add points changes to around 35% of what it was with python-ecdsa

-----

# benchmark runs before:
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 3.7693 seconds
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 3.8123 seconds
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 3.7937 seconds

# benchmark runs after:
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 1.3127 seconds
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 1.3000 seconds
> python3.7-64 ..\wspace\201909_libsecp256k1_point_addition\bench.py
time taken: 1.3128 seconds

-----

# benchmark script:

import os
import time
from electrum.ecc import generator
from electrum.crypto import sha256

rand_bytes = os.urandom(32)
#rand_bytes = bytes.fromhex('d3d88983b91ee6dfd546ccf89b9a1ffb23b01bf2eef322c2808cb3d951a3c116')
point_pairs = []
for i in range(30000):
    rand_bytes = sha256(rand_bytes)
    rand_int = int.from_bytes(rand_bytes, "big")
    a = generator() * rand_int
    rand_bytes = sha256(rand_bytes)
    rand_int = int.from_bytes(rand_bytes, "big")
    b = generator() * rand_int
    point_pairs.append((a,b))

t0 = time.time()
for a, b in point_pairs:
    c = a + b
t = time.time() - t0
print(f"time taken: {t:.4f} seconds")
2019-09-16 20:43:13 +02:00
SomberNight
49a2dbb021
kivy: receive to ln invoice should be disabled if lightning is disabled 2019-09-16 16:19:19 +02:00
SomberNight
ff9cc4d292
kivy: fix "use change addresses" setting (previously ignored, always on)
this config setting is stored in the WalletStorage unlike most others

closes #5643
2019-09-16 16:01:52 +02:00
SomberNight
0b87ce426f
minor qt send tab fixes. notably 'send max' was broken
follow-up aaed594772
2019-09-16 02:54:32 +02:00
SomberNight
5e04f084b7
qt wizard: follow-up prev; simplify 2019-09-14 16:25:35 +02:00
SomberNight
f44f7d60ab
qt wizard: still show selector window if storage.__init__ raises WFE
(WalletFileException; e.g. if storage version is from the future)
2019-09-14 16:22:06 +02:00
SomberNight
c7346c1eb8
kivy: fix paying onchain invoices
when pasting a new invoice and paying it
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
    tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
    if o.type == TYPE_ADDRESS:
AttributeError: 'tuple' object has no attribute 'type'

when loading back a saved invoice
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
    tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
    if o.type == TYPE_ADDRESS:
AttributeError: 'list' object has no attribute 'type'
2019-09-13 15:00:34 +02:00
SomberNight
1f305bba39
qt history tab txn drag and drop: fix #5635 2019-09-13 14:12:40 +02:00
ThomasV
1ecbafb920 add SSL context to watchtower server 2019-09-13 12:26:27 +02:00
ThomasV
26efef9e06 move lightning settings to settings dialog 2019-09-13 11:55:05 +02:00
ThomasV
aaed594772 Simplify invoices and requests.
- We need only two types: PR_TYPE_ONCHAIN and PR_TYPE_LN
 - BIP70 is no longer a type, but an optional field in the dict
 - Invoices in the wallet are indexed by a hash of their serialized list of outputs.
 - Requests are still indexed by address, because we never generate Paytomany requests.
 - Add 'clear_invoices' command to CLI
 - Add 'save invoice' button to Qt
2019-09-12 20:11:20 +02:00
SomberNight
1b332748c3
qt console: fix commands that do not expect a 'wallet' arg 2019-09-12 19:22:55 +02:00
SomberNight
b9af8bf60a
get_tx_fee: further follow-up 7b828359c6 2019-09-12 17:22:35 +02:00
ThomasV
3d04399581 follow-up 7b828359c6 2019-09-12 13:12:48 +02:00
ThomasV
79de0489e3 kivy: do not remove fee from tx value in history (minor) 2019-09-12 12:32:38 +02:00
ThomasV
7b828359c6 simplify get_tx_fee 2019-09-12 12:26:49 +02:00
SomberNight
482605edbb wallet: organise get_tx_fee. store calculated fees. storage version 19. 2019-09-12 08:59:27 +02:00
ThomasV
5c83e8bd1c follow-up 241873f0a4 2019-09-12 08:58:58 +02:00
SomberNight
b138fff9a5
wallet: txi/txo small clean-up 2019-09-12 04:07:17 +02:00
SomberNight
241873f0a4
address_synchronizer.get_history now returns HistoryItem(NamedTuple)s 2019-09-12 04:06:51 +02:00
ThomasV
65b88dca86 return fees in history, show them in kivy GUI 2019-09-11 17:49:40 +02:00
ThomasV
a47a2c1b72 follow-up prev 2019-09-11 17:08:03 +02:00
ThomasV
1d82093ca1 fix bug in lightning get_history: filter settled htlcs first 2019-09-11 17:06:07 +02:00
ThomasV
30092cd68c kivy: request PIN to load_wallet only on android 2019-09-11 16:36:04 +02:00
ThomasV
215dc96de7 define LNWatcher.do_breach_remedy 2019-09-11 11:58:28 +02:00
ThomasV
7370910fee fix simple_config.estimate_fee 2019-09-11 11:49:32 +02:00
SomberNight
c531c72940
kivy: attempt at handling (some) exceptions on startup 2019-09-10 21:29:13 +02:00
SomberNight
a05dab2c4d
storage: read/write sanity checks
related: #4110
supersedes: #4528
2019-09-10 21:17:15 +02:00
SomberNight
4dda162336
qt wizard: turn 'temp_storage' into local variable 2019-09-10 20:19:41 +02:00
SomberNight
9eee36fe00
follow-up prev 2019-09-10 20:18:53 +02:00
SomberNight
098636c69a
fix tests 2019-09-10 19:39:52 +02:00
SomberNight
9c31c1f970
wallet: address_is_old is now checked using SPV (during sync) 2019-09-10 18:26:09 +02:00