rust-lightning
5 years agoraise APIError from send_payment 2018-09-173-whitespace-err
Yuntai Kyong [Wed, 12 Sep 2018 20:23:12 +0000 (05:23 +0900)]
raise APIError from send_payment

add APIError::RouteError

5 years agoMerge pull request #167 from TheBlueMatt/2018-09-dup-htlc
Matt Corallo [Wed, 12 Sep 2018 17:07:13 +0000 (13:07 -0400)]
Merge pull request #167 from TheBlueMatt/2018-09-dup-htlc

 Allow duplicate-payment_hash HTLCs for HTLC forwards

5 years agoMerge pull request #170 from TheBlueMatt/2018-09-119-rebased
Matt Corallo [Wed, 12 Sep 2018 15:22:06 +0000 (11:22 -0400)]
Merge pull request #170 from TheBlueMatt/2018-09-119-rebased

#119 squashed

5 years agoAdd simple test for duplicate-payment_hash HTLC tracking 2018-09-dup-htlc
Matt Corallo [Tue, 11 Sep 2018 19:04:41 +0000 (15:04 -0400)]
Add simple test for duplicate-payment_hash HTLC tracking

5 years agoAvoid cross-test statics in ChannelManager network tests
Matt Corallo [Sun, 9 Sep 2018 01:02:42 +0000 (21:02 -0400)]
Avoid cross-test statics in ChannelManager network tests

5 years agoAllow duplicate-payment_hash HTLCs for HTLC forwards
Matt Corallo [Tue, 11 Sep 2018 18:20:40 +0000 (14:20 -0400)]
Allow duplicate-payment_hash HTLCs for HTLC forwards

This is required by BOLT 2 to ensure that no attacker can simply
relay every public node a duplicate-payment_hash HTLC for each HTLC
it receives to deduce where an HTLC came from.

Note that this makes the claim logic much less incentive-compatible
as we will not claim all available HTLCs with the same payment_hash
even if we know the preimage! This is OK because, most likely, any
attackers trying to map the network will use small-value payments
and, hopefully, we will move away from constant hashes across an
entire payment at some point in the near future.

This further simplifies the payment transition state a bit, so
hopefully at least we got some readability out of all of this

5 years agoMigrate fuzz router/channel target to Readable 2018-09-119-rebased
Yuntai Kyong [Wed, 12 Sep 2018 10:00:10 +0000 (19:00 +0900)]
Migrate fuzz router/channel target to Readable

and be more specific about DecodeError::InvalidValue

5 years agomigrate peer_handler to use Writeable
Yuntai Kyong [Mon, 10 Sep 2018 07:13:26 +0000 (16:13 +0900)]
migrate peer_handler to use Writeable

added inplace byte_utils

5 years agoAdd fuzz targets for Writeable messages/migrate fuzz test
Yuntai Kyong [Sat, 1 Sep 2018 07:21:39 +0000 (16:21 +0900)]
Add fuzz targets for Writeable messages/migrate fuzz test

5 years agoImplement Writeable for messages
Yuntai Kyong [Sat, 1 Sep 2018 07:20:26 +0000 (16:20 +0900)]
Implement Writeable for messages

5 years agoImplement Writer/Reader
Yuntai Kyong [Sat, 1 Sep 2018 07:18:56 +0000 (16:18 +0900)]
Implement Writer/Reader

with additional variants in DecodeError

5 years agoSplit HTLC tracking into separate Inbound/Outbound types
Matt Corallo [Sun, 9 Sep 2018 16:53:57 +0000 (12:53 -0400)]
Split HTLC tracking into separate Inbound/Outbound types

This isnt as simplifying as I'd hoped, but still increases
compile-time checking, which is nice, and removes one of two
panic!()s.

5 years agoMerge pull request #165 from TheBlueMatt/2018-09-pre-disconnect-misc
Matt Corallo [Tue, 11 Sep 2018 19:01:35 +0000 (15:01 -0400)]
Merge pull request #165 from TheBlueMatt/2018-09-pre-disconnect-misc

