Commit graph

56 commits

Author SHA1 Message Date
SomberNight
b1f606eaed lnchannel: start using "latest" and "next" instead of "current" and "pending"
"current" used to be "oldest_unrevoked"; and pending was "oldest_unrevoked + 1"
but this was very confusing...
so now we have "oldest_unrevoked", "latest", and "next"
where "next" is "latest + 1"
"oldest_unrevoked" and "latest" are either the same or are offset by 1
(but caller should know which one they need)

rm "got_sig_for_next" - it was a redundant sanity check, that really
just complicated things

rm "local_commitment", "remote_commitment", "set_local_commitment",
"set_remote_commitment" - just use "get_latest_commitment" instead
2019-08-20 09:03:12 +02:00
SomberNight
fdf8d8609b lnpeer: make feature-bit testing easier
so that we can always test like: self.localfeatures & FEATURE_BIT_OPT
2019-08-20 09:03:12 +02:00
SomberNight
c046f2cc1c lnhtlc: move 'next_htlc_id' from ChannelConfig to lnhtlc log 2019-08-20 09:03:12 +02:00
SomberNight
087994e39a lnchannel: move fee update logic to lnhtlc (and hopefully fix it) 2019-08-20 09:03:12 +02:00
ThomasV
3d7f7dfc82 revamp fee updates (draft) 2019-08-20 09:03:12 +02:00
ThomasV
a8ce8109be Perform breach remedy without sweepstore:
- add functions to lnsweep
 - lnworker: analyze candidate ctx and htlc_tx
 - watchtower will be optional
 - add test for breach remedy with spent htlcs
 - save tx name as label
2019-08-20 09:03:12 +02:00
SomberNight
acbb458ef7 set default to_self_delay to 1 day 2019-08-20 09:03:11 +02:00
ThomasV
8d77a7ecd8 save timestamps in htlc log 2019-08-20 09:03:11 +02:00
ThomasV
38f1436d78 post rebase fixes 2019-08-20 09:03:11 +02:00
ThomasV
8b12f481da lightning: display forwarded payments as a single history item 2019-08-20 09:03:11 +02:00
SomberNight
3a2ab149b9 lnchannel: add_htlc and receive_htlc now take and return UpdateAddHtlc
also fix undefined vars in _maybe_forward_htlc and _maybe_fulfill_htlc
in lnpeer
2019-08-20 09:03:11 +02:00
ThomasV
3dce65dc73 Rename lnchan, lnchannel_verifier, lnbase
Auto-completions are a pain if files share a long prefix
2019-08-20 09:03:11 +02:00
Janus
e6bd3959e0 ln: handle channel limits better, show remote limits in details dialog, replace rusty's testnet peer (doesn't work currently) 2019-08-20 09:03:11 +02:00
Janus
e56e849505 lnchan refactor
- replace undoing logic with new HTLCManager class
- separate SENT/RECEIVED
- move UpdateAddHtlc to lnutil
2019-08-20 09:03:11 +02:00
Janus
2c1fcb2f54 ln: remove EncumberedTransaction 2019-08-20 09:03:11 +02:00
Janus
864d910888 qt: channel_details: add more info: sent/received, channel id, funding tx, short channel id, node id 2019-08-20 09:03:11 +02:00
SomberNight
595cfcbb65 move sweeping methods from lnchan.py to new file
also sweep "received" htlcs from "our" ctx
also sweep htlcs from their ctx (non-breach)
extract ctn; included_htlcs_in_their_latest_ctxs
2019-08-20 09:03:11 +02:00
Janus
e3409d32ef channel details with list of htlcs 2019-08-20 09:03:11 +02:00
SomberNight
521fadb8cb lnutil: restructure channel config namedtuples (local/remote config) 2019-08-20 09:03:11 +02:00
SomberNight
5b7c801ca4 after rebase fixes 2019-08-20 09:03:11 +02:00
Janus
c8dcf0b471 lnwatcher: more detailed logging, support notifying test suite of txs 2019-08-20 09:03:11 +02:00
Janus
001bb4ca09 remove incorrect docstrings, attribute docstring sources where applicable 2019-08-20 09:03:10 +02:00
SomberNight
449ec013fe add licence headers to more files 2019-08-20 09:03:10 +02:00
Janus
15b0720f5e lightning channel reserves 2019-08-20 09:03:10 +02:00
Janus
0dfc9e512b fix co-op close 2019-08-20 09:03:10 +02:00
SomberNight
04ec7e9968 lnutil.make_funding_input: don't return payment pubkeys
order depends on who is initiator anyway
2019-08-20 09:03:10 +02:00
Janus
1f97a9753e redeem htlc outputs of our local commitment transaction back to wallet 2019-08-20 09:03:10 +02:00
SomberNight
7edbd5682a fix confusion re max path length 2019-08-20 09:03:10 +02:00
SomberNight
2fafd01945 protect against getting robbed through routing fees 2019-08-20 09:03:10 +02:00
SomberNight
d511ecdc00 start failing htlcs 2019-08-20 09:03:10 +02:00
Janus
eabe23f6b8 make function for determining who pays fee 2019-08-20 09:03:10 +02:00
ThomasV
a0acec9720 gather definitions of LN exceptions 2019-08-20 09:03:10 +02:00
ThomasV
409a336071 fix tests (follow-up previous commit) 2019-08-20 09:03:10 +02:00
ThomasV
445252284f move transport code to its own file 2019-08-20 09:03:10 +02:00
Janus
b26dc66567 lnhtlc: only store feerate once, don't store heights since we do not roll back 2019-08-20 09:03:10 +02:00
Janus
e8471e483b lnhtlc: merge config and state, remove unnecessary properties 2019-08-20 09:03:10 +02:00
SomberNight
eced61123d clean up local/global features 2019-08-20 09:03:10 +02:00
ThomasV
11c3ca281c create sweep transaction outside of lnwatcher 2019-08-20 09:03:10 +02:00
SomberNight
17457327ef make key derivation reasonable
no more hardcoded secrets, no more key-reuse
2019-08-20 09:03:10 +02:00
Janus
5859054095 fix lnwatcher for channels initiated by remote 2019-08-20 09:03:10 +02:00
SomberNight
fb8deecb57 lnutil: missing import 2019-08-20 09:03:10 +02:00
Janus
efc8d50570 move connection string decoding to lnworker, fix test_lnutil 2019-08-20 09:03:10 +02:00
Janus
e23e0d6c6e ln: avoid duplicated htlc filter code, support multiple htlcs better 2019-08-20 09:03:10 +02:00
Janus
e18a3b5a3d lnutil: remove LI01 sort after Tx.from_io: fixup after rebase on da9d1e6001 2019-08-20 09:03:10 +02:00
Janus
224226f427 ln: cooperative close with remote peer initiating 2019-08-20 09:03:10 +02:00
Janus
d5d9270d0c lnhtlc: save logs and feeupdates 2019-08-20 09:03:10 +02:00
Janus
eca5545004 lnhtlc: don't throw away fee updates or htlcs
also add inject_fees debug command
2019-08-20 09:03:10 +02:00
Janus
261fefb6f3 lnwatcher rebased 2019-08-20 09:03:10 +02:00
SomberNight
1b030fca78 rebase follow-up: use namedtuples from master in new code (TxOutput, TxMinedStatus) 2019-08-20 09:03:10 +02:00
SomberNight
4d1785799b lnbase.pay: test if htlc can be added 2019-08-20 09:03:10 +02:00