rust-lightning
5 years agoSend back the actual received amount, not expected on HTLC fails 2019-01-back-fail-privacy
Matt Corallo [Tue, 22 Jan 2019 20:49:29 +0000 (15:49 -0500)]
Send back the actual received amount, not expected on HTLC fails

This resolves an incorrect implementation of the spec and fixes a
major privacy leak.

Fixes GH #289.

5 years agoAdd a fuzz target to test monitor update failure handling 2019-01-monitor-update-handle-fuzz
Matt Corallo [Mon, 7 Jan 2019 22:17:36 +0000 (17:17 -0500)]
Add a fuzz target to test monitor update failure handling

Sadly this requires reducing the honggfuzz iterations to fit within
Travis' runtime limits.

5 years agoTake the logger from test_utils into fuzz::test_utils
Matt Corallo [Tue, 8 Jan 2019 20:06:43 +0000 (15:06 -0500)]
Take the logger from test_utils into fuzz::test_utils

5 years agoExpose CommitmentUpdate contents
Matt Corallo [Tue, 8 Jan 2019 04:13:11 +0000 (23:13 -0500)]
Expose CommitmentUpdate contents

This is an oversight as the MessageSendEvent is otherwise entirely
useless.

5 years agoDrop pending outbound messages on peer disconnection
Matt Corallo [Tue, 8 Jan 2019 04:11:37 +0000 (23:11 -0500)]
Drop pending outbound messages on peer disconnection

This shouldn't be required, but it may help prevent some downstream
race conditions due to clients not sending message events quickly
enough and trying to send stale messages before new
channel_reestablish messages.

5 years agoHandle monitor update failures in two more places
Matt Corallo [Tue, 15 Jan 2019 01:35:56 +0000 (20:35 -0500)]
Handle monitor update failures in two more places

Best reviewed with -b

5 years agoMerge pull request #288 from TheBlueMatt/2019-01-test-split-raa-flag-fix
Matt Corallo [Thu, 24 Jan 2019 18:16:33 +0000 (13:16 -0500)]
Merge pull request #288 from TheBlueMatt/2019-01-test-split-raa-flag-fix

Fix several more monitor-update-failed cases

5 years agoMerge pull request #301 from rex4539/fix-typos
Matt Corallo [Thu, 24 Jan 2019 18:12:28 +0000 (13:12 -0500)]
Merge pull request #301 from rex4539/fix-typos

Fix typos

5 years agoFix typos
Dimitris Apostolou [Thu, 24 Jan 2019 14:41:51 +0000 (16:41 +0200)]
Fix typos

5 years agoFix responding to RAAs when monitor updating had already failed 2019-01-test-split-raa-flag-fix
Matt Corallo [Mon, 14 Jan 2019 22:24:52 +0000 (17:24 -0500)]
Fix responding to RAAs when monitor updating had already failed

5 years agoRemove incorrect debug_assert!() from reestablish handling and test
Matt Corallo [Fri, 18 Jan 2019 16:54:19 +0000 (11:54 -0500)]
Remove incorrect debug_assert!() from reestablish handling and test

5 years agoAdd a test for the ordering setting in channel_reestablish handling
Matt Corallo [Thu, 17 Jan 2019 22:10:58 +0000 (17:10 -0500)]
Add a test for the ordering setting in channel_reestablish handling

5 years agoFix AwaitingRAA on RAA receipt when monitor updating had failed
Matt Corallo [Fri, 11 Jan 2019 18:08:56 +0000 (13:08 -0500)]
Fix AwaitingRAA on RAA receipt when monitor updating had failed

This fixes a rather subtle case handling RAAs when we don't
generate a response due to a previous monitor update failure, but
would otherwise send a CS response. We need to still set
AwaitingRemoteRevoke on the channl in question, but previously did
not. Found by chanmon_fail_consistency fuzz test with the failing
test converted and added manually.

5 years agoMerge pull request #300 from TheBlueMatt/2019-01-tests-split
Matt Corallo [Wed, 23 Jan 2019 22:43:13 +0000 (17:43 -0500)]
Merge pull request #300 from TheBlueMatt/2019-01-tests-split

Split up functional_tests into three separate files

