Skip to content

Commit fa92865

Browse files
ChannelManager: track whether to advertise onion msgs in NodeFeatures
1 parent b3b55bb commit fa92865

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use core::{cmp, mem};
6565
use core::cell::RefCell;
6666
use io::Read;
6767
use sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
68-
use core::sync::atomic::{AtomicUsize, Ordering};
68+
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
6969
use core::time::Duration;
7070
use core::ops::Deref;
7171

@@ -688,6 +688,7 @@ pub struct ChannelManager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref,
688688
{
689689
default_configuration: UserConfig,
690690
genesis_hash: BlockHash,
691+
advertise_onion_message_support: AtomicBool,
691692
fee_estimator: LowerBoundedFeeEstimator<F>,
692693
chain_monitor: M,
693694
tx_broadcaster: T,
@@ -1592,6 +1593,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
15921593
ChannelManager {
15931594
default_configuration: config.clone(),
15941595
genesis_hash: genesis_block(params.network).header.block_hash(),
1596+
advertise_onion_message_support: AtomicBool::new(false),
15951597
fee_estimator: LowerBoundedFeeEstimator::new(fee_est),
15961598
chain_monitor,
15971599
tx_broadcaster,
@@ -6236,7 +6238,9 @@ impl<Signer: Sign, M: Deref , T: Deref , K: Deref , F: Deref , L: Deref >
62366238
}
62376239
}
62386240

6239-
fn advertise_onion_message_support(&self) {}
6241+
fn advertise_onion_message_support(&self) {
6242+
self.advertise_onion_message_support.store(true, Ordering::Release);
6243+
}
62406244
}
62416245

62426246
/// Used to signal to the ChannelManager persister that the manager needs to be re-persisted to
@@ -7283,6 +7287,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
72837287

72847288
let channel_manager = ChannelManager {
72857289
genesis_hash,
7290+
advertise_onion_message_support: AtomicBool::new(false),
72867291
fee_estimator: bounded_fee_estimator,
72877292
chain_monitor: args.chain_monitor,
72887293
tx_broadcaster: args.tx_broadcaster,

0 commit comments

Comments
 (0)