Commit Graph

3676 Commits

Author SHA1 Message Date
Stephan Oeste a5acb7d695 add mempool.emzy.de
Same software as mempool.space other operator.
2020-11-22 01:43:47 +01:00
SomberNight 9fced6d2b1 qt send tab: "max" btn should not raise NotEnoughFunds due to fees
If a tx cannot be constructed due to current fee settings, try to
create one with zero miner fees instead and let user to change the
fee later.

fixes #6755
2020-11-21 19:35:27 +01:00
ThomasV 32ffc9e9a4 convert Qt flags to int (fix Qt DeprecationWarning) 2020-11-21 12:15:24 +01:00
ThomasV dfcdcb8d64 fix typo 2020-11-20 08:51:01 +01:00
ThomasV 0b183444b4 Rename maybe_init_lightning(). Call load_data() from there 2020-11-20 08:35:57 +01:00
SomberNight 13563697f5 exchange_rate: log full traceback in case of unexpected exception
related: #6748
2020-11-20 01:45:11 +01:00
SomberNight 57768244bb qt history list: fix #6746 2020-11-18 23:50:08 +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
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 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
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
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
- https://github.com/brianddk/reddit/blob/8ca383c9e00cb5a4c1201d1bab534d5886d3cb8f/python/elec-p2sh-hodl.py
- https://github.com/brianddk/reddit/blob/8ca383c9e00cb5a4c1201d1bab534d5886d3cb8f/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