5 years agoFix indentation in a few new tests 2019-01-tests-split
Matt Corallo [Wed, 23 Jan 2019 22:06:38 +0000 (17:06 -0500)]
Fix indentation in a few new tests

5 years agoFix spelling in do_test_monitor_temporary_update_fail comment
Matt Corallo [Mon, 21 Jan 2019 17:25:57 +0000 (12:25 -0500)]
Fix spelling in do_test_monitor_temporary_update_fail comment

5 years agoSplit up monitor-update-failed tests and other functional tests
Matt Corallo [Wed, 23 Jan 2019 21:54:01 +0000 (16:54 -0500)]
Split up monitor-update-failed tests and other functional tests

5 years agoSplit up functional_tests into utils and the tests themselves
Matt Corallo [Wed, 23 Jan 2019 21:46:44 +0000 (16:46 -0500)]
Split up functional_tests into utils and the tests themselves

5 years agoMerge pull request #299 from TheBlueMatt/2019-01-262-redux
Matt Corallo [Wed, 23 Jan 2019 21:15:09 +0000 (16:15 -0500)]
Merge pull request #299 from TheBlueMatt/2019-01-262-redux

Added tests to check the bolt 2 specs for open_channel (Sending Node)

5 years agoAdded tests to check the bolt 2 specs for Sending Node Channel 2019-01-262-redux
Yuko Roodt [Fri, 30 Nov 2018 09:51:37 +0000 (11:51 +0200)]
Added tests to check the bolt 2 specs for Sending Node Channel

5 years agoMerge pull request #298 from TheBlueMatt/2019-01-271-cleanup
Matt Corallo [Wed, 23 Jan 2019 19:48:13 +0000 (14:48 -0500)]
Merge pull request #298 from TheBlueMatt/2019-01-271-cleanup

Implement serialize/deserialize for Router

5 years agoImplement serialize/deserialize for Router. 2019-01-271-cleanup
Antoine Riard [Sun, 16 Dec 2018 03:10:47 +0000 (22:10 -0500)]
Implement serialize/deserialize for Router.

Extend route_test to check if serialize/deserialize of
NetworkMap works.

Add PartialEq traits on some Router's structs.

Modify also UnsignedNodeAnnouncement serialization

5 years agoImplement Writeable/Readable for Option<T>
Antoine Riard [Wed, 23 Jan 2019 16:26:32 +0000 (11:26 -0500)]
Implement Writeable/Readable for Option<T>

Add OptionalField in OpenChannel, AcceptChannel
ChannelReestablish to avoid serialization implementation
conflicts

5 years agoMerge pull request #286 from TheBlueMatt/2019-01-monitor-update-fixes
Matt Corallo [Tue, 22 Jan 2019 20:27:23 +0000 (15:27 -0500)]
Merge pull request #286 from TheBlueMatt/2019-01-monitor-update-fixes

Fix a few monitor-update failure bugs found by new fuzzer

5 years agoFix handling RAA when a monitor update previously failed 2019-01-monitor-update-fixes
Matt Corallo [Wed, 9 Jan 2019 16:05:53 +0000 (11:05 -0500)]
Fix handling RAA when a monitor update previously failed

5 years agoRewrite monitor_update_failed as it didn't capture all the options
Matt Corallo [Tue, 8 Jan 2019 04:10:51 +0000 (23:10 -0500)]
Rewrite monitor_update_failed as it didn't capture all the options

Primarily this fixes the case where we receive an RAA which does
not require a response, allowing us to call monitor_update_failed
without generating pending messages.

5 years agoRemove unused argument from handle_error!
Matt Corallo [Tue, 8 Jan 2019 16:32:17 +0000 (11:32 -0500)]
Remove unused argument from handle_error!

5 years agoMerge pull request #294 from TheBlueMatt/2019-01-deps-bump
Matt Corallo [Tue, 22 Jan 2019 19:32:24 +0000 (14:32 -0500)]
Merge pull request #294 from TheBlueMatt/2019-01-deps-bump

Upgrade to secp256k1 v12, bitcoin v16, and crates bitcoin_hashes