Further minor misc changes from reconnect work

5 years agopanic on invalid calls to Channel::send_commitment instead of Err 2018-09-pre-disconnect-misc
Matt Corallo [Sat, 8 Sep 2018 19:59:18 +0000 (15:59 -0400)]
panic on invalid calls to Channel::send_commitment instead of Err

5 years agoDo not allow sending HTLCs when the first hop is disconnected
Matt Corallo [Sat, 8 Sep 2018 19:53:05 +0000 (15:53 -0400)]
Do not allow sending HTLCs when the first hop is disconnected

5 years agoSync get_update_fail_htlc, get_update_fulfill_htlc state err result
Matt Corallo [Thu, 6 Sep 2018 23:12:32 +0000 (19:12 -0400)]
Sync get_update_fail_htlc, get_update_fulfill_htlc state err result

Both get_update_fail_htlc and get_update_fulfill_htlc should never
be called before any HTLC could have been accepted (ie
pre-ChannelFunded) nor should they ever be called
post-ShutdownComplete as the Channel object should be destroyed at
that point. Previously get_update_fulfill_htlc would panic, but
get_update_fail_htlc would return an Err. For now make them both
panic but we can revisit this if we want to have fewer panics in
the future.

5 years agoAdd force_close_channel call command to full_stack_target
Matt Corallo [Thu, 6 Sep 2018 21:23:09 +0000 (17:23 -0400)]
Add force_close_channel call command to full_stack_target

5 years agoMerge pull request #164 from TheBlueMatt/2018-09-channel-connection-cleanups
Matt Corallo [Sun, 9 Sep 2018 15:35:42 +0000 (11:35 -0400)]
Merge pull request #164 from TheBlueMatt/2018-09-channel-connection-cleanups

Minor cleanups

5 years agoDisallow duplicate Init messages from peers 2018-09-channel-connection-cleanups
Matt Corallo [Sat, 8 Sep 2018 18:43:15 +0000 (14:43 -0400)]
Disallow duplicate Init messages from peers

5 years agoFix PeerManager::get_peer_node_ids to filter according to docs
Matt Corallo [Sat, 8 Sep 2018 17:57:20 +0000 (13:57 -0400)]
Fix PeerManager::get_peer_node_ids to filter according to docs

5 years agoDisconnect duplicate node_id connections after Noise handshake
Matt Corallo [Sat, 8 Sep 2018 17:56:45 +0000 (13:56 -0400)]
Disconnect duplicate node_id connections after Noise handshake

5 years agoUpdate add_update_monitor docs to indicate registration req.
Matt Corallo [Sat, 8 Sep 2018 14:32:39 +0000 (10:32 -0400)]
Update add_update_monitor docs to indicate registration req.

It wasn't entirely clear from the existing docs that it is the
responsibility of the implementor of ManyChannelMonitor to
register the relevant outpoint.

5 years agoDocument Channel::get_funding_redeemscript precondition
Matt Corallo [Thu, 6 Sep 2018 21:13:41 +0000 (17:13 -0400)]
Document Channel::get_funding_redeemscript precondition

5 years agoMerge pull request #159 from ariard/channel_monitor
Matt Corallo [Sat, 8 Sep 2018 14:29:29 +0000 (10:29 -0400)]
Merge pull request #159 from ariard/channel_monitor

Add registration of commitment tx's outputs from check_spend_remote_transaction

5 years agoAdd registration of commitment tx's outputs from
Antoine Riard [Fri, 7 Sep 2018 01:40:41 +0000 (01:40 +0000)]
Add registration of commitment tx's outputs from
check_spend_remote_transaction

Fixup more descriptive var names by Matt Corallo <git@bluematt.me>

5 years agoRefactor/dont re-enter block_conencted on duplicate watch calls
Matt Corallo [Fri, 7 Sep 2018 15:56:41 +0000 (11:56 -0400)]
Refactor/dont re-enter block_conencted on duplicate watch calls

