Matt Corallo
56513f2927
Track last_block_hash in ChannelMonitor and expose it on deser
...
Also make block_connected take a &mut self to ensure serialized
state will always be self-consistent.
2018-10-27 09:42:04 -04:00
Matt Corallo
47fe673c57
Give ChannelMonitor a logger via new ReadableArgs trait
2018-10-27 09:42:04 -04:00
Matt Corallo
c0c139cdc2
Fix and test update_add_htlc but disconnect pre-commitment_signed
2018-10-27 09:42:04 -04:00
Matt Corallo
e2de49ddc4
Respond to channel_reestablish out-of-band for ordered delivery
2018-10-27 09:42:04 -04:00
Antoine Riard
5180686b1d
Integrate destination_script from KeysInterface in ChannelManager/Channel
...
Drop channel_monitor_claim_key from ChannelKeys
2018-10-27 09:42:04 -04:00
Antoine Riard
32a9378909
Integrate shutdown_pubkey from KeysInterface in ChannelManager/Channel
...
Drop channel_close_key from ChannelKeys
2018-10-27 09:42:04 -04:00
Antoine Riard
e361fed0f1
Integrate KeysInterface to ChannelManager with Arc
2018-10-27 09:42:04 -04:00
Antoine Riard
d33cb3cca5
Add a KeysInterface which provides keys from user
...
Move ChannelKeys into keysinterface for generate a set of it from
master_seed and change return type to panic on bogus data
2018-10-27 09:34:45 -04:00
Antoine Riard
8c235d9e28
Generate Events from ChannelMonitor to indicate spendable ouputs
...
Extend KeyStorage with delayed_payment_base_key and per_commitment_point
to derive local_delayed private key
2018-10-27 09:34:28 -04:00
Matt Corallo
c36d23107c
Add Channel support for monitor-update-failed pausing
2018-10-23 16:03:30 -04:00
Matt Corallo
695eec23c4
Pull out regenerating RAA/CS in channel_reestablish handling
2018-10-23 16:03:30 -04:00
Matt Corallo
f059d9ce3f
Fix reconnect message order on remote updates while waiting on RAA
2018-10-23 15:26:11 -04:00
Matt Corallo
e86c84b2be
Add message ordering return value to handling channel_reestablish
2018-10-23 15:26:11 -04:00
Yuntai Kyong
d3ca7da672
Some changes in comments and error messages.
2018-10-23 10:50:03 -04:00
Yuntai Kyong
ed30a199e3
Error handling in decoding onion
2018-10-23 10:44:40 -04:00
Matt Corallo
df88525d44
Ensure channel is live, not usable for sending fee updates
...
+ a freebie TODO removal
2018-10-17 21:28:22 -04:00
Matt Corallo
1fe616db5a
Fix + test funding tx confirmation while peer is disconnected
2018-10-16 16:36:29 -04:00
Matt Corallo
17375b0551
Fix channel_reestablish exchanging in case of lost messages
...
This uses the new storage in HTLC state enums to reproduce the
various updates in a CommitmentUpdate group which is obviously
required to re-send a commitment_update after pending unreceived
updates were dropped.
Does not yet handle dropped update_fee updates properly.
2018-10-15 22:03:12 -04:00
Matt Corallo
b4dcbfa569
Store onion packet in OutboundHTLCState so we can regen update_add
2018-10-15 21:52:41 -04:00
Matt Corallo
4b231d5e6d
Store per-state HTLC data in the state enum itself (and store more)
2018-10-15 21:52:41 -04:00
Matt Corallo
99e01b2a64
Further simplify get_{inbound,outbound}_pending_htlc_stats
2018-10-06 12:06:29 +09:00
Yuntai Kyong
1f93a838c7
Split get_pending_htlc_stats
...
to get_inbound_pending_htlc_stats and get_outbound_pending_htlc_stats
2018-10-06 12:06:29 +09:00
Matt Corallo
e5974ce643
Check that reserves are met or progress is made on commitment tx gen
2018-10-06 12:06:29 +09:00
Yuntai Kyong
02b28d4513
Add simple test for channel_reserve/max_htlc_value_in_flight_msat
2018-10-06 12:06:29 +09:00
Yuntai Kyong
c6cc30d9d7
Add a ChannelValueStat getter to simplify tests
2018-10-06 12:03:24 +09:00
Yuntai Kyong
dc4a8c1de2
Document channel reserve behavior a bit better
2018-10-06 12:01:37 +09:00
Yuntai Kyong
f8cfc4228c
Fix checking of channel_reserve values
2018-10-06 12:01:31 +09:00
Yuntai Kyong
18ce6c8fd8
add a ChannelUnavailable error
2018-10-03 08:45:34 +09:00
Yuntai Kyong
eff730af18
raise APIError from close_channel
2018-10-03 08:36:39 +09:00
Matt Corallo
3f2d379835
Use new ChannelError in get_channel_announcement
2018-09-30 20:07:44 -04:00
Matt Corallo
ff644f4517
Use new ChannelError in channel_reestablish handling
2018-09-30 20:05:39 -04:00
Matt Corallo
ad77f72ff3
Use new ChannelError in HTLC-removal msgs, filling out more handling
2018-09-30 20:05:39 -04:00
Matt Corallo
662485a4dd
Use new ChannelError in funding_locked, filling out more handling
2018-09-30 20:05:39 -04:00
Matt Corallo
625e2b3532
Use new ChannelError type in accept_channel
2018-09-30 20:05:39 -04:00
Matt Corallo
aa2021dff5
Introduce a Channel-specific Err type and return it in a few places
...
This is way simpler than writing out the whole ErrorAction mess and
we can just convert it as appropriate in ChannelManager.
2018-09-30 20:05:38 -04:00
Yuntai Kyong
1dbc6fb0ef
Implement update_fee handling
2018-09-29 19:58:08 -04:00
Schalk van Heerden
b58bab0700
Added test for testing sciptpubkey of closing message per bolt 2 spec
2018-09-21 10:20:44 +02:00
Matt Corallo
da6171d50d
Remove fuzz channel_target.
...
It has bitrotted a lot and doesn't really make sense given all the
precondition enforcement that is in channelmanager, sadly.
2018-09-19 22:47:07 -04:00
Matt Corallo
c91f72c131
Drop MsgEncodable in favor of default fns on Writeable
2018-09-16 14:33:50 -04:00
Matt Corallo
e606f13664
Constify 2**48-1 and add some additional comments in Channel
2018-09-15 10:53:16 -04:00
Matt Corallo
28c5f6f309
Track peer-disconnection in Channel and handle channel_reestablish
2018-09-15 10:53:16 -04:00
Matt Corallo
ca712dfa36
Add a Disconnected ChannelState and check/handle it everywhere
...
Setting/removing it comes next
2018-09-15 10:53:16 -04:00
Matt Corallo
4bcf00e5b8
Clarify update_fail/fulfill_htlc holding cell allowed Errs
...
Specifically, there really should be no Errs, but in case there is
some case where duplicate HTLC removes are possible, return
IgnoreError and debug_assert to see if fuzzing can find them.
2018-09-15 10:53:16 -04:00
Matt Corallo
5fe598c073
Drop channels on disconnection if we haven't funded them yet
2018-09-15 10:53:16 -04:00
Matt Corallo
f55f055b4e
Remove/fail uncommitted HTLCs upon peer disconnection
2018-09-15 10:53:16 -04:00
Matt Corallo
2be7eda3b5
Merge pull request #179 from TheBlueMatt/2018-09-pre-178-cleanups
...
Pre-reconnect ChannelManager test cleanups
2018-09-15 10:50:57 -04:00
Yuntai Kyong
4e4fa56e2b
unwrap channel.get_open_channel
2018-09-15 07:33:20 +09:00
Matt Corallo
adee6719c4
Split up send_commitment into a const and non-const version
2018-09-14 16:24:30 -04:00
Matt Corallo
5ef88cea34
Do not fail-backwards LocalAnnounced HTLCs upon force-close.
...
This is completely unsafe as we have provided the remote side with
a commitment_signed which they can broadcast, including the HTLC
transaction, and then could claim it on-chain after we've failed it
backwards!
2018-09-14 15:27:53 -04:00
Matt Corallo
01c8e4f56f
Merge pull request #163 from ariard/claim_revoked_htlc_tx
...
Implement claiming of revoked HTLC transactions by ChannelMonitor
2018-09-13 13:53:47 -04:00