5 years agoEnsure Message always unwraps in fuzztarget 2019-01-deps-bump
Matt Corallo [Thu, 17 Jan 2019 22:36:49 +0000 (17:36 -0500)]
Ensure Message always unwraps in fuzztarget

Hashes cant be all-0s, so we can normally unwrap, but fuzztarget
can generate all-0 hashes, so we have to handle it and swap for
something else.

5 years agoDrop verification context from keys manager
Matt Corallo [Wed, 16 Jan 2019 20:45:28 +0000 (15:45 -0500)]
Drop verification context from keys manager

5 years agoUpgrade to secp256k1 v12, bitcoin v16, and crates bitcoin_hashes
Matt Corallo [Wed, 16 Jan 2019 20:45:05 +0000 (15:45 -0500)]
Upgrade to secp256k1 v12, bitcoin v16, and crates bitcoin_hashes

5 years agoMerge pull request #203 from TheBlueMatt/2018-10-router-htlc-min
Matt Corallo [Tue, 22 Jan 2019 18:48:31 +0000 (13:48 -0500)]
Merge pull request #203 from TheBlueMatt/2018-10-router-htlc-min

Fix Router min HTLC comparison

5 years agoMerge pull request #296 from TheBlueMatt/2019-01-291-rebased
Matt Corallo [Tue, 22 Jan 2019 18:16:45 +0000 (13:16 -0500)]
Merge pull request #296 from TheBlueMatt/2019-01-291-rebased

Wrote test to explicitly test BOLT 2 requirements for update_add_htlc

5 years agoFix Router min HTLC comparison 2018-10-router-htlc-min
Matt Corallo [Tue, 2 Oct 2018 17:46:03 +0000 (13:46 -0400)]
Fix Router min HTLC comparison

5 years agoWrote test to explicitly test BOLT 2 requirements for update_add_htlc 2019-01-291-rebased
Philip Robinson [Tue, 15 Jan 2019 09:52:02 +0000 (11:52 +0200)]
Wrote test to explicitly test BOLT 2 requirements for update_add_htlc

(minor tweaks by @TheBlueMatt)

5 years agoMerge pull request #285 from TheBlueMatt/2019-01-fuzz-cleanups
Matt Corallo [Wed, 16 Jan 2019 15:11:32 +0000 (10:11 -0500)]
Merge pull request #285 from TheBlueMatt/2019-01-fuzz-cleanups

Trivial cleanups in full_stack_target/fuzztarget

5 years agoMerge pull request #284 from TheBlueMatt/2019-01-remote-htlc-timeout-broadcast
Matt Corallo [Sun, 13 Jan 2019 18:55:26 +0000 (13:55 -0500)]
Merge pull request #284 from TheBlueMatt/2019-01-remote-htlc-timeout-broadcast

Check for timing-out HTLCs in remote unrevoked commitments

5 years agoFix comment spelling and clarify algebra a bit. 2019-01-remote-htlc-timeout-broadcast
Matt Corallo [Fri, 11 Jan 2019 21:31:30 +0000 (16:31 -0500)]
Fix comment spelling and clarify algebra a bit.

5 years agoCheck for timing-out HTLCs in remote unrevoked commitments
Matt Corallo [Fri, 4 Jan 2019 19:38:05 +0000 (14:38 -0500)]
Check for timing-out HTLCs in remote unrevoked commitments

This resolves a TODO/issue in would_broadcast_at_height where we
will not fail a channel with HTLCs which time out in remote
broadcastable transactions.

5 years agoTest for failing channel after local commitment dust HTLC timeout
Matt Corallo [Mon, 7 Jan 2019 04:00:56 +0000 (23:00 -0500)]
Test for failing channel after local commitment dust HTLC timeout

5 years agoMerge tracking of HTLCs-in-commitment with outbound-HTLCs
Matt Corallo [Fri, 4 Jan 2019 19:37:48 +0000 (14:37 -0500)]
Merge tracking of HTLCs-in-commitment with outbound-HTLCs

This simplifies a few things, deduplicates a some small memory
overhead, and, most importantly, is a first step to fixing
would_broadcast_at_height.

5 years agoMake HTLCOutputInCommitment::transaction_output_index an Option
Matt Corallo [Sun, 6 Jan 2019 22:02:53 +0000 (17:02 -0500)]
Make HTLCOutputInCommitment::transaction_output_index an Option

