SomberNight
a53dded50f
bitcoin: avoid floating point in int_to_hex
2018-11-26 01:34:23 +01:00
SomberNight
d7c5949365
prefer int.from_bytes over int('0x'+hex, 16)
2018-11-26 01:16:26 +01:00
SomberNight
f04e5fbed6
crypto: fix pkcs7 padding check
...
related: ricmoo/pyaes#22
in practice, the only strings we would incorrectly accept are
(certain length of) all zero bytes
2018-11-22 18:21:19 +01:00
SomberNight
65ce3deeaa
blockchain: chain hierarchy based on most work, not length
2018-11-22 17:13:43 +01:00
SomberNight
141ff99580
blockchain.py: generalise fork ids to get rid of conflicts
2018-11-22 16:57:22 +01:00
SomberNight
a8e6eaa247
blockchain: fix difficulty retarget
...
"target" is a 256 bit int, but the "bits" field in the block headers
that is used to represent target is only 32 bits.
We were checking PoW against the untruncated target value, which is a
slightly larger value than the one that can actually be represented,
and hence we would have accepted a slightly lower difficulty chain
than what the consensus requires.
2018-11-22 16:52:51 +01:00
SomberNight
55963bd092
network: oneserver should be bool
...
fix #4858
2018-11-20 11:59:06 +01:00
SomberNight
36f64d1ad9
bitcoin/ecc: some more type annotations
2018-11-18 22:07:27 +01:00
SomberNight
5376d37c24
history export: include tx fee
...
closes #3504
2018-11-18 16:46:07 +01:00
SomberNight
32af83b7ae
wizard/hw: show transport type when listing HWDs
2018-11-16 19:03:25 +01:00
SomberNight
eba97f74b4
decorate some methods with @profiler to debug slow startup
2018-11-16 14:39:22 +01:00
ghost43
4d62963efe
qt: count wizards in progress ( #4349 )
...
fixes #4348
2018-11-14 22:39:49 +01:00
SomberNight
f767d41409
tests: spanish test case for mnemonic.py, and refactoring
2018-11-14 18:58:27 +01:00
Calin Culianu
75e30ddc9d
Show description (label) in TxDialog screen when opened from History ( #4775 )
2018-11-14 16:43:58 +01:00
SomberNight
e1c66488b1
paymentrequest: don't show PaymentAck to user
...
mainly because the main "merchant" using bip70 is bitpay, and they
are failing all the PaymentAcks due to the tx is using RBF...
no need to confuse users.
follow-up 1686a97ece
2018-11-14 16:33:41 +01:00
ThomasV
f7f4fef156
Merge pull request #4827 from SomberNight/android_oneserver
...
implement oneserver option for kivy
2018-11-14 16:13:05 +01:00
SomberNight
e059867314
paymentrequest: be explicit about only allowing "addresses"
2018-11-14 16:04:43 +01:00
ThomasV
a266de6735
PrintError: display verbosity filter
2018-11-14 13:16:08 +01:00
SomberNight
e1b85327be
transaction: clean-up multisig_script
2018-11-14 00:37:03 +01:00
SomberNight
e04e8d2365
plugins: when loading plugins, use newer importlib mechanism
...
fixes #4842
2018-11-11 23:55:34 +01:00
SomberNight
48b0de7871
keystore: stronger pbkdf for encryption
2018-11-10 16:36:41 +01:00
SomberNight
aceb022f9d
crypto: more type annotations
2018-11-10 13:30:34 +01:00
SomberNight
a6a003a345
RBF batching: fix logic bug
2018-11-09 22:47:41 +01:00
SomberNight
2ab8234e9c
RBF batching: smarter fee handling
2018-11-09 20:04:06 +01:00
SomberNight
d905f0e55e
RBF batching: for now, let user deal with fee problems (honour slider)
2018-11-09 19:15:46 +01:00
SomberNight
436f6a4870
qt history export: include fiat value in csv
2018-11-09 18:48:12 +01:00
SomberNight
71ac3bb305
RBF batching: some fixes
2018-11-09 17:56:42 +01:00
ThomasV
f55db2f90b
add batch_rbf option to Qt GUI
2018-11-09 17:29:31 +01:00
ThomasV
2b8d801b36
if possible, batch new transaction with existing rbf transaction
2018-11-09 16:33:29 +01:00
SomberNight
bd32b88f62
introduce UserFacingException
...
we should not raise generic Exception when wanting to communicate with
the user. it makes distinguishing programming errors and messages hard,
as the caller will necessarily need to catch all Exceptions then
2018-11-08 19:46:15 +01:00
SomberNight
dace2e5495
trezor: don't let bridge transport failing block all other transports
...
[trezor] connecting to device at bridge:hid...
[trezor] connected to device at bridge:hid...
Traceback (most recent call last):
File "...\electrum\electrum\base_wizard.py", line 255, in choose_hw_device
u = devmgr.unpaired_device_infos(None, plugin, devices=scanned_devices)
File "...\electrum\electrum\plugin.py", line 501, in unpaired_device_infos
client = self.create_client(device, handler, plugin)
File "...\electrum\electrum\plugin.py", line 374, in create_client
client = plugin.create_client(device, handler)
File "...\electrum\electrum\plugins\trezor\trezor.py", line 124, in create_client
client = self.client_class(transport, handler, self)
File "...\electrum\electrum\plugins\trezor\client.py", line 7, in __init__
ProtocolMixin.__init__(self, transport=transport)
File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 444, in __init__
self.init_device()
File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 454, in init_device
self.features = expect(proto.Features)(self.call)(init_msg)
File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 115, in wrapped_f
ret = f(*args, **kwargs)
File "...\Python36-32\lib\site-packages\trezorlib\client.py", line 129, in wrapped_f
client.transport.session_begin()
File "...\Python36-32\lib\site-packages\trezorlib\transport\__init__.py", line 42, in session_begin
self.open()
File "...\Python36-32\lib\site-packages\trezorlib\transport\bridge.py", line 69, in open
raise TransportException('trezord: Could not acquire session' + get_error(r))
trezorlib.transport.TransportException: trezord: Could not acquire session (error=400 str=wrong previous session)
[DeviceMgr] error getting device infos for trezor: trezord: Could not acquire session (error=400 str=wrong previous session)
2018-11-08 17:07:05 +01:00
SomberNight
47b6d3c52c
wizard: make native segwit (bech32) the default for bip39/hw
2018-11-08 13:01:40 +01:00
ThomasV
3d4773b161
wizard: make segwit/bech32 the default choice during wallet creation
2018-11-07 15:03:54 +01:00
SomberNight
7d114ff32d
cpfp: don't reuse address
2018-11-07 14:48:33 +01:00
ThomasV
39fb5b8f58
use blockstream.info as default block explorer
2018-11-07 12:38:29 +01:00
neoCogent
6d5b28a9c5
add blockstream.info as explorer option ( #4829 )
2018-11-07 02:18:00 +01:00
SomberNight
8b61d18a9f
transaction.serialize_output: use namedtuple fields
2018-11-06 17:04:12 +01:00
SomberNight
5d52dc204c
coldcard: fix spending when there is no change
...
follow-up 9037f25da1
2018-11-06 16:17:18 +01:00
SomberNight
1686a97ece
bip70 PRs: use aiohttp instead of requests. use proxy. small fixes.
2018-11-05 19:31:17 +01:00
SomberNight
1b46866e34
qt: re sweeping, minor clean-up
2018-11-05 01:53:35 +01:00
SomberNight
a89e67eeed
network: trivial clean-up
2018-11-04 19:25:23 +01:00
SomberNight
160bc93e26
implement oneserver option for kivy
...
closes #4826
2018-11-03 17:21:38 +01:00
SomberNight
7a46bd1089
network: minor clean-up
2018-11-03 17:11:08 +01:00
SomberNight
908c979338
network: update hardcoded mainnet servers
2018-11-02 20:38:26 +01:00
SomberNight
1a5c77aa82
follow-up prev
2018-11-02 20:37:37 +01:00
SomberNight
e37da62a1c
fix most "scripts"
...
related: #4754
2018-11-02 20:14:59 +01:00
SomberNight
5c4a6c0f2b
rm network.add_job
...
current implementation is prone to race, and is not used anyway
2018-11-02 16:06:47 +01:00
SomberNight
c2ecfaf239
move event loop construction to daemon
2018-11-01 16:30:03 +01:00
SomberNight
ca8eae919f
daemon: clarify error print
2018-10-31 19:59:07 +01:00
SomberNight
0862fdb9a9
plugins: somewhat clearer exception is loading plugin fails
...
see #4817 (issuecomment-434778055)
2018-10-31 18:33:28 +01:00
SomberNight
386e0d560e
wizard,hw: tell user about errors during plugin init
...
see #4817 (issuecomment-434765570)
2018-10-31 17:58:47 +01:00
SomberNight
4f7283a3b0
expose electrum version as __version__
2018-10-31 16:21:04 +01:00
SomberNight
1c63bca2c7
follow-up prev
2018-10-30 19:19:46 +01:00
SomberNight
5b4fada2a0
fix some network.get_transaction calls
...
see #4814 (issuecomment-434392195)
2018-10-30 19:07:37 +01:00
SomberNight
f53b480f1c
wallet: more powerful add_input_info
...
tangentially related: #4814
also recognise that input is_mine if tx was not fully parsed
but we have the prevout UTXO
2018-10-29 21:34:44 +01:00
SomberNight
f819e9b6f4
openalias: minor clean-up
2018-10-29 17:09:23 +01:00
SomberNight
5e0179dac4
qt console: expose more refs, and fix auto-complete for >2 depth
2018-10-29 00:20:45 +01:00
SomberNight
9037f25da1
kill old-style namedtuples
2018-10-28 00:28:29 +02:00
SomberNight
34569d172f
wallet: make importing thousands of addr/privkeys fast
...
fixes #3101
closes #3106
closes #3113
2018-10-27 17:36:10 +02:00
SomberNight
917b7fa898
network shutdown safety belts
2018-10-26 22:43:33 +02:00
SomberNight
416b687054
storage: add a sanity check
...
see #4803
2018-10-26 19:31:20 +02:00
SomberNight
78258a3a95
fix #4802
2018-10-26 18:45:36 +02:00
SomberNight
bcdb0c46fc
update to aiorpcx 0.9 and require it
2018-10-26 17:06:42 +02:00
SomberNight
791e0e1a67
move relayfee and dust_threshold to bitcoin.py
2018-10-25 23:08:59 +02:00
SomberNight
99d18a48f2
types: make some import conditional
2018-10-25 23:01:53 +02:00
SomberNight
082a83dd85
rename crypto.Hash to sha256d
2018-10-25 22:28:24 +02:00
SomberNight
a88a2dea82
split bip32 from bitcoin.py
2018-10-25 22:20:33 +02:00
SomberNight
c61e13c1e9
add more block explorers, and change defaults
2018-10-25 18:27:41 +02:00
Andrew Zhuk
07a06b5d15
Update util.py ( #4797 )
...
Adding Bitupper Explorer to the list
2018-10-25 17:09:52 +02:00
SomberNight
361ffc0620
correctly handle bitcoin URIs if GUI is already running
...
see #4796
2018-10-25 00:18:14 +02:00
SomberNight
0e6160bf2d
follow-up prev: bad idea to eval translated string
2018-10-23 03:01:23 +02:00
SomberNight
b68729115a
qt wallet information: added keystore type
2018-10-23 02:54:54 +02:00
SomberNight
2a60a701bf
qt wallet information: show has_seed and watching_only
2018-10-22 23:47:34 +02:00
SomberNight
2d352bc3f0
transaction.BIP69_sort: use namedtuple fields
2018-10-22 20:43:31 +02:00
SomberNight
c4e09fa874
simplify Plugins constructor
2018-10-22 18:21:38 +02:00
SomberNight
81cc20039e
more type annotations in core lib
2018-10-22 16:41:25 +02:00
SomberNight
6958c0ccc3
config: reject non-json-serialisable writes
...
see #4788
2018-10-21 14:58:55 +02:00
SomberNight
ef2a6359e4
fix SSL log spam on py3.7
...
based on kyuupichan/electrumx@83813ff1ac
see pooler/electrum-ltc#191
2018-10-21 03:09:47 +02:00
SomberNight
637e65efe3
network.stop: fix await
2018-10-20 23:17:10 +02:00
ghost43
c47533f6cf
Merge pull request #4784 from Coldcard/fix4729
...
Fix Coldcard plugin's p2wpkh-p2sh support (see issue #4729 )
2018-10-19 22:27:46 +02:00
SomberNight
bf18e2bbc9
follow-up prev
2018-10-19 22:24:42 +02:00
SomberNight
10a4c7a6ed
wallet.mktx: add new args: rbf, nonlocal_only
...
used on lightning branch
2018-10-19 20:48:48 +02:00
SomberNight
e8bc025f5c
verifier: fix race in __init__
2018-10-19 18:10:04 +02:00
Peter D. Gray
14b4955a6f
Fix p2wpkh-p2sh support per issue #4729
2018-10-18 12:38:47 -04:00
SomberNight
60f8cf665e
dnssec: trivial clean-up
2018-10-14 04:23:42 +02:00
SomberNight
0e59bc1bc5
network: "switch unwanted fork" should check what fork we are on..
...
follow-up #4767
2018-10-14 04:23:10 +02:00
SomberNight
1af225015a
fix some type annotations involving tuples
2018-10-13 05:16:36 +02:00
SomberNight
7c4d6c6801
fix #4771
2018-10-13 04:22:53 +02:00
SomberNight
5afdc14913
util: small clean-up re format_satoshis
...
related #4771
2018-10-13 04:21:07 +02:00
SomberNight
8fa6bd2aac
network: add_job
2018-10-12 19:03:36 +02:00
SomberNight
e3b372946a
rm aiosafe decorator. instead: log_exceptions and ignore_exceptions
2018-10-12 18:36:48 +02:00
SomberNight
372921b423
mv NetworkJobOnDefaultServer to util
...
break ref cycles
2018-10-12 16:09:41 +02:00
ThomasV
684e69763a
Merge pull request #4767 from SomberNight/auto_jump_forks
...
network: auto-switch servers to preferred fork (or longest chain)
2018-10-12 10:50:47 +02:00
ThomasV
cd5152a02d
Merge pull request #4765 from SomberNight/cli_restore_cmd
...
cli/rpc: 'restore' and 'create' commands are now available via RPC
2018-10-12 10:48:09 +02:00
SomberNight
1233309ebd
cli/rpc: 'restore' and 'create' commands are now available via RPC
2018-10-11 20:57:15 +02:00
SomberNight
37206ec08e
network: auto-switch servers to preferred fork (or longest chain)
...
If auto_connect is enabled, allow jumping between forks too.
(Previously auto_connect was only switching servers on a given fork,
not across forks)
If there is a preferred fork set, jump to that (and stay);
if there isn't, always jump to the longest fork.
2018-10-11 20:07:19 +02:00
SomberNight
1ef804c652
small import clean-up
2018-10-11 16:30:30 +02:00
ThomasV
cd5453e477
Merge pull request #4753 from SomberNight/synchronizer_rewrite
...
restructure synchronizer
2018-10-10 20:46:17 +02:00
SomberNight
150e27608b
wallet: rm electrum_version field
2018-10-10 20:26:12 +02:00
ThomasV
e975727075
follow-up prev commit
2018-10-10 19:26:02 +02:00
ThomasV
bb9871ded7
simplify prev commit
2018-10-10 19:24:24 +02:00
ThomasV
f037f06e74
Merge pull request #4758 from SomberNight/qt_fork_icon
...
qt network status: display 'fork' in icon when chain split is detected
2018-10-10 19:18:11 +02:00
SomberNight
87b05e1c9e
network: change broadcast_transaction api
...
raise exceptions instead of weird return values
closes #4433
2018-10-10 15:56:41 +02:00
ThomasV
c7833b8bc0
Merge pull request #4727 from SomberNight/refresh_gui_f5
...
qt: refresh gui with "F5"
2018-10-10 10:53:00 +02:00
SomberNight
cc18f66793
network: don't save negative ETA fee estimates
...
-1 means bitcoind could not give an estimate
2018-10-09 12:03:38 +02:00
Mark B Lundeberg
508793b010
qt transaction_dialog: normal close if user presses Esc
...
(Electron-Cash/Electron-Cash#890 )
2018-10-09 01:14:33 +02:00
SomberNight
dc1a31d802
fix tests
...
follow-up 70cca3bad9
2018-10-07 18:43:35 +02:00
SomberNight
f3f2534877
qt status: display "loading wallet" temporarily
...
this will likely only be visible for large wallets;
it gets overwritten by update_status()
2018-10-07 17:59:32 +02:00
SomberNight
70cca3bad9
fix #4759
2018-10-07 17:50:52 +02:00
SomberNight
decb8bfd52
qt network status: display 'fork' in icon when chain split is detected
2018-10-05 00:16:06 +02:00
SomberNight
d759546b32
qt console: fix word wrap
2018-10-03 18:26:09 +02:00
SomberNight
02f108d927
restructure synchronizer
...
fix CLI notify cmd. fix merchant websockets.
2018-10-03 17:13:46 +02:00
SomberNight
788b5b04fe
ledger: always use finalizeInput in sign_transaction
...
related #4749
2018-10-02 15:52:24 +02:00
SomberNight
a61953673a
fees: add 1-2 s/b static options
2018-10-02 15:44:09 +02:00
SomberNight
da9d1e6001
network: ensure there is a main interface
...
scenario with previous code:
auto_connect enabled, there is only one server in regtest environment.
client started before server; client would not switch to server after it is started.
2018-10-01 18:16:37 +02:00
SomberNight
7dd4032cce
daemon: call self.start in __init__, and allow not to listen on jsonrpc
2018-10-01 17:56:51 +02:00
SomberNight
4653a1007c
daemon: more convenient constructor for scripts
2018-10-01 15:49:26 +02:00
SomberNight
626828e980
fix sweeping
2018-10-01 05:16:03 +02:00
SomberNight
4d43d12abf
transaction: don't convert p2pk to p2pkh address when displaying
...
also closes #4742
2018-10-01 04:58:26 +02:00
SomberNight
ab1ec57429
trezor and clones: rm dead code
...
see Electron-Cash/Electron-Cash#872
see Electron-Cash/Electron-Cash#874
2018-09-30 02:10:17 +02:00
SomberNight
8aebb8249a
keepkey: full segwit support
...
ported from trezor plugin
needs new fw to work (5.8??)
fixes #3462
2018-09-30 01:29:27 +02:00
SomberNight
70c32590a9
hw plugins: fix only_hook_if_libraries_available
...
follow-up f9a5f2e183
2018-09-30 00:25:36 +02:00
SomberNight
ce5cc135cd
transaction: make get_address_from_output_script safer
...
closes #4743
2018-09-29 19:47:55 +02:00
SomberNight
53fd6a2df5
transaction: always sort i/o deterministically
...
this was previously the caller's responsibility; now it's done implicitly when creating a txn
2018-09-28 19:17:45 +02:00
SomberNight
5e4a4ae16b
minor clean-up (prints/types/imports)
2018-09-28 17:58:46 +02:00
SomberNight
32d5305295
fix daemon.load_wallet
2018-09-28 16:43:25 +02:00
SomberNight
12e79ecd60
qt tx dialog: make input/output fields expand
...
based on Electron-Cash/Electron-Cash@169c137211
2018-09-27 21:44:18 +02:00
SomberNight
3e2c5e8656
network.best_effort_reliable: force DC if req times out; retry on new iface
2018-09-27 21:15:07 +02:00
SomberNight
4984890265
follow-up prev: make best_effort_reliable react faster to disconnects
2018-09-27 20:04:36 +02:00
SomberNight
6b8ad2d126
fix some CLI/RPC commands
2018-09-27 18:01:25 +02:00
SomberNight
c4f3fbaca0
labels: fix potential threading issues
...
also handle --offline
2018-09-25 21:23:44 +02:00
SomberNight
deda6535e0
bump min aiorpcx to 0.8.2
2018-09-25 19:22:37 +02:00
SomberNight
33d14e4238
some import clean-up in qt
2018-09-25 18:15:28 +02:00
SomberNight
9d7cf12244
follow-up prev: fix tests
2018-09-25 17:00:43 +02:00
SomberNight
952e9b87e1
network: clean-up. make external API clear. rm interface_lock (mostly).
2018-09-25 16:44:39 +02:00
SomberNight
7cc628dc79
synchronizer: fix adding duplicate addresses race
2018-09-24 17:37:09 +02:00
Ilya Shalyapin
4c8103af3b
move get_default_language to gui.qt.util
2018-09-23 14:11:50 +05:00
SomberNight
3be5b4b00f
network: fix some threading issues
2018-09-20 21:07:31 +02:00
SomberNight
1294608571
synchronizer: offload cpu-heavy address generation to other thread
2018-09-20 20:16:03 +02:00
SomberNight
172ddf4aaf
wallet: synchronize_sequence cleaned up a bit
2018-09-20 20:04:50 +02:00
SomberNight
55b582511e
fix deprecation warnings in regexes
2018-09-20 18:31:17 +02:00
SomberNight
002b8a99e2
synchronizer: make 'add' thread-safe, and some clean-up
2018-09-20 18:11:26 +02:00
SomberNight
eccb8ec2d6
normalize wallet file paths
...
fix #4020
fix #4126
2018-09-20 01:21:42 +02:00
SomberNight
61b5ce0451
fix import error
2018-09-20 01:20:13 +02:00
SomberNight
d50b36d314
daemon: suppress pop wallet failure
...
follow-up 3ec0ceba3e
related: #4126
2018-09-20 00:55:09 +02:00
SomberNight
9586157479
qt: refresh gui with "F5"
2018-09-19 22:12:02 +02:00
SomberNight
cedd518aea
mark 'blockchain_headers' file as sparse on windows
...
based on fyookball/electrum@647a6cc26d
2018-09-19 22:09:54 +02:00
SomberNight
855a70bc66
network: new trigger 'blockchain_updated'
...
follow-up af63913189
needed to update history tab when new blocks come,
to refresh the number of confirmations (icons/tooltips)
2018-09-19 21:56:09 +02:00
SomberNight
cbd91ba5b1
synchronizer: fix race
...
The synchronizer would sometimes not send 'wallet_updated' triggers
if it was fast enough to do all the work between two 0.1 sec ticks.
(is_up_to_date() would return True both before and after)
2018-09-19 21:41:10 +02:00
SomberNight
8ee1f140d8
interface: split run_fetch_blocks
...
The 'continue' in the middle was too easy to miss.
We want a 'network_updated' trigger from every interface,
not just the fastest.
2018-09-19 20:30:54 +02:00