Fixes a panic (#8928)

This commit is contained in:
Arya 2024-10-10 19:34:42 -04:00 committed by GitHub
parent f2e7bc95ce
commit fea9f46fbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -89,6 +89,14 @@ pub struct ConfiguredFundingStreams {
}
impl ConfiguredFundingStreams {
/// Returns an empty [`ConfiguredFundingStreams`].
fn empty() -> Self {
Self {
height_range: None,
recipients: Some(Vec::new()),
}
}
/// Converts a [`ConfiguredFundingStreams`] to a [`FundingStreams`], using the provided default values
/// if `height_range` or `recipients` are None.
fn convert_with_default(
@ -601,10 +609,10 @@ impl Parameters {
.with_halving_interval(PRE_BLOSSOM_REGTEST_HALVING_INTERVAL);
// TODO: Always clear funding streams on Regtest once the testnet parameters are being serialized (#8920).
#[cfg(not(any(test, feature = "proptest-impl")))]
// #[cfg(not(any(test, feature = "proptest-impl")))]
let parameters = parameters
.with_pre_nu6_funding_streams(ConfiguredFundingStreams::default())
.with_post_nu6_funding_streams(ConfiguredFundingStreams::default());
.with_pre_nu6_funding_streams(ConfiguredFundingStreams::empty())
.with_post_nu6_funding_streams(ConfiguredFundingStreams::empty());
Self {
network_name: "Regtest".to_string(),