]> git.bitcoin.ninja Git - rust-lightning/commit
Remove the `final_cltv_expiry_delta` in `RouteParameters` entirely 2023-02-no-dumb-redundant-fields
authorMatt Corallo <git@bluematt.me>
Mon, 6 Feb 2023 22:12:09 +0000 (22:12 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 27 Feb 2023 22:33:21 +0000 (22:33 +0000)
commitf03b7cd448ab1b9f7613f964bdea7c5c1a00da3c
tree1ba17616f8852c236585133d8214705d62b29bd1
parent6aa5ebb1aac21f65462bbd747627ae58e2949ae3
Remove the `final_cltv_expiry_delta` in `RouteParameters` entirely

fbc08477e8dcdd8f3f2ada8ca77388b6185febe2 purported to "move" the
`final_cltv_expiry_delta` field to `PaymentParamters` from
`RouteParameters`. However, for naive backwards-compatibility
reasons it left the existing on in place and only added a new,
redundant field in `PaymentParameters`.

It turns out there's really no reason for this - if we take a more
critical eye towards backwards compatibility we can figure out the
correct value in every `PaymentParameters` while deserializing.

We do this here - making `PaymentParameters` a `ReadableArgs`
taking a "default" `cltv_expiry_delta` when it goes to read. This
allows existing `RouteParameters` objects to pass the read
`final_cltv_expiry_delta` field in to be used if the new field
wasn't present.
fuzz/src/full_stack.rs
fuzz/src/router.rs
lightning-invoice/src/payment.rs
lightning-invoice/src/utils.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/outbound_payment.rs
lightning/src/ln/payment_tests.rs
lightning/src/routing/router.rs