Previously we'd hit an infinite loop if a block_connected call
always resulted in the same ChainWatchInterface registrations.
While we're at it, we also split ChainWatchUtil in two to make
things a bit more flexible for users, though not sure if that
actually matters, and make the matching more aggressive in testing,
even if we pick the more performant option at runtime.

5 years agoNarrow ChainWatchInterface::install_watch_script
Matt Corallo [Fri, 7 Sep 2018 15:12:22 +0000 (11:12 -0400)]
Narrow ChainWatchInterface::install_watch_script

5 years agoMerge pull request #162 from ariard/channel_manager_refactor_all
Matt Corallo [Fri, 7 Sep 2018 23:43:08 +0000 (19:43 -0400)]
Merge pull request #162 from ariard/channel_manager_refactor_all

Channel manager refactor all (following & end)

5 years agoRefactor handle_update_fee to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:59:45 +0000 (21:59 +0000)]
Refactor handle_update_fee to wrapper error handling function

5 years agoRefactor handle_revoke_and_ack to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:57:06 +0000 (21:57 +0000)]
Refactor handle_revoke_and_ack to wrapper error handling function

5 years agoRefactor handle_commitment_signed to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:51:58 +0000 (21:51 +0000)]
Refactor handle_commitment_signed to wrapper error handling function

5 years agoRefactor handle_update_fail_malformed_htlc to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:46:47 +0000 (21:46 +0000)]
Refactor handle_update_fail_malformed_htlc to wrapper error handling function

5 years agoRefactor handle_update_fail_htlc to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:42:07 +0000 (21:42 +0000)]
Refactor handle_update_fail_htlc to wrapper error handling function

5 years agoRefactor handle_update_fulfill_htlc to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:36:55 +0000 (21:36 +0000)]
Refactor handle_update_fulfill_htlc to wrapper error handling function

5 years agoRefactor handle_update_add_htlc to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:30:00 +0000 (21:30 +0000)]
Refactor handle_update_add_htlc to wrapper error handling function

5 years agoRefactor handle_closing_signed to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 21:17:28 +0000 (21:17 +0000)]
Refactor handle_closing_signed to wrapper error handling function

5 years agoMerge pull request #160 from ariard/channel_manager_refactor_all
Matt Corallo [Fri, 7 Sep 2018 14:19:28 +0000 (10:19 -0400)]
Merge pull request #160 from ariard/channel_manager_refactor_all

Channel manager refactor all

5 years agoMerge pull request #156 from TheBlueMatt/2018-09-funding_created_action
Matt Corallo [Fri, 7 Sep 2018 14:14:58 +0000 (10:14 -0400)]
Merge pull request #156 from TheBlueMatt/2018-09-funding_created_action

Ensure funding_created always returns Some(_) HandleError::action

5 years agoRefactor handle_shutdown to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 03:10:10 +0000 (03:10 +0000)]
Refactor handle_shutdown to wrapper error handling function

5 years agoRefactor handle_funding_locked to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 02:58:01 +0000 (02:58 +0000)]
Refactor handle_funding_locked to wrapper error handling function

5 years agoRefactor handle_funding_signed to wrapper error handling function
Antoine Riard [Fri, 7 Sep 2018 02:45:07 +0000 (02:45 +0000)]
Refactor handle_funding_signed to wrapper error handling function

5 years agoRemove unused import in router_target 2018-09-funding_created_action
Matt Corallo [Thu, 6 Sep 2018 16:39:19 +0000 (12:39 -0400)]
Remove unused import in router_target

5 years agoEnsure funding_created always returns Some(_) HandleError::action
Matt Corallo [Thu, 6 Sep 2018 15:31:33 +0000 (11:31 -0400)]
Ensure funding_created always returns Some(_) HandleError::action

5 years agoMerge pull request #154 from ariard/funding_created_refactor
Matt Corallo [Thu, 6 Sep 2018 15:12:10 +0000 (11:12 -0400)]
Merge pull request #154 from ariard/funding_created_refactor

Refactor handle_funding_created to wrapper error handling function