We really shouldn't have split out the with-source HTLCs from the
in-transaction HTLCs when we added back-failing, and will need
almost all of the info in HTLCOutputInCommitment for each HTLC to
fix would_broadcast_at_height, so this is a first step at
recombining them.

5 years agoMerge pull request #283 from TheBlueMatt/2019-01-htlc-resolution-log
Matt Corallo [Wed, 9 Jan 2019 04:38:38 +0000 (23:38 -0500)]
Merge pull request #283 from TheBlueMatt/2019-01-htlc-resolution-log

Simplify and expand logging in is_resolving_htlc_output

5 years agoMerge pull request #282 from TheBlueMatt/2019-01-multi-htlc-claims
Matt Corallo [Wed, 9 Jan 2019 04:17:37 +0000 (23:17 -0500)]
Merge pull request #282 from TheBlueMatt/2019-01-multi-htlc-claims

Fix multi-remote-HTLC-claim preimage learning

5 years agoSimplify and expand logging in is_resolving_htlc_output 2019-01-htlc-resolution-log
Matt Corallo [Sun, 6 Jan 2019 22:01:29 +0000 (17:01 -0500)]
Simplify and expand logging in is_resolving_htlc_output

This clarifies all the conditions we can hit and also ensures they
are all logged in a clear and consistent manner.

5 years agoFix multi-remote-HTLC-claim preimage learning 2019-01-multi-htlc-claims
Matt Corallo [Sun, 6 Jan 2019 20:14:43 +0000 (15:14 -0500)]
Fix multi-remote-HTLC-claim preimage learning

When our counterparty claims multiple HTLCs from offered outputs in
one transaction we should still be able to learn the preimages.
Sadly, due to two bugs we were not previously doing so.

5 years agoFix source name in is_resolving_htlc_output
Matt Corallo [Mon, 7 Jan 2019 17:58:36 +0000 (12:58 -0500)]
Fix source name in is_resolving_htlc_output

5 years agoFix dead_code warnings in fuzztarget builds 2019-01-fuzz-cleanups
Matt Corallo [Tue, 8 Jan 2019 04:13:44 +0000 (23:13 -0500)]
Fix dead_code warnings in fuzztarget builds

5 years agoSwitch to bitcoin_hashes Hash160 in full_stack_target
Matt Corallo [Mon, 7 Jan 2019 21:08:08 +0000 (16:08 -0500)]
Switch to bitcoin_hashes Hash160 in full_stack_target

5 years agoAdd doc to full_stack_target
Matt Corallo [Tue, 8 Jan 2019 17:53:12 +0000 (12:53 -0500)]
Add doc to full_stack_target

5 years agoAdd option to use libfuzzer sys in full_stack_target
Matt Corallo [Mon, 3 Dec 2018 18:56:44 +0000 (13:56 -0500)]
Add option to use libfuzzer sys in full_stack_target

Note that there doesn't appear to be a way to conditionally set
 #[no_main] so that has to happen manually at compile-time.

5 years agoMerge pull request #280 from TheBlueMatt/2018-12-no-to-remote-revoked-htlcs
Matt Corallo [Sat, 5 Jan 2019 22:07:40 +0000 (17:07 -0500)]
Merge pull request #280 from TheBlueMatt/2018-12-no-to-remote-revoked-htlcs

Move fail-backwards up for no to-remote output claims

5 years agoFix stale comment in functional_tests after failing back async 2018-12-no-to-remote-revoked-htlcs
Matt Corallo [Sat, 5 Jan 2019 21:18:09 +0000 (16:18 -0500)]
Fix stale comment in functional_tests after failing back async

5 years agoMacro-DRY HTLC back-fails for revoked remote transaction broadcast
Matt Corallo [Thu, 27 Dec 2018 19:12:11 +0000 (14:12 -0500)]
Macro-DRY HTLC back-fails for revoked remote transaction broadcast

5 years agoAdd test_commitment_revoked_fail_backward_exhaustive no_to_remote
Matt Corallo [Thu, 27 Dec 2018 18:55:40 +0000 (13:55 -0500)]
Add test_commitment_revoked_fail_backward_exhaustive no_to_remote

