rust-lightning/lightning/src/ln
Matt Corallo 8bf3d8dec2 Req+check payment secrets for inbound payments pre-PaymentReceived
Our current PaymentReceived API is incredibly easy to mis-use -
the "obvious" way to implement a client is to always call
`ChannelManager::claim_funds` in response to a `PaymentReceived`
event. However, users are *required* to check the payment secret
and value against the expected values before claiming in order to
avoid a number of potentially funds-losing attacks.

Instead, if we rely on payment secrets being pre-registered with
the ChannelManager before we receive HTLCs for a payment we can
simply check the payment secrets and never generate
`PaymentReceived` events if they do not match. Further, when the
user knows the value to expect in advance, we can have them
register it as well, allowing us to check it for them.

Other implementations already require payment secrets for inbound
payments, so this shouldn't materially lose compatibility.
2021-04-28 15:30:25 -04:00
..
chan_utils.rs Fix serialization expected lengths and check them in test/fuzzing 2021-04-27 01:09:12 +00:00
chanmon_update_fail_tests.rs Use payment_secrets in all sends in functional tests 2021-04-28 15:30:25 -04:00
channel.rs Merge pull request #890 from TheBlueMatt/2021-04-fix-chan-shutdown-crash 2021-04-24 00:03:42 +00:00
channelmanager.rs Req+check payment secrets for inbound payments pre-PaymentReceived 2021-04-28 15:30:25 -04:00
features.rs Set payment_secret to required in features flags 2021-04-27 23:40:33 +00:00
functional_test_utils.rs Use payment_secrets in all sends in functional tests 2021-04-28 15:30:25 -04:00
functional_tests.rs Req+check payment secrets for inbound payments pre-PaymentReceived 2021-04-28 15:30:25 -04:00
mod.rs Add a simple send-funds benchmark in channelmanager 2021-03-31 19:55:23 -04:00
msgs.rs Fix serialization expected lengths and check them in test/fuzzing 2021-04-27 01:09:12 +00:00
onchaintx.rs Rename onchain_events_waiting_threshold_conf 2021-04-14 13:00:16 -07:00
onion_route_tests.rs Req+check payment secrets for inbound payments pre-PaymentReceived 2021-04-28 15:30:25 -04:00
onion_utils.rs Log the node generating an onion error 2021-04-05 16:23:34 -04:00
peer_channel_encryptor.rs fix all clippy::redundant_field_names warnings 2020-10-07 11:20:21 -07:00
peer_handler.rs [peer_handler] Take the peers lock before getting messages to send 2021-04-21 22:03:45 +00:00
reorg_tests.rs Pipe through PaymentSecrets in tests during payment hash creation 2021-04-28 15:30:25 -04:00
wire.rs Drop all HTML-relative links since rustdoc now supports resolution 2021-03-18 11:28:23 -04:00