5 years agoRefactor handle_funding_created to wrapper error handling function
Antoine Riard [Thu, 6 Sep 2018 00:58:00 +0000 (00:58 +0000)]
Refactor handle_funding_created to wrapper error handling function

5 years agoMerge pull request #155 from SWvheerden/patch-1
Matt Corallo [Thu, 6 Sep 2018 14:50:16 +0000 (10:50 -0400)]
Merge pull request #155 from SWvheerden/patch-1

patch to change temp_channel from deserialise to copy

5 years agochange temp_channel from deserialise to copy
SW van Heerden [Thu, 6 Sep 2018 13:34:33 +0000 (15:34 +0200)]
change temp_channel from deserialise to copy

5 years agoMerge pull request #151 from ariard/channel_manager_refactor
Matt Corallo [Thu, 6 Sep 2018 14:45:41 +0000 (10:45 -0400)]
Merge pull request #151 from ariard/channel_manager_refactor

Refactor handle_accept_channel to wrapper error handling function

5 years agoRefactor handle_accept_channel to wrapper error handling function
Antoine Riard [Wed, 5 Sep 2018 23:45:38 +0000 (23:45 +0000)]
Refactor handle_accept_channel to wrapper error handling function

5 years agoMerge pull request #152 from TheBlueMatt/2018-09-chan-cleanups
Matt Corallo [Thu, 6 Sep 2018 13:51:34 +0000 (09:51 -0400)]
Merge pull request #152 from TheBlueMatt/2018-09-chan-cleanups

Channel cleanups

5 years agoAdd further clarification TODO in finish_force_close_channel 2018-09-chan-cleanups
Matt Corallo [Thu, 6 Sep 2018 00:19:09 +0000 (20:19 -0400)]
Add further clarification TODO in finish_force_close_channel

5 years agoDrop HTLCState::LocalRemovedAwaitingCommitment
Matt Corallo [Wed, 5 Sep 2018 18:47:43 +0000 (14:47 -0400)]
Drop HTLCState::LocalRemovedAwaitingCommitment

This was redundant and was included because the HTLC still needed
to be monitored, but that happens in ChannelMonitor, so there is no
need for it in Channel itself.

5 years agoDocument+check commitment_signed generation success on send_htlc
Matt Corallo [Wed, 5 Sep 2018 18:08:38 +0000 (14:08 -0400)]
Document+check commitment_signed generation success on send_htlc

Because we don't have an HTLCState for
update_add_htlc-generated-but-not-yet-commitment_signed to simplify
the mess of HTLCState match arms, any time a Channel::send_htlc
call returns Ok(Some(_)) we MUST call commitment_signed and it MUST
return success (or close the channel). We mention this in the docs
and panic if its not met in ChannelManager (which lets the fuzz
tester check this).

5 years agoAlways return an Error Message in invalid sig/key errors in Channel
Matt Corallo [Wed, 5 Sep 2018 18:08:13 +0000 (14:08 -0400)]
Always return an Error Message in invalid sig/key errors in Channel

5 years agoMerge pull request #150 from TheBlueMatt/2018-09-bolt7-compliance
Matt Corallo [Wed, 5 Sep 2018 22:34:10 +0000 (18:34 -0400)]
Merge pull request #150 from TheBlueMatt/2018-09-bolt7-compliance

Finish up #129 BOLT 7 compliance

5 years agoMerge pull request #147 from TheBlueMatt/2018-09-channelmanager-err-macro
Matt Corallo [Wed, 5 Sep 2018 22:33:55 +0000 (18:33 -0400)]
Merge pull request #147 from TheBlueMatt/2018-09-channelmanager-err-macro

Refactor ChannelManager handle functions into a Channel-closing macro

5 years agoHandle partial-response UTXO impls or reorgs in chan_announcements 2018-09-bolt7-compliance
Matt Corallo [Wed, 5 Sep 2018 02:39:04 +0000 (22:39 -0400)]
Handle partial-response UTXO impls or reorgs in chan_announcements