This tests a case we previously didn't handle correctly where we
returned early if there was no to_remote output to claim and thus
failed to fail-backwards HTLCs which were present.

5 years agoAdd dust mode to test_commitment_revoked_fail_backward_exhaustive
Matt Corallo [Thu, 27 Dec 2018 18:53:58 +0000 (13:53 -0500)]
Add dust mode to test_commitment_revoked_fail_backward_exhaustive

This tests that we fail back HTLCs that don't make it into
commitment transactions the same as we test ones that do.

5 years agoMerge pull request #281 from ariard/harden-inbound-htlc-resolved
Matt Corallo [Sat, 5 Jan 2019 04:07:29 +0000 (23:07 -0500)]
Merge pull request #281 from ariard/harden-inbound-htlc-resolved

Harden test for logging of inbound htlc being resolved

5 years agoLog resolution of offered HTLC by HTLC-timeout tx
Antoine Riard [Sun, 30 Dec 2018 19:21:58 +0000 (14:21 -0500)]
Log resolution of offered HTLC by HTLC-timeout tx

5 years agoMove fail-backwards up for no to-remote output claims
Matt Corallo [Fri, 21 Dec 2018 19:32:44 +0000 (14:32 -0500)]
Move fail-backwards up for no to-remote output claims

This fixes HTLC fail-backwards in case we haven't yet sent enough
to have a to_remote output to claim, plus some edge cases where it
could be removed due to a fee update, though hopefully that goes
away with simplified_commitment.

5 years agoMerge pull request #278 from TheBlueMatt/2018-12-fail-on-unrevoked-remote
Matt Corallo [Tue, 1 Jan 2019 01:25:44 +0000 (20:25 -0500)]
Merge pull request #278 from TheBlueMatt/2018-12-fail-on-unrevoked-remote

Fail HTLC backwards on unrevoked remote commitment tx broadcast

5 years agoMore comments/hardening test_fail_backwards_unrevoked_remote_announce 2018-12-fail-on-unrevoked-remote
Antoine Riard [Sun, 30 Dec 2018 19:10:01 +0000 (14:10 -0500)]
More comments/hardening test_fail_backwards_unrevoked_remote_announce

5 years agoFail HTLC backwards on unrevoked remote commitment tx broadcast
Matt Corallo [Fri, 21 Dec 2018 20:16:46 +0000 (15:16 -0500)]
Fail HTLC backwards on unrevoked remote commitment tx broadcast

5 years agoMacro-out BroadcastChannelUpdate-on-channel-close in func tests
Matt Corallo [Fri, 21 Dec 2018 20:15:56 +0000 (15:15 -0500)]
Macro-out BroadcastChannelUpdate-on-channel-close in func tests

5 years agoLog errors forwarding/failing HTLCs
Matt Corallo [Fri, 21 Dec 2018 18:40:51 +0000 (13:40 -0500)]
Log errors forwarding/failing HTLCs

5 years agoRemove long-stale TODO
Matt Corallo [Fri, 21 Dec 2018 03:51:06 +0000 (22:51 -0500)]
Remove long-stale TODO

5 years agoMerge pull request #276 from TheBlueMatt/2018-12-async-fail
Matt Corallo [Sat, 22 Dec 2018 12:02:41 +0000 (07:02 -0500)]
Merge pull request #276 from TheBlueMatt/2018-12-async-fail

 Fail HTLCs backwards asynchronously

5 years agoFail HTLCs backwards asynchronously 2018-12-async-fail
Matt Corallo [Fri, 21 Dec 2018 03:50:25 +0000 (22:50 -0500)]
Fail HTLCs backwards asynchronously

5 years agoAdd an enum option to pending forwards to fail backwards
Matt Corallo [Thu, 20 Dec 2018 21:15:07 +0000 (16:15 -0500)]
Add an enum option to pending forwards to fail backwards

5 years agoRefactor HTLCForwardInfo into an enum in prep for delayed-fail
Matt Corallo [Thu, 20 Dec 2018 20:36:02 +0000 (15:36 -0500)]
Refactor HTLCForwardInfo into an enum in prep for delayed-fail

