SomberNight
1b8bf7a167
lnworker: minor clean-up re payment_completed
6 years ago
Janus
fb32fd3da3
lnhtlc: handle settles like adds (asymmetrical across ctns)
6 years ago
SomberNight
a1c68e49b7
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
6 years ago
ThomasV
0cba162640
lnchannel: reformatting
6 years ago
ThomasV
0c351c93ad
lnchannel: fix error message
6 years ago
ThomasV
6dd84c238e
Refactor LNPeer in order to support HTLC forwarding:
1. Do not perform channel updates in coroutines, because they would get executed in random order.
2. After applying channel updates, wait only for the relevant commitment (local or remote) and not for both, because local and remote might be out of sync (BOLT 2).
3. When waiting for a commitment, wait until a given ctn has been reached, because a queue cannot be shared by several coroutines
6 years ago
ThomasV
4330b93381
Rename lnchan, lnchannel_verifier, lnbase
Auto-completions are a pain if files share a long prefix
6 years ago
ThomasV
37ab8b5852
channel: is_closed
6 years ago
ThomasV
d4b21fab27
lightning:
* store invoices for both directions
* do not store lightning_payments_inflight, lightning_payments_completed in lnworker
* payment history is returned by get_payments method of LNChannel
* command line: lightning history, lightning_invoices
* re-enable push_msat
6 years ago
Janus
22e34d3d8f
ln: handle channel limits better, show remote limits in details dialog, replace rusty's testnet peer (doesn't work currently)
6 years ago
Janus
6197b8ba34
ln: add test_lnwatcher
6 years ago
Janus
5d5c24a423
lnchan: fix per_commitment_point number in verify_htlc
6 years ago
Janus
d1d0906764
lnchan refactor
- replace undoing logic with new HTLCManager class
- separate SENT/RECEIVED
- move UpdateAddHtlc to lnutil
6 years ago
Janus
a94c24cf73
ln: two remaining encumberedTx removal remnants
6 years ago
ThomasV
fcaeb1c870
use to_dict (follow-up baa03a469f3e0e0ae61593272f5cb7e2483d49ad)
6 years ago
Janus
8f3761e33c
lnsweep: use dicts consistently
6 years ago
Janus
4e98afd76b
lnchan: remove debugging code, commented out code
6 years ago
Janus
efdf0296cf
lnchan: only sign force_close_tx when demanded, assure consistency, fix test
6 years ago
Janus
fdfc1b3af4
lnchan: make force_close_tx() assure that tx is valid, trigger failure in test
6 years ago
ThomasV
15faefe33d
lnchannel: store pre-signed sweep transactions after each new commitment
6 years ago
ThomasV
c354f524e0
LNWatcher refactoring:
- do not store non-breach transactions
- send 'channel_open' and 'channel_closed' events
- force-closed channels are handled by LNWorker
6 years ago
ThomasV
d83f2124d3
lnsweep: return ctx.txid instead of None
6 years ago
ThomasV
d30b2643e0
Channel: add current_commitment method
6 years ago
Janus
b8f307bec7
lnsweep: fix create_sweeptxs_for_their_just_revoked_ctx
in the case where an htlc is failed, it could happen
that we use the wrong list of htlcs to generate sweep
tx'es. we would use the pending list instead of the
committed list.
observed by sending 12300sat and then 123000sat,
the second payment fails and an AssertionError was
triggered cause the htlc output could not be found
in the ctx.
added some documentation to clarify the behaviour
of lnchan.included_htlcs.
6 years ago
ThomasV
59ff17bd23
fix channel closure:
- add 'CLOSING' state
- wait until channel has no inflight HTLC
- end fee negocitation when both parties agree on the fee
(previously code ended it only when the other party had broadcast)
- broadcast the closing transaction
6 years ago
ThomasV
43d250573d
follow up 'replace properties with functions'
6 years ago
SomberNight
3b3cb6cc2d
lnchan: restore process_new_offchain_ctx
6 years ago
SomberNight
b215d8a591
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
6 years ago
ThomasV
2212fc07b9
lnchan: replace properties with functions
6 years ago
Janus
bb331c1160
channel details with list of htlcs
6 years ago
ThomasV
dbeb3e4898
follow-up prev commit
6 years ago
ThomasV
0690c7b5e4
lightning: do not handle more than one fee update at a time
6 years ago
Janus
57f007a911
fix ln tests
6 years ago
Janus
89184fc759
add command for listing invoices and their progress, fix list_channels
6 years ago
Janus
8e4bcae781
function that returns map from commitment number to list of HTLCs
6 years ago
Janus
6e4de7039f
avoid leaving FORCE_CLOSING state, rebroadcast closing tx if reorged out
6 years ago
Janus
64f6a0c43f
lnchan: use NamedTuple for logs instead of dict with static keys (adds, locked_in, settles, fails)
6 years ago
Janus
bfa28e5562
lnchan: make sign_next_commitment revert state
6 years ago
Janus
24f00acbc7
remove incorrect docstrings, attribute docstring sources where applicable
6 years ago
SomberNight
907e3d76f7
after rebase clean-up
6 years ago
SomberNight
7e5bf8edeb
lnbase: more type annotations, and minor fix
6 years ago
Janus
6f1287736a
add lnd copyright boilerplate to lnchan, test_lnchan
6 years ago
Janus
7991165ddf
lnworker: fix listchannels
6 years ago
Janus
b4a80805f2
lightning channels reserves: use pretty balance in Qt, fix bugs, add tests
6 years ago
ThomasV
ba4e789dd8
use WaitingDialog to close channels
6 years ago
Janus
35a92036ec
lightning channel reserves
6 years ago
Janus
be74575241
fix co-op close
6 years ago
SomberNight
45611b3eb8
lnutil.make_funding_input: don't return payment pubkeys
order depends on who is initiator anyway
6 years ago
Janus
8e9667ffa3
redeem htlc outputs of our local commitment transaction back to wallet
6 years ago
SomberNight
90d0763ea9
some more type annotations that needed conditional imports
6 years ago