Mostly to add a big comment noting why we aren't "spec-compliant"

5 years agoUtil-func channel removal (fixing a bug in HTLC failure updates)
Matt Corallo [Wed, 5 Sep 2018 02:25:51 +0000 (22:25 -0400)]
Util-func channel removal (fixing a bug in HTLC failure updates)

5 years agoReject rumors of channels that are from one node back to itself
Matt Corallo [Wed, 5 Sep 2018 02:24:46 +0000 (22:24 -0400)]
Reject rumors of channels that are from one node back to itself

5 years agoMove announcement_signatures handling into new force-close macro 2018-09-channelmanager-err-macro
Matt Corallo [Wed, 5 Sep 2018 00:07:29 +0000 (20:07 -0400)]
Move announcement_signatures handling into new force-close macro

Because we've separated out channel closure from ErrorMessage
returning we can return error messages in a few additional cases,
like if the peer sent us a message for a channel they didn't own.

5 years agoFill out IgnoreError actions in get_channel_announcement
Matt Corallo [Wed, 5 Sep 2018 00:02:33 +0000 (20:02 -0400)]
Fill out IgnoreError actions in get_channel_announcement

They are all just "its too early/late to get an announcement"
errors so simply ignoring them and not sending an announce is fine

5 years agoSimplify secp_call! macro in ChannelManager
Matt Corallo [Wed, 5 Sep 2018 00:00:47 +0000 (20:00 -0400)]
Simplify secp_call! macro in ChannelManager

5 years agoEnsure Channel::new_from_req always returns an ErrorMessage on Err
Matt Corallo [Wed, 5 Sep 2018 00:10:32 +0000 (20:10 -0400)]
Ensure Channel::new_from_req always returns an ErrorMessage on Err

5 years agoDont return an Err from Channel::get_accept_channel that can't fail
Matt Corallo [Tue, 4 Sep 2018 23:28:06 +0000 (19:28 -0400)]
Dont return an Err from Channel::get_accept_channel that can't fail

5 years agoRefactor handle_open_channel to wrapper error handling function
Antoine Riard [Wed, 5 Sep 2018 00:17:45 +0000 (20:17 -0400)]
Refactor handle_open_channel to wrapper error handling function

Original version is from Antoine Riard <ariard@student.42.fr>,
the error type and some return type fixes are from
Matt Corallo <git@bluematt.me>

5 years agoAdd ChannelManager-specific HandleError type and macro to use it
Matt Corallo [Wed, 5 Sep 2018 00:16:06 +0000 (20:16 -0400)]
Add ChannelManager-specific HandleError type and macro to use it

Original macro is from Antoine Riard <ariard@student.42.fr>,
the error type and additional mappings are from
Matt Corallo <git@bluematt.me>

5 years agoMerge pull request #145 from TheBlueMatt/2018-09-134-rebased
Matt Corallo [Mon, 3 Sep 2018 22:10:51 +0000 (18:10 -0400)]
Merge pull request #145 from TheBlueMatt/2018-09-134-rebased

#134 rebased

5 years agoMerge pull request #143 from TheBlueMatt/2018-08-announcement_sigs_erroraction
Matt Corallo [Mon, 3 Sep 2018 21:44:57 +0000 (17:44 -0400)]
Merge pull request #143 from TheBlueMatt/2018-08-announcement_sigs_erroraction

Ensure handle_announcement_signatures always has a ErrorAction

5 years agoProvide better get_chain_utxo return coverage in router_target 2018-09-134-rebased
Matt Corallo [Mon, 3 Sep 2018 21:38:38 +0000 (17:38 -0400)]
Provide better get_chain_utxo return coverage in router_target

5 years agoEnsure we aren't duplicatively reading things in router_target
Matt Corallo [Mon, 3 Sep 2018 21:38:25 +0000 (17:38 -0400)]
Ensure we aren't duplicatively reading things in router_target

5 years agoAdd DummyChainWatcher in route_target
Antoine Riard [Fri, 31 Aug 2018 17:06:30 +0000 (17:06 +0000)]
Add DummyChainWatcher in route_target

