Remove `Outpoint::to_channel_id` method
authorDuncan Dean <git@dunxen.dev>
Tue, 9 Jan 2024 07:07:01 +0000 (09:07 +0200)
committerDuncan Dean <git@dunxen.dev>
Tue, 30 Jan 2024 10:30:26 +0000 (12:30 +0200)
commitcf2c27800a1b30e72d4f7397c931cf6624594233
tree8765809dfc31668c10c776f819aa60e49ea43d99
parent51d9ee35e53534bb2d907fc105699114134736a5
Remove `Outpoint::to_channel_id` method

To avoid confusion and for accuracy going forward, we remove this method
as it is inconsistent with channel IDs generated during V2 channel
establishment. If one wants to create a V1, funding outpoint-based
channel ID, then `ChannelId::v1_from_funding_outpoint` should be used
instead.

A large portion of the library has always made the assumption that having
the funding outpoint will always allow us to generate the channel ID.
This will not be the case anymore and we need to pass the channel ID along
where appropriate. All channels that could have been persisted up to this
point could only have used V1 establishment, so if some structures don't
store a channel ID for them they can safely fall back to the funding
outpoint-based version.
24 files changed:
.gitignore
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
lightning-background-processor/src/lib.rs
lightning-persister/src/fs_store.rs
lightning/src/chain/chainmonitor.rs
lightning/src/chain/channelmonitor.rs
lightning/src/chain/mod.rs
lightning/src/chain/transaction.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channel_id.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/peer_handler.rs
lightning/src/ln/priv_short_conf_tests.rs
lightning/src/ln/reload_tests.rs
lightning/src/ln/reorg_tests.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/util/macro_logger.rs
lightning/src/util/persist.rs
lightning/src/util/test_utils.rs