Commit Graph

13043 Commits

Author SHA1 Message Date
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
Zibster43
fcccb99a3b
Remove phishing server (#6660)
Currentlane.lovebitco.in is being actively used in the phishing attack against Electrum users.
This can be confirmed by looking at https://ra.pe or https://hodlister.co/server-verification.txt,
the server points directly to an ip in the /24 range being used by phishing ElectrumX servers (46.148.231.31) (https://check-host.net/ip-info?host=currentlane.lovebitco.in)

You can also confirm this by connecting directly to the node and attempt to broadcast a transaction.
2020-10-23 02:17:31 +00:00
SomberNight
ee24c74f19
lnchan.receive_revocation: tolerate not having htlc fail reason
If we get a revack after reestablish, but the fail_htlc was already
committed in a previous app-session, the fail_htlc will not be re-sent and
we will not have the reason (as it's not persisted).

fixes #6675
2020-10-23 02:35:20 +02:00
ThomasV
7110fde25d follow-up: fix qt lightning dialog if gossip is not started 2020-10-22 19:20:22 +02:00
ThomasV
f155f3aff5 start lngossip if instantiated; this saves a boolean 2020-10-22 18:48:27 +02:00
ThomasV
5d90790726 wallet.py: always instantiate lnbackups 2020-10-22 18:35:49 +02:00
bitromortac
1855bcb17d qt: reflect running gossip in lightning icon 2020-10-22 18:05:51 +02:00