5 years agoAdd test_invalid_channel_announcemnt + test utilities
Antoine Riard [Thu, 30 Aug 2018 01:42:11 +0000 (01:42 +0000)]
Add test_invalid_channel_announcemnt + test utilities

Fix typo

5 years agoCheck script_pubkey against expected channel_announcement
Matt Corallo [Thu, 30 Aug 2018 19:00:56 +0000 (15:00 -0400)]
Check script_pubkey against expected channel_announcement

5 years agoImplement get_chain_utxo and ChainError in
Antoine Riard [Thu, 30 Aug 2018 01:40:18 +0000 (01:40 +0000)]
Implement get_chain_utxo and ChainError in
ChainWatchInterface to Router check on channel_announcement

Needed for BOLT 7

5 years agoAdd ChainWatchInterface in Router
Antoine Riard [Thu, 30 Aug 2018 01:37:37 +0000 (01:37 +0000)]
Add ChainWatchInterface in Router

5 years agoMerge pull request #144 from yuntai/onion_call_back_simple
Matt Corallo [Mon, 3 Sep 2018 20:51:32 +0000 (16:51 -0400)]
Merge pull request #144 from yuntai/onion_call_back_simple

Remove code fragments with no effect

5 years agoRemove code fragments with no effect
Yuntai Kyong [Sun, 2 Sep 2018 12:45:44 +0000 (21:45 +0900)]
Remove code fragments with no effect

5 years agoCheck for misuse of funding_transaction_generated and panic 2018-08-announcement_sigs_erroraction
Matt Corallo [Fri, 31 Aug 2018 20:46:55 +0000 (16:46 -0400)]
Check for misuse of funding_transaction_generated and panic

5 years agoEnsure handle_announcement_signatures always has a ErrorAction
Matt Corallo [Thu, 30 Aug 2018 20:49:51 +0000 (16:49 -0400)]
Ensure handle_announcement_signatures always has a ErrorAction

5 years agoAdd ErrorAction in secp Error -> HandleError conv in ChannelManager
Matt Corallo [Thu, 30 Aug 2018 20:48:53 +0000 (16:48 -0400)]
Add ErrorAction in secp Error -> HandleError conv in ChannelManager

5 years agoMerge pull request #139 from TheBlueMatt/2018-08-fuzz-fixes-7
Matt Corallo [Thu, 30 Aug 2018 20:02:38 +0000 (16:02 -0400)]
Merge pull request #139 from TheBlueMatt/2018-08-fuzz-fixes-7

Fix crash that #127 intended to fix but did not completely fix

5 years agoRemove unused feeest field in ChannelManager tests 2018-08-fuzz-fixes-7
Matt Corallo [Thu, 30 Aug 2018 19:10:23 +0000 (15:10 -0400)]
Remove unused feeest field in ChannelManager tests

5 years agoFix crash that #127 intended to fix but did not completely fix
Matt Corallo [Thu, 30 Aug 2018 16:35:52 +0000 (12:35 -0400)]
Fix crash that #127 intended to fix but did not completely fix

Introduced in #124, and found by fuzzer

5 years agoMerge pull request #136 from TheBlueMatt/2018-08-excess-signed-data-bolt-7
Matt Corallo [Wed, 29 Aug 2018 22:43:19 +0000 (18:43 -0400)]
Merge pull request #136 from TheBlueMatt/2018-08-excess-signed-data-bolt-7

Correctly verify and forward excess data post-signature in signed announcement messages

5 years agoAlso fwd channel_update and node_announcement immediately 2018-08-excess-signed-data-bolt-7
Matt Corallo [Wed, 29 Aug 2018 21:53:11 +0000 (17:53 -0400)]
Also fwd channel_update and node_announcement immediately

Not really sure why the API was different for channel_announcement,
but this brings everything in sync.

5 years agoFail parsing node/channel announcements with unknown even features
Matt Corallo [Wed, 29 Aug 2018 21:52:26 +0000 (17:52 -0400)]
Fail parsing node/channel announcements with unknown even features

