Commit Graph

403 Commits

Author SHA1 Message Date
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
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
bitromortac
3c3a59c517 cli: remove enable/disable lightning 2020-10-22 18:05:51 +02:00
bitromortac
6045de759b lightning: enable by default but without gossip
Enables lightning by creating a node private key and storing it in
the wallet. The gossiper is not launched at start up, only if there
are existing channels.
2020-10-22 18:05:51 +02:00
SomberNight
c5da22a9dd network: tighten checks of server responses for type/sanity 2020-10-16 19:30:42 +02:00
SomberNight
3a4f07c345 wallet: implement cancelling tx by double-spending to self ("dscancel") 2020-10-09 17:36:37 +02:00
SomberNight
ca5b93f07d wallet: cpfp to send to a change address instead of receive address 2020-10-09 17:34:20 +02:00
SomberNight
ad03c1e3cb wallet: (fix) bump_fee and cpfp now returns tx with all wallet-info
Previously e.g. bip32 derivation info was missing for change outputs in partial tx returned by bump_fee.
This was not exposed to users as the GUI TxDialog calls `tx.add_info_from_wallet(self.wallet)`.
2020-10-08 19:30:02 +02:00
SomberNight
364fca6a58 transaction: fix regression: witness_utxo was not included in QR code
fixes #6600
2020-09-23 15:11:53 +02:00
ghost43
3eba26b398 LN cooperative close: avoid address-reuse (#6590)
Previously if we coop-closed multiple channels in the same session,
they would reuse the wallet address.
2020-09-15 15:37:47 +00:00
SomberNight
9931df9f25 storage: fix update-password edge-case
fixes #6400
2020-09-11 13:44:06 +02:00
SomberNight
9eb152ed98 keystore: improve check_password.
and add tests that exercise it

maybe fixes #4128
2020-09-11 13:42:12 +02:00
SomberNight
7e534f4865 dependencies: rm pyaes from requirements
Since #6014, pyaes is not really needed anymore.

As we currently require either one of pycryptodomex or cryptography,
even if pyaes is available, it will not be used.
We could strip it out completely from crypto.py...

In any case, pyaes is still pulled in by some hw wallet dependencies indirectly;
but the core library no longer depends on it.
2020-09-08 16:44:20 +02:00
SomberNight
8dc3fadd13 tests: add tests for #6066 and #6401. latter is failing atm.
see #6066
see #6401
2020-09-03 18:04:27 +02:00
SomberNight
73cf007048 transaction: allow PSBT input to have both UTXO and WITNESS_UTXO
- make sure they are consistent
- only keep one of them internally (UTXO), and only serialise with UTXO (not both)

fixes #6429
2020-07-22 02:44:33 +02:00
SomberNight
307403a02c invoices: rm old corrupted non-bip70 invoices
fixes #6345
2020-07-08 00:57:23 +02:00
SomberNight
faafb70d4c follow-up prev
(committed wrong raw tx literal)
2020-06-28 17:45:00 +02:00
SomberNight
29534dcf3d commands: allow setting custom 'nsequence' in 'serialize' cmd
closes #6297
2020-06-28 17:26:52 +02:00
SomberNight
10c2183461 handle_error_code_from_failed_htlc: omg brainfart :(
follow-up 85841ba20d
2020-06-24 21:33:44 +02:00
SomberNight
662d0d92bd remote watchtower: enforce that SSL is used, on the client-side 2020-06-24 16:57:50 +02:00
SomberNight
d5f368c584 LN invoices: support msat precision
fixes #6250
2020-06-22 22:48:13 +02:00
SomberNight
b6db201570 util: small clean-up for format_satoshis 2020-06-22 02:46:16 +02:00
SomberNight
2eec7e1600 network: smarter switch_unwanted_fork_interface
Previously this function would not switch to a different chain if the
current chain contained the preferred block. This was not the intended
behaviour: if there is a *stronger* chain that *also* contains the
preferred block, we should jump to that.

Note that with this commit there will now always be a preferred block
(defaults to genesis). Previously, it might seem that often there was none,
but actually in practice if the user used the GUI context menu to switch
servers even once, there was one (usually genesis).

Hence, with the old code, if an attacker mined a single header which
then got reorged, auto_connect clients which were connected to the
attacker's server would never switch servers (jump chains) even
without the user explicitly configuring preference for the stale branch.
2020-06-21 11:31:54 +02:00
SomberNight
2580832a88 fix travis: regtest tests were failing with bitcoind 0.20
see https://github.com/bitcoin/bitcoin/pull/16524
2020-06-17 18:15:59 +02:00
SomberNight
725b6f1564 crypto: chacha20-methods: make associated_data param optional 2020-06-17 17:32:51 +02:00
SomberNight
e59eb147c0 lnchannel.available_to_spend: LOCAL now respects "fee spike buffer" 2020-06-15 15:43:41 +02:00
SomberNight
23ea64808d fix tests: follow-up prev 2020-06-13 18:53:50 +02:00
Jin Eguchi
4a18100e6b Fix typos 2020-06-12 05:48:19 +09:00
SomberNight
3509343447 ln: make 'to_self_delay' CSV configurable
needed for tests
2020-06-09 18:36:34 +02:00
SomberNight
7bcb59ffb5 wallet: when sweeping, do network reqs in parallel, and don't block GUI 2020-06-05 20:30:25 +02:00
SomberNight
e07d5d8422 fix tests: follow-up psbt changes
follow-up e058ee2957

the difference for each tx here is that
- the old ones had witness utxo but not utxo
- the new ones have utxo but not witness utxo
2020-06-03 21:24:05 +02:00
SomberNight
1978bba915 fix tests: follow-up 154b9cab50 2020-06-03 19:00:28 +02:00
SomberNight
e6e587b7da trustedcoin: use psbt format on wire. rm psbt to legacy tx conversion.
closes #6123
2020-05-29 18:58:30 +02:00
ThomasV
2adbbee5fe Add extra state to distinguish shutdown negotiation from post-
negotiation, where channel should not be reestablished. See #6182
2020-05-29 18:00:52 +02:00
SomberNight
f9de6a5354 tests: lnpeer: make debug htlc failure hooks more uniform 2020-05-14 19:15:32 +02:00
ThomasV
d3fb68575d daemon.py: Add authentication to Watchtower.
Define abstract class AuthenticatedServer
2020-05-12 10:12:30 +02:00
ThomasV
2fed218452 follow-up prev commit (fix regtest) 2020-05-12 09:22:39 +02:00
ThomasV
11aaa0b66f Simplify services (watchtower, payserver):
- Do not expose services settings in GUI
 - Use a single netaddress configuration variable.
2020-05-10 14:52:50 +02:00
SomberNight
619f8555f5 follow-up prev: trivial rename
Just realised that the "diamond" graph is actually defined in Graph Theory
but it has an extra edge. What we have here is apparently called a "square" graph.
Not that it matters much but might as well name it as such then...
2020-05-06 11:27:50 +02:00
SomberNight
cc4029c335 test_lnpeer: add some multi-hop payment unit tests 2020-05-06 11:06:44 +02:00
SomberNight
63b18dc30f lnrouter: add PathEdge/LNPaymentPath for (node_id, scid) 2020-05-06 11:06:37 +02:00
SomberNight
04d018cd0f test_lnpeer: some clean-up, make it easier to add "num_node>2" tests 2020-05-06 11:06:33 +02:00
ThomasV
5c05c06bf0 follow-up prev commit: fix test_lnpeer 2020-05-05 21:18:17 +02:00
ThomasV
7cbb102c81 add test with fail_malformed_htlc to forwarding regtest 2020-05-05 09:04:17 +02:00
ThomasV
ab188ff375 add config variable to test update_fail_malformed_htlc 2020-05-04 20:31:44 +02:00
ThomasV
8ba7e68064 fix #6122: extract preimage from on-chain htlc_tx 2020-05-03 16:03:27 +02:00
SomberNight
6f7a4ab048 lnpeer: add get_channel_by_id, for small speed-up 2020-04-30 21:13:29 +02:00
SomberNight
b9b53e7f76 lnworker: fix threading issues for .channels attribute
external code (commands/gui) did not always take lock when iterating lnworker.channels.
instead of exposing lock, let's take a copy internally (as with .peers)
2020-04-30 21:08:26 +02:00
SomberNight
223b62554e lntransport: use network proxy if available
fixes #4824
2020-04-15 21:44:09 +02:00
SomberNight
b5811e8072 lnworker.peers: fix threading issues 2020-04-15 21:43:58 +02:00