]> git.bitcoin.ninja Git - rust-lightning/commit
Use UserConfig to determine advertised InitFeatures by ChannelManager
authorWilmer Paulino <wilmer.paulino@gmail.com>
Wed, 11 Jan 2023 18:21:29 +0000 (10:21 -0800)
committerWilmer Paulino <wilmer.paulino@gmail.com>
Sat, 14 Jan 2023 07:54:51 +0000 (23:54 -0800)
commitabf4e79dcda4c97dd80dd00233de32507184543a
treea99ea20c5c2a174b868af2a0ae51ad389971da51
parentac6e0b3fed4119c196a5e1e864239087422727ea
Use UserConfig to determine advertised InitFeatures by ChannelManager

This is purely a refactor that does not change the InitFeatures
advertised by a ChannelManager. This allows users to configure which
features should be advertised based on the values of `UserConfig`. While
there aren't any existing features currently leveraging this behavior,
it will be used by the upcoming anchors_zero_fee_htlc_tx feature.

The UserConfig dependency on provided_init_features caused most
callsites of the main test methods responsible for opening channels to
be updated. This commit foregos that completely by no longer requiring
the InitFeatures of each side to be provided to these methods. The
methods already require a reference to each node's ChannelManager to
open the channel, so we use that same reference to obtain their
InitFeatures. A way to override such features was required for some
tests, so a new `override_init_features` config option now exists on
the test harness.
25 files changed:
fuzz/src/chanmon_consistency.rs
fuzz/src/router.rs
lightning-background-processor/src/lib.rs
lightning-invoice/src/payment.rs
lightning-invoice/src/utils.rs
lightning-persister/src/lib.rs
lightning/src/chain/chainmonitor.rs
lightning/src/chain/channelmonitor.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/priv_short_conf_tests.rs
lightning/src/ln/reload_tests.rs
lightning/src/ln/reorg_tests.rs
lightning/src/ln/script.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/routing/gossip.rs
lightning/src/routing/router.rs
lightning/src/routing/scoring.rs
lightning/src/util/test_utils.rs