This is required for BOLT 7 compliance

5 years agoUpdate msg_targets with new, must-roundtrip, and hole messages
Matt Corallo [Wed, 29 Aug 2018 19:56:48 +0000 (15:56 -0400)]
Update msg_targets with new, must-roundtrip, and hole messages

5 years agoCorrect excess-data handling in NodeAnnouncement
Matt Corallo [Wed, 29 Aug 2018 21:50:34 +0000 (17:50 -0400)]
Correct excess-data handling in NodeAnnouncement

Breaks parsing of padding within addresses, but nothing currently
generates such messages, and I'm proposing we remove it in the spec

5 years agoCorrect excess-data handling in ChannelUpdate
Matt Corallo [Wed, 29 Aug 2018 20:01:07 +0000 (16:01 -0400)]
Correct excess-data handling in ChannelUpdate

5 years agoCorrect excess-data handling in ChannelAnnouncement verif in Router
Matt Corallo [Wed, 29 Aug 2018 18:31:50 +0000 (14:31 -0400)]
Correct excess-data handling in ChannelAnnouncement verif in Router

5 years agoIgnore invalid lnd msgs by matching DecodeError instead of a macro
Matt Corallo [Wed, 29 Aug 2018 19:36:58 +0000 (15:36 -0400)]
Ignore invalid lnd msgs by matching DecodeError instead of a macro

5 years agoRemove unused test variable left orphaned by 5d923e2a634351e2852924
Matt Corallo [Wed, 29 Aug 2018 18:30:32 +0000 (14:30 -0400)]
Remove unused test variable left orphaned by 5d923e2a634351e2852924

5 years agoMerge pull request #133 from TheBlueMatt/2018-08-announcement_sigs
Matt Corallo [Wed, 29 Aug 2018 17:49:52 +0000 (13:49 -0400)]
Merge pull request #133 from TheBlueMatt/2018-08-announcement_sigs

Clean up/clarify channel announcement_signatures handling

5 years agoMerge pull request #135 from yuntai/201808-channelreestablish
Matt Corallo [Wed, 29 Aug 2018 17:49:40 +0000 (13:49 -0400)]
Merge pull request #135 from yuntai/201808-channelreestablish

Make my_current_per_commitment_point in ChannelReestablish optional

5 years agoUse Option<DataLossProtect> for ChannelReestablish
Yuntai Kyong [Wed, 29 Aug 2018 16:48:36 +0000 (01:48 +0900)]
Use Option<DataLossProtect> for ChannelReestablish

and fix test

5 years agoFix test for ChannelReestablish
Yuntai Kyong [Wed, 29 Aug 2018 04:00:34 +0000 (13:00 +0900)]
Fix test for ChannelReestablish

5 years agoMake my_current_per_commitment_point Option
Yuntai Kyong [Wed, 29 Aug 2018 03:55:11 +0000 (12:55 +0900)]
Make my_current_per_commitment_point Option

Per Bolt #2, both your_last_per_commitment_secret &
my_current_per_commitment_point are optional depending on
`data_loss_protect`

5 years agoClean up/clarify channel announcement_signatures handling 2018-08-announcement_sigs
Matt Corallo [Tue, 28 Aug 2018 16:11:45 +0000 (12:11 -0400)]
Clean up/clarify channel announcement_signatures handling

5 years agoMake note about complying with BOLT 7 announcement_signatures
Matt Corallo [Mon, 27 Aug 2018 17:11:37 +0000 (13:11 -0400)]
Make note about complying with BOLT 7 announcement_signatures

5 years agoMerge pull request #132 from TheBlueMatt/2018-08-bolt-4-spec-return-fail
Matt Corallo [Mon, 27 Aug 2018 16:44:13 +0000 (12:44 -0400)]
Merge pull request #132 from TheBlueMatt/2018-08-bolt-4-spec-return-fail

Return a malformed HTLC message when ephemeral pubkey is garbage