Commit Graph

11733 Commits

Author SHA1 Message Date
SomberNight ddeb176b3d kivy: fix open_channel (API was changed) 2019-11-23 20:50:30 +01:00
SomberNight 557987d4eb add/fix some open_channel related type hints 2019-11-23 20:28:46 +01:00
ThomasV 038036f350 minor follow-up prev commit 2019-11-23 19:56:40 +01:00
ThomasV fd8236538a Open lightning channels with partially signed tx.
Fixes #5379.
2019-11-23 19:49:12 +01:00
ThomasV 9c9ceb702a fix #5729 2019-11-23 15:12:16 +01:00
ThomasV b9e5edd704 fix #5728 2019-11-23 14:51:39 +01:00
ThomasV 06589df812 simplify add_transaction 2019-11-23 12:46:43 +01:00
ThomasV fc85dcead6 follow-up previous commit 2019-11-23 11:37:01 +01:00
ThomasV 6c62fb03ac fix #5733 2019-11-23 11:02:31 +01:00
SomberNight 88307357ec add some type hints
mostly related to hw wallets
2019-11-22 22:59:33 +01:00
SomberNight 770ae6d878 fix tests 2019-11-22 22:11:56 +01:00
SomberNight bda9a407d9 trivial: don't print frequent-case log line in lnpeer.mark_open 2019-11-22 21:37:15 +01:00
SomberNight 268e245322 lnpeer: only set initialized after both sent AND received "init"
had a trace where we tried to send "funding_locked" before being initialized:

D | lnpeer.Peer.[iq7zhmhck54vcax2vlrdcavq2m32wao7ekh6jyeglmnuuvv3js57r4id.onion:9735] | Sending FUNDING_LOCKED
E | lnworker.LNWallet | Exception in on_update_open_channel: AttributeError("'LNTransport' object has no attribute 'sk'")
Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 999, in wrapper
    return await func(*args, **kwargs)
  File "...\electrum\electrum\lnworker.py", line 674, in on_update_open_channel
    peer.send_funding_locked(chan)
  File "...\electrum\electrum\lnpeer.py", line 876, in send_funding_locked
    self.send_message("funding_locked", channel_id=channel_id, next_per_commitment_point=per_commitment_point_second)
  File "...\electrum\electrum\lnpeer.py", line 102, in send_message
    self.transport.send_bytes(raw_msg)
  File "...\electrum\electrum\lntransport.py", line 93, in send_bytes
    lc = aead_encrypt(self.sk, self.sn(), b'', l)
AttributeError: 'LNTransport' object has no attribute 'sk'
2019-11-22 21:33:56 +01:00
ThomasV 61dfcba092 Refactor channel states:
- persisted states are saved
 - state transitions are checked
 - transient states are stored in channel.peer_state
 - new channel states: 'PREOPENING', 'FUNDED' and 'REDEEMED'
 - upgrade storage to version 21
2019-11-22 20:14:54 +01:00
SomberNight c31fa059fe cli: clear up "rbf" arg for "payto" cmd in help text; and use eval_bool
related: #5791

(previously rbf was a str, and it was casted to a bool directly, i.e. only
the empty string "" evaluated as False)
2019-11-22 16:09:42 +01:00
SomberNight 420b1a6636 cli: load_wallet now auto-upgrades the WalletStorage when needed
previously it would bail out and just return False
2019-11-22 15:54:34 +01:00
SomberNight 3d88d6870c cli: fix load_wallet for storage-encrypted wallets 2019-11-22 15:48:22 +01:00
ThomasV 8e08ca7cb1 simplify network callbacks in lnworker 2019-11-22 15:06:37 +01:00
ThomasV b469df5283 check channel funding_tx amount and script in save_short_channel_id 2019-11-21 20:16:04 +01:00
SomberNight c2b0039935 bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +01:00
SomberNight 03cc63205f trivial: use logger.exception instead of traceback.print_exc 2019-11-21 17:55:00 +01:00
SomberNight 6f246a83b3 qt coin selection: allow selecting an empty set
Using this, the user can force "bump fee" not to add new inputs.