5 years agomacro-out a bunch of PendingHTLCsForwardable+forward calls
Matt Corallo [Thu, 20 Dec 2018 19:21:18 +0000 (14:21 -0500)]
macro-out a bunch of PendingHTLCsForwardable+forward calls

5 years agoMove process_onion_failure into onion_utils
Matt Corallo [Thu, 20 Dec 2018 19:51:18 +0000 (14:51 -0500)]
Move process_onion_failure into onion_utils

5 years agoMerge pull request #275 from TheBlueMatt/2018-12-manager-split
Matt Corallo [Thu, 20 Dec 2018 19:59:22 +0000 (14:59 -0500)]
Merge pull request #275 from TheBlueMatt/2018-12-manager-split

Split up ChannelManager

5 years agoDrop needless mut found by rustc 1.22 2018-12-manager-split
Matt Corallo [Wed, 19 Dec 2018 22:28:09 +0000 (17:28 -0500)]
Drop needless mut found by rustc 1.22

5 years agoMove ChannelManager network tests into their own module
Matt Corallo [Wed, 19 Dec 2018 22:14:15 +0000 (17:14 -0500)]
Move ChannelManager network tests into their own module

5 years agoMove onion encryption/decryption/etc into an onion_utils module
Matt Corallo [Wed, 19 Dec 2018 22:02:27 +0000 (17:02 -0500)]
Move onion encryption/decryption/etc into an onion_utils module

5 years agoDrop channel_held_info which was only for the channel fuzz target
Matt Corallo [Wed, 19 Dec 2018 21:36:26 +0000 (16:36 -0500)]
Drop channel_held_info which was only for the channel fuzz target

5 years agoMerge pull request #270 from TheBlueMatt/2018-12-drop-rust-crypto
Matt Corallo [Thu, 20 Dec 2018 01:35:46 +0000 (20:35 -0500)]
Merge pull request #270 from TheBlueMatt/2018-12-drop-rust-crypto

Drop rust-crypto for bitcoin_hashes

5 years agotrace_log more in channelmonitor 2018-12-drop-rust-crypto
Matt Corallo [Thu, 20 Dec 2018 00:36:27 +0000 (19:36 -0500)]
trace_log more in channelmonitor

5 years agoUse bitcoin_hashes' fixed_time_eq, removing the rust-crypto dep
Matt Corallo [Tue, 18 Dec 2018 05:01:31 +0000 (00:01 -0500)]
Use bitcoin_hashes' fixed_time_eq, removing the rust-crypto dep

5 years agoDrop rust-crypto trait usage
Matt Corallo [Fri, 14 Dec 2018 20:48:05 +0000 (15:48 -0500)]
Drop rust-crypto trait usage

5 years agoSteal rust-crypto's Poly1305 implementation wholesale
Matt Corallo [Fri, 14 Dec 2018 18:29:55 +0000 (13:29 -0500)]
Steal rust-crypto's Poly1305 implementation wholesale

5 years agoSteal rust-crypto's ChaCha20 implementation wholesale
Matt Corallo [Thu, 13 Dec 2018 22:18:31 +0000 (17:18 -0500)]
Steal rust-crypto's ChaCha20 implementation wholesale

5 years agoUse bitcoin_hashes' Ripemd160/Hash160 from rust-crypto+rust-bitcoin
Matt Corallo [Thu, 13 Dec 2018 21:23:22 +0000 (16:23 -0500)]
Use bitcoin_hashes' Ripemd160/Hash160 from rust-crypto+rust-bitcoin

Note that this requires rewriting full_stack_target tests, which
sucks, but it does let the fuzzer hit more stuff since the real
ripemd160 isn't ever actually called anymore.

5 years agoSwitch Sha256 to using bitcoin_hashes and our own HKDF
Matt Corallo [Tue, 18 Dec 2018 04:58:02 +0000 (23:58 -0500)]
Switch Sha256 to using bitcoin_hashes and our own HKDF

5 years agoChange the way channel keys are generated
Matt Corallo [Fri, 14 Dec 2018 20:55:46 +0000 (15:55 -0500)]
Change the way channel keys are generated

This fixes a somewhat-misuse of HKDF in ChannelKeys::new_from_seed,
but much more importantly removes a use of rust-crypto's HKDF funcs

