1
0
Commit Graph

13049 Commits

Author SHA1 Message Date
SomberNight
6f105ae43b android build: bump targetSdkVersion to 29 (follow-up)
follow-up: 59e9337be0

For some reason, without this change, the first build works but subsequent builds fail.
Not sure what the cause is. This is why Travis builds work.
4.0.5
2020-11-18 20:22:13 +01:00
SomberNight
827f00896c update locale submodule 2020-11-18 20:19:38 +01:00
SomberNight
5c0430dced prepare release 4.0.5 2020-11-18 19:43:24 +01:00
SomberNight
16a326cdd3 qt receive tab: rename "create onchain" btn to "New Address" 2020-11-18 18:58:37 +01:00
SomberNight
3f04520d0f ledger: suppress traceback during device enumeration for locked device
ledger now gives an error if querying xpub while device is not (unlocked and in bitcoin app).
we do query the xpub however, to calc root fingerprint to be used as soft device id.

trace:

I | plugin.DeviceMgr | scanning devices...
D | util.profiler | DeviceMgr.scan_devices 3.4463
I | plugin.DeviceMgr | Registering <electrum.plugins.ledger.ledger.Ledger_Client object at 0x0000029DF6B08520>
E | gui.qt.installwizard.InstallWizard |
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 225, in checkDevice
    self.perform_hw1_preflight()
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 219, in perform_hw1_preflight
    raise e
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 179, in perform_hw1_preflight
    firmwareInfo = self.dongleObject.getFirmwareVersion()
  File "...\Python38\site-packages\btchip\btchip.py", line 563, 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 6700

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\electrum\base_wizard.py", line 317, in _choose_hw_device
    device_infos = devmgr.unpaired_device_infos(None, plugin, devices=scanned_devices,
  File "...\electrum\electrum\plugin.py", line 612, in unpaired_device_infos
    soft_device_id=client.get_soft_device_id(),
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 355, in run_in_hwd_thread
    return fut.result()
  File "...\Python38\lib\concurrent\futures\_base.py", line 439, in result
    return self.__get_result()
  File "...\Python38\lib\concurrent\futures\_base.py", line 388, in __get_result
    raise self._exception
  File "...\Python38\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 91, in get_soft_device_id
    self._soft_device_id = self.request_root_fingerprint_from_device()
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 259, in request_root_fingerprint_from_device
    child_of_root_xpub = self.get_xpub("m/0'", xtype='standard')
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 57, in catch_exception
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 111, in get_xpub
    self.checkDevice()
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 228, in checkDevice
    raise UserFacingException(_("Device not in Bitcoin mode")) from e
electrum.util.UserFacingException: Device not in Bitcoin mode
W | gui.qt.installwizard.InstallWizard | error getting device infos for ledger: Device not in Bitcoin mode
2020-11-18 15:36:15 +01:00
SomberNight
b78cbcffd1 ledger: fix enumerating ledger devices with new bitcoin app (1.5.1)
see https://github.com/bitcoin-core/HWI/issues/402
2020-11-18 15:36:11 +01:00
ThomasV
aaff48720f Qt lightning invoice dialog: make payment_hash copiable 2020-11-18 11:47:47 +01:00
SomberNight
f3c1313a4f coldcard: avoid creating keystore with testnet/mainnet mixed up
fixes #6722
2020-11-18 00:47:20 +01:00
SomberNight
fa8c751abf qt swap dialog: fix disabling "OK" btn if NotEnoughFunds 2020-11-17 19:44:33 +01:00
ghost43
5f39a2f29c Merge pull request #6740 from bitromortac/lnrater-followup
lnrater: follow-up for save channel db attribute accesses
2020-11-17 16:05:18 +00:00
SomberNight
59e9337be0 android build: bump targetSdkVersion to 29
as Google Play now mandates that as minimum
2020-11-17 16:54:24 +01:00
bitromortac
96c9a483d0 lnrater: follow-up
Add comment on node score and return copies of channel db dicts.
2020-11-17 10:48:42 +01:00
SomberNight
ef744f164b logging: make sure file logging uses utf8 encoding
--- Logging error ---
Traceback (most recent call last):
  File "...\Python38\lib\logging\__init__.py", line 1084, in emit
    stream.write(msg + self.terminator)
  File "...\Python38\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u26a1' in position 80: character maps to <undefined>
Call stack:
  File ".../electrum/run_electrum", line 466, in <module>
    main()
  File ".../electrum/run_electrum", line 384, in main
    handle_cmd(
  File ".../electrum/run_electrum", line 402, in handle_cmd
    d.run_gui(config, plugins)
  File "...\electrum\electrum\daemon.py", line 572, in run_gui
    self.gui_object.main()
  File "...\electrum\electrum\gui\qt\__init__.py", line 391, in main
    self.app.exec_()
  File "...\electrum\electrum\gui\qt\channels_list.py", line 308, in new_channel_with_warning
    self.new_channel_dialog()
  File "...\electrum\electrum\gui\qt\channels_list.py", line 390, in new_channel_dialog
    if not d.exec_():
  File "...\electrum\electrum\gui\qt\channels_list.py", line 358, in on_suggest
    nodeid = bh2u(lnworker.lnrater.suggest_peer() or b'')
  File "...\electrum\electrum\lnrater.py", line 257, in suggest_peer
    return self.suggest_node_channel_open()[0]
  File "...\electrum\electrum\lnrater.py", line 248, in suggest_node_channel_open
    self.logger.info(
Message: 'node rating for Bottlepay:\nNodeStats(number_channels=20, total_capacity_msat=167455866000, median_capacity_msat=8460000000.0, mean_capacity_msat=8372793300.0, node_age_block_height=71003, mean_channel_age_block_height=48581.39999999991, blocks_since_last_channel=507, mean_fee_rate=1e-06) (score 0.5034595626052799)'
Arguments: ()
2020-11-16 14:50:22 +01:00
SomberNight
ec0f91942d daemon: fix local RPC server error messages to conform to jsonrpc spec
fixes #6672
2020-11-14 19:59:59 +01:00
SomberNight
a5c6a570ae qt console: fix usage in --offline mode
fixes #6731
related: #6467
2020-11-14 19:36:54 +01:00
SomberNight
8c1c07a290 build: partially revert 3cd52e2d7b
new versions of yarl and multidict break the windows build as they
don't provide win32 wheels

see
https://github.com/aio-libs/multidict/issues/550
https://github.com/aio-libs/yarl/issues/535
2020-11-14 09:07:46 +01:00
SomberNight
7ac968b406 mac build: use a virtualenv instead of global python packages
This helps to avoid older versions of pip-installed dependencies interfering with the build.
2020-11-14 06:58:56 +01:00
SomberNight
3cd52e2d7b rerun freeze_packages 2020-11-14 05:21:33 +01:00
SomberNight
168801b7f8 contrib/freeze_packages.sh: trivial clean-up 2020-11-14 05:18:12 +01:00
SomberNight
77f75f102b mac build: bundle old PyQt5 so that .app runs on macOS 11 "Big Sur"
This is the time of the year Apple breaks our mac builds, as usual.
mac now has its own "binaries" requirements. This allows us to use
an older version of PyQt5 in the mac binaries. For some reason
if we bundle newer PyQt5, the built app will not start on macOS 11
(but will on older macOS).

related: #6461
in particular, see https://github.com/spesmilo/electrum/issues/6461#issuecomment-713888921
2020-11-14 05:17:24 +01:00
SomberNight
a4e342ac58 requirements: rename some files 2020-11-14 04:30:48 +01:00
SomberNight
c872c3194f qt "open channel" dialog: detect invalid remote node id sooner
and avoid the "please wait" text to be interpreted as a node id

related #6705
2020-11-13 19:21:37 +01:00
SomberNight
46e59d18f5 invoices: rename "Pending" to "Unpaid"
related #6711
2020-11-13 19:18:34 +01:00
SomberNight
df6dc8fcf2 fix python 3.6 compat
fix #6725

follow-up #6705
2020-11-11 19:47:37 +01:00
ThomasV
ea654ad740 Merge pull request #6705 from bitromortac/lnrater
lightning: reintroduce node recommendation
2020-11-09 10:06:13 +01:00
SomberNight
120da2783b util.randrange: use stdlib 'secrets' module instead of 'python-ecdsa' 2020-11-07 19:26:30 +01:00
bitromortac
f36d7872c3 qt: move local node id to info menu 2020-11-06 08:00:24 +01:00
bitromortac
085056532c guis: reintroduce suggest button 2020-11-06 08:00:24 +01:00
bitromortac
cc9e19409f lnrater: module for node rating
Introduces LNRater, which analyzes the Lightning Network graph for
potential nodes to connect to by taking into account channel capacities,
channel open times and fee policies. A score is constructed to assign a
scalar to each node, which is then used to perform a weighted random
sampling of the nodes.
2020-11-06 08:00:23 +01:00
SomberNight
1c07777e13 follow-up prev
ah, forgot to commit this file
2020-11-05 03:10:06 +01:00
SomberNight
c616c3bfad plugins/labels: better error message when using imported wallets
see #6703
2020-11-05 01:59:19 +01:00
SomberNight
193c29af87 wizard, multisig: on bip39/hw ks, only ask for script type for 1st ks
When setting up a multisig wallet, there is no point in asking for the
script type for each cosigner (bip39/hw) -- we can just ask for the
first one. If the first keystore is an electrum seed, we end up never asking :)
2020-11-05 01:02:11 +01:00
SomberNight
cc33b752e2 wizard: on adding bip39/hw ks, don't offer path scanning for multisig
follow-up #6219

for multisig, it's just confusing and useless as-is
2020-11-05 00:18:54 +01:00
SomberNight
fc97181aa5 config: fix get_fee_text for static fees
mismatching units
2020-11-04 01:49:57 +01:00
SomberNight
de80f68e4d interface: validate protocol-version negotiation on client-side too
related: https://github.com/romanz/electrs/issues/314
2020-11-03 20:45:31 +01:00
ThomasV
70b03cb920 Merge pull request #6698 from SomberNight/202010_qt_pay_ellipsis_dotdotdot
qt gui: send tab: change "Pay" button text to "Pay..."
2020-10-29 10:58:20 +01:00
SomberNight
802fe8c73a qt user interface: send tab: change "Pay" button text to "Pay..."
Ellipsis ("...") is sometimes used in UIs to suggest there will be an
additional modal dialog before executing the action.
2020-10-29 01:58:34 +01:00
ThomasV
c31ae86bb8 Merge pull request #6634 from SomberNight/202010_fix_main_script_hanging
fix main script hanging (not exiting after exception) in some cases
2020-10-28 16:22:39 +01:00
SomberNight
ea22d0073e config: distinguish knowing mempool is empty vs not having mempool_fees
config.mempool_fees is now [] if server claims mempool is ~empty,
and None if no valid histogram has been received from server.
(previously it used to be [] in both cases)
2020-10-27 18:55:39 +01:00
SomberNight
2232955a23 synchronizer: fix request_missing_txs(..allow_server_not_finding_tx=True)
fixes #6686
2020-10-26 14:29:10 +01:00
SomberNight
5481fd8af6 interface: validate field order in "mempool.get_fee_histogram" response 2020-10-26 02:07:30 +01:00
SomberNight
25d4a40d6e qt history tab: fix shortcut in HistoryModel.refresh() 2020-10-25 06:55:10 +01:00
SomberNight
b95525896f qt send tab: show friendlier error on mistyped bitcoin address 2020-10-25 04:24:31 +01:00
ghost43
8e9d6a4c91 Merge pull request #6685 from SomberNight/202010_bitcoin_script
bitcoin/transaction: construct_script, and clean-ups
2020-10-24 23:06:55 +00:00
SomberNight
200f547a07 ledger: fix compat with hw.1 - signing flow deadlocked
broke in 8a1b46d839ac24f77bfa5e3a1eed0cb7284b59eac5b685854c517f224c98dc44
2020-10-24 23:32:18 +02:00
SomberNight
03bdb4f1b7 Transaction.get_preimage_script: support custom legacy-p2sh inputs
tests based on
- 8ca383c9e0/python/elec-p2sh-hodl.py
- 8ca383c9e0/python/elec-p2wsh-hodl.py

note: I could not reproduce the signature for the p2wsh cltv spend linked above,
so I have created a new testnet output and spent that for that test (to make sure
our behaviour is consensus-valid).
2020-10-24 08:26:11 +02:00
SomberNight
eefb68c82b transaction: change Transaction.is_segwit_input(txin) to txin.is_segwit() 2020-10-24 08:03:13 +02:00
SomberNight
4c7a92f39c bitcoin: implement construct_script and use it 2020-10-24 07:49:06 +02:00
SomberNight
89bd520185 bitcoin: move construct_witness from transaction.py to bitcoin.py 2020-10-24 05:18:16 +02:00
ThomasV
59f7d4b02d fix #6676 and remove dead code 2020-10-23 11:31:04 +02:00