closes #5719
2019-11-21 17:46:00 +01:00
SomberNight 11f54aee60 qt utxo list: spend_list is now a set (and renamed)
this is a small performance improvement ("if x in spend_list" was linear)
and the "order" of selected coins does not matter anyway
2019-11-21 17:21:54 +01:00
SomberNight 216d9e3c4d lnpeer: (fix) force_close_channel was not awaited in some cases 2019-11-21 16:37:43 +01:00
ghost43 d5b27e5be1 Merge pull request #5787 from xaya/http-request-auth
Return 401 from RPC server for missing auth
2019-11-21 15:21:17 +00:00
Daniel Kraft 423c4b0695 Return 401 from RPC server for missing auth.
When no (supported) authentication is passed to the JSON-RPC server,
return a 401 HTTP error code instead of 403.  This indicates to the
client that authentication is required, and also requests that to be
sent using the "basic" method.  The previously-returned code 403 is now
only returned if authentication is passed but not valid.

There are some JSON-RPC clients out there that only send authentication
after a 401 code requested it.  Those fail to connect to the Electrum
RPC interface even if the correct password is configured.  Those same
clients can e.g. connect to Bitcoin Core successfully, which already
implements logic matching this change.

See also https://stackoverflow.com/questions/3297048/403-forbidden-vs-401-unauthorized-http-responses.
2019-11-21 15:16:37 +01:00
SomberNight 6b195437ed wallet: "future" txns num conf is now negative
flipped the sign so that TxMinedInfo.conf can be consistently used in inequalities
2019-11-21 05:01:59 +01:00
SomberNight 1526bc9ccf qt: consistently show tooltip when copying to clipboard 2019-11-21 03:01:55 +01:00
Johann Bauer 9fe7917118 Qt: Remove unused color from color scheme 2019-11-20 21:11:41 +01:00
SomberNight 06de2660cf kivy: support invoices with "max" amount
closes #5781
2019-11-20 19:29:29 +01:00
SomberNight 49284f716b wallet: bump fee now supports coin selection
related: #5719
2019-11-20 18:43:05 +01:00
SomberNight fec9677508 qt open channel: minor dialog fixes 2019-11-20 18:00:45 +01:00
SomberNight cd9477c0da ln: qt channel open: fix max channel size 2019-11-20 17:45:28 +01:00
SomberNight ae04434206 ln: update list of fallback nodes
with some popular nodes from 1ml.com
2019-11-20 17:14:14 +01:00
SomberNight 4057140e6a lightning qr codes: more robust parsing
kivy qr code handling did not accept "lightning:" prefix or uppercase
2019-11-20 03:21:59 +01:00
SomberNight d1c262def0 qt tx dialog: small clean-up in constructors 2019-11-19 22:17:52 +01:00
SomberNight 97056ae44d qt send tab: subtract 2fa fee when clicking "spend max" 2019-11-19 21:22:49 +01:00
SomberNight ca6654c102 qt send tab: don't allow paying multiple invoices that spend max '!' 2019-11-19 20:26:50 +01:00
SomberNight 710e9621b5 qt tx dialog: allow blanking feerate
Previously it was impossible to rm the last character in feerate_edit.
e.g. if you held down "backspace", we would keep refilling the field as soon
as it became empty.
2019-11-19 20:13:16 +01:00
SomberNight 13b858ab26 qt tx dialog: disable "Finalize" btn if tx is None
e.g. NotEnoughFunds due to too high fee
2019-11-19 19:35:57 +01:00
SomberNight 66ddedb97e qt tx dialog: small fee edit fix
scenario: enter extremely high feerate (which we cannot satisfy) then click into fee_edit.
At that moment, fee_edit is empty and both feerate_edit and fee_edit are considered frozen.
As fee_edit has priority, we would construct a tx with default fee.
Now, instead, we won't construct this default fee tx ~as if the click to fee_edit did not happen.
2019-11-19 19:29:10 +01:00
SomberNight 8bd27851a4 qt tx dialog: only allow "save as local" for complete txns 2019-11-19 18:41:44 +01:00
SomberNight aa3d817ef2 qt: clean-up imports 2019-11-18 20:56:49 +01:00
SomberNight b8e4ce9ba1 hardware wallets: handle when label is None
follow-up 56c3de0e1e
2019-11-18 18:13:26 +01:00
ThomasV aa37979100 fix #5761 2019-11-18 10:22:20 +01:00
ThomasV b9cf095e1a fix #5761 2019-11-18 05:48:21 +01:00
ThomasV ade47e331a Merge branch 'master' of github.com:spesmilo/electrum 2019-11-18 05:12:25 +01:00
ThomasV 47e0b4cd02 fix #5765 2019-11-18 05:12:13 +01:00
ghost43 f2ca651dc4 Merge pull request #5775 from JeremyRand/resolver-wallet
Fix missing wallet argument to _resolver
2019-11-18 02:11:06 +00:00
JeremyRand 643bc9d802 Fix missing wallet argument to _resolver 2019-11-18 01:31:33 +00:00