5 years agoMerge pull request #274 from TheBlueMatt/2018-12-243-review
Matt Corallo [Tue, 18 Dec 2018 04:33:22 +0000 (23:33 -0500)]
Merge pull request #274 from TheBlueMatt/2018-12-243-review

Onion Error Handling

5 years agoUpdate incorrect_payment_amount generation/handling for BOLT uptd 2018-12-243-review
Matt Corallo [Tue, 18 Dec 2018 03:43:05 +0000 (22:43 -0500)]
Update incorrect_payment_amount generation/handling for BOLT uptd

ie dont generate them as they're a really obvious privacy leak.
Luckily we were already handling them the same aside from log
printing so don't have to touch anything there. I was lazy in
updating tests but it only effects log printing, so whatever.

5 years agoAdd tests for process_onion_failure return value sanity
Yuntai Kyong [Mon, 17 Dec 2018 23:55:48 +0000 (18:55 -0500)]
Add tests for process_onion_failure return value sanity

5 years agoAdd test_util for overriding session privs for onion crypt
Matt Corallo [Mon, 17 Dec 2018 19:20:27 +0000 (14:20 -0500)]
Add test_util for overriding session privs for onion crypt

5 years agoAdd some additional channel-creation-broadcast-msg sanity checks
Matt Corallo [Mon, 17 Dec 2018 23:55:22 +0000 (18:55 -0500)]
Add some additional channel-creation-broadcast-msg sanity checks

5 years agoAlways return malformed for BADONION errors
Matt Corallo [Mon, 17 Dec 2018 20:25:32 +0000 (15:25 -0500)]
Always return malformed for BADONION errors

Also be willing to forward something with a pubkey that we know is
complete garbage, but upstream will just fail that with BADONION
when they get it.

I think this is kinda intended by the spec, but it definitely needs
to be clarified.

5 years agoAdd TODO noting confusion over |20 (channel_disabled) definition
Matt Corallo [Mon, 17 Dec 2018 19:46:17 +0000 (14:46 -0500)]
Add TODO noting confusion over |20 (channel_disabled) definition

5 years agoInclude flags when sending channel_disabled onion errors
Yuntai Kyong [Mon, 17 Dec 2018 19:25:38 +0000 (14:25 -0500)]
Include flags when sending channel_disabled onion errors

5 years agoRewrite most of process_onion_failure
Yuntai Kyong [Mon, 17 Dec 2018 23:54:48 +0000 (18:54 -0500)]
Rewrite most of process_onion_failure

5 years agoSwap an if let for a match and add some TODO
Yuntai Kyong [Mon, 17 Dec 2018 18:49:12 +0000 (13:49 -0500)]
Swap an if let for a match and add some TODO

5 years agoMerge pull request #273 from ariard/2018-12-17-replace-by-permanent-channel-failure
Matt Corallo [Tue, 18 Dec 2018 03:55:22 +0000 (22:55 -0500)]
Merge pull request #273 from ariard/2018-12-17-replace-by-permanent-channel-failure

Replace some unknown_next_peer by permanent_channel_failure

5 years agoReplace some unknown_next_peer by permanent_channel_failure
Antoine Riard [Tue, 18 Dec 2018 01:47:19 +0000 (20:47 -0500)]
Replace some unknown_next_peer by permanent_channel_failure

5 years agoMerge pull request #269 from TheBlueMatt/2018-12-198-review
Matt Corallo [Mon, 17 Dec 2018 17:11:36 +0000 (12:11 -0500)]
Merge pull request #269 from TheBlueMatt/2018-12-198-review

Detect HTLC-resolving on-chain actions and pass them to ChannelManager

5 years agoAdd some TODOs for correctness in ChannelMonitor 2018-12-198-review
Matt Corallo [Wed, 12 Dec 2018 19:42:09 +0000 (14:42 -0500)]
Add some TODOs for correctness in ChannelMonitor

5 years agoAdd constant for HTLC failure anti-reorg delay
Matt Corallo [Wed, 12 Dec 2018 20:25:57 +0000 (15:25 -0500)]
Add constant for HTLC failure anti-reorg delay