Commit Graph

3897 Commits

Author SHA1 Message Date
ThomasV 4febbcdc2d encapsulate get_routing_info in lnaddr 2021-02-07 12:21:00 +01:00
ThomasV 0c93394513 rename lnworker._pay to pay_invoice, call it directly from GUIs 2021-02-07 12:09:37 +01:00
Gordan Nekić 9c4807644b Fix ledger sign message (#7004)
there was an around ~1/128 chance of creating an invalid signature when signing a message with a ledger
2021-02-06 05:16:52 +00:00
bitromortac 2bffc9d3eb lnpeer: fix timed out mpp 2021-02-05 21:52:13 +01:00
ThomasV c01ca101e0 minor: fix typo 2021-02-05 17:24:15 +01:00
ThomasV 34734bd229 cleanup, follow-up f28a2aae73 2021-02-05 17:09:47 +01:00
ThomasV cc69cf3f33 Qt: fix deprecation warning 2021-02-05 16:43:00 +01:00
ThomasV f28a2aae73 Reorganize code so that we can send Multi Part Payments:
- LNWorker is notified about htlc events and creates payment events.
 - LNWorker._pay is a while loop that calls create_routes_from_invoice.
 - create_route_from_invoices should decide whether to split the payment,
   using graph knowledge and feedback from previous attempts (not in this commit)
 - data structures for payment logs are simplified into a single type, HtlcLog
2021-02-05 14:28:58 +01:00
ThomasV 1102ea50e8 fix tests (follow-up previous commit) 2021-02-05 11:57:19 +01:00
ThomasV ff8fc798f4 follow-up c0bf9b4509 2021-02-05 11:33:45 +01:00
ThomasV ef5a265449 basic_mpp: receive multi-part payments 2021-02-04 16:31:17 +01:00
ThomasV c0bf9b4509 LNWorker: do not save PR_INFLIGHT status, detect it on startup instead 2021-02-04 16:30:50 +01:00
zebra-lucky d53d4e46e6 paymentrequest: check network on PaymentRequest parse 2021-02-04 07:32:37 +02:00
rage-proof cb3977798c add function to determine script-type for all inputs in a psbt (#6984)
* Add functions to determine the script type from a psbt.

* add a function inside PartialTransaction

* P2wsh uses the witness-script field to save the script.

* Limit the detection of script-types that are not multisig.
2021-02-04 02:52:40 +00:00
SomberNight 337d4890a1 lnworker/swaps: add '_sat' suffix to arg names and force kwargs 2021-02-01 22:11:56 +01:00
SomberNight 3d1796ab1d follow-up prev: fix units when calling lnworker.create_invoice: msat/sat
follow-up e477a43385
2021-02-01 22:08:09 +01:00
ThomasV e477a43385 PaymentInfo: use msat precision 2021-02-01 15:03:56 +01:00
SomberNight 1fb0c28d0a exchange_rate: (fix) rm need to restart app to disable FX rates
Previously if the user disabled FX rates in the settings, the UI
would keep showing the fiat amounts everywhere until the next time
the program was started. (and the rates would not even refresh anymore)
2021-01-29 19:53:04 +01:00
SomberNight 27cd078001 wallet: auto-freeze small unconfirmed UTXOs
see #6960
2021-01-29 12:37:15 +01:00
SomberNight 2b0f156ce8 lnpeer.htlc_switch: (bugfix) don't fulfill htlc until add is irrevocable
This makes the test added in prev commit pass.
2021-01-28 20:03:30 +01:00
SomberNight e8a2fa5596 tests: lnpeer.htlc_switch: don't fulfill htlc until add is irrevocable
This adds a failing test, where the HTLC switch fulfills an HTLC too soon,
before the corresponding 'update_add_htlc' is irrevocably committed.
2021-01-28 20:00:48 +01:00
ThomasV 521376f87f rm unused parameter in maybe_fulfill_htlc 2021-01-28 13:10:43 +01:00
ThomasV fe1b2149cb lnpeer: fix flen in INIT 2021-01-28 11:14:53 +01:00
SomberNight 1d9311aeef qt network dialog: show protocol (if ":t") for servers in NodesList 2021-01-27 20:46:56 +01:00
SomberNight d13995309a qt main_window: add error handling to show_bitcoin_paper
related: #6970
2021-01-27 20:46:53 +01:00
SomberNight 338adf05ba interface.get_transaction: stricter sanitisation
in particular, Transaction.__init__ allows leading/trailing whitespaces
2021-01-27 20:46:49 +01:00
SomberNight 7294613447 util.is_hex_str: forbid whitespaces 2021-01-27 20:46:46 +01:00
Jin Eguchi f548b63563 Fix error of showing bitcoin paper(testnet) 2021-01-27 03:34:19 +09:00
ThomasV d7515b936e Qt: download and show bitcoin whitepaper. fixes #6970 2021-01-26 16:25:07 +01:00
ThomasV d6e293052a Qt: set need_update on payment received (minor fix) 2021-01-25 13:34:40 +01:00
ThomasV 8a656d648b kivy: disable gossip button is channel_db is None 2021-01-24 15:45:11 +01:00
ThomasV 986de70529 Qt: fix invoices refresh (follow-up 94708f63e4) 2021-01-24 11:40:02 +01:00
ThomasV 895f9daded add 'view log' action for LN payments in tx history 2021-01-24 11:06:08 +01:00
SomberNight 1abecf25c9 qt block explorer: allow custom URL
The QTextEdit expects values such as (one per line):
```
https://blockstream.info/testnet/
https://192.168.0.38:3021/
("https://blockstream.info/testnet/", {'tx': 'tx/', 'addr': 'address/'})
```

closes #4831
2021-01-24 07:11:11 +01:00
SomberNight bc6f2926f4 commands: add 'freeze_utxo' cmd; to expose this to CLI/RPC 2021-01-22 21:56:11 +01:00
SomberNight da777caa0b wallet: use lock when modifying frozen_{addresses,coins} 2021-01-22 21:56:08 +01:00
SomberNight c4e9afa019 wallet.remove_transaction: also rm dependent/child txs
Main motivation is that I often use wallet.remove_transaction
from the Qt console, and would find this behaviour more intuitive.
Note that previously if one were to call this on a tx with children,
the crash reporter would appear with "wallet.get_history() failed balance sanity-check".

related: https://github.com/spesmilo/electrum/issues/6960#issuecomment-764716533
2021-01-21 18:05:48 +01:00
ThomasV 4f3a28b87e kivy: rename 'Channels' dialog to 'Lightning' 2021-01-21 14:32:48 +01:00
ThomasV a50af83b84 kivy: simplify swaps dialog 2021-01-21 14:12:19 +01:00
Neil Booth 8b5e312e7e qt: fix handling BIP21 URI from e.g. website on macOS
fixes #6933

based on https://github.com/Electron-Cash/Electron-Cash/commit/e2171f702d0e83abe368d3013dccc5ee3577be6a

Co-authored-by: SomberNight <somber.night@protonmail.com>
2021-01-21 04:41:03 +01:00
SomberNight 60792dc808 network: fix not retrying main interface in some cases
This was a regression from e83f0dd3fc,
introduced by the change in connection_down() there.
(if the initial connection to the main interface is not successful, the
network status will not be set to 'disconnected' - but it should be)
That change is now reverted here.
That change was somewhat independent of the rest of that commit,
except the rest highlighted that something of the sort was needed:
as it might sometimes take many seconds for an interface to close
and we might launch another interface for the same server while the
first one is still closing, the "server == self.default_server" test
is highly problematic.
To fix this second - original - issue, we now introduce a "closing" state
for interfaces (in the form of network._closing_ifaces).
2021-01-21 04:02:11 +01:00
SomberNight b1449a0a39 interface.got_disconnected: change from Future to Event
Events are far easier to reason about.
2021-01-21 03:11:15 +01:00
SomberNight e365eb0d85 (trivial) kivy: add missing import
follow-up 90d66953cf
2021-01-20 17:33:15 +01:00
SomberNight 1b3674b318 qt send: handle simultaneous NoDynamicFeeEstimates+NotEnoughFunds
fixes #6424
2021-01-20 16:25:03 +01:00
ThomasV 90d66953cf kivy: add confirm_tx_dialog, similar to qt 2021-01-19 14:15:07 +01:00
zebra-lucky 12c9de6bf9 qt: fix PayToEdit.parse_amount (#6951)
nicer error messages for malformed inputs
2021-01-18 22:07:29 +00:00
ThomasV 35c0565395 formatting (rm blank spaces) 2021-01-18 10:59:30 +01:00
bitromortac 08ec368baf fee-slider: fix dialog crashes for float pos values 2021-01-18 10:38:15 +01:00
bitromortac fe78ed2a8e swaps: add swaps to android 2021-01-18 10:38:15 +01:00
ThomasV 6522a1e1a3 fix #6341 2021-01-17 21:11:17 +01:00