Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit b61681b

Browse files
bors[bot]luckysori
andauthored
Merge #377
377: Fix open CFD functionality r=luckysori a=luckysori Fixes #369. Interestingly, reverting 38c09b2 does the trick. My theory is that the taker wasn't able to pick up the funding transaction because of the missing filter, so the channel would never be considered ready and the short channel ID would never be available when opening a CFD. Co-authored-by: Lucas Soriano del Pino <lucas_soriano@fastmail.com>
2 parents b5befb6 + 057ef14 commit b61681b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

rust/src/config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ const MAINNET_ELECTRUM: &str = "ssl://blockstream.info:700";
99
const TESTNET_ELECTRUM: &str = "ssl://blockstream.info:993";
1010
const REGTEST_ELECTRUM: &str = "tcp://localhost:50000";
1111

12-
pub static MAINNET_MEMPOOL: &str = "https://mempool.space/api/v1";
13-
pub static TESTNET_MEMPOOL: &str = "https://mempool.space/testnet/api/v1";
14-
1512
static REGTEST_MAKER_IP: &str = "127.0.0.1";
1613
static REGTEST_MAKER_PORT_HTTP: u64 = 8000;
1714
// Maker PK is derived from our checked in regtest maker seed

rust/src/lightning.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,16 @@ pub fn setup(
335335
// Step 4: Initialize Persist
336336
let persister = Arc::new(FilesystemPersister::new(ldk_data_dir.clone()));
337337

338+
// TODO: Maybe we don't really need to have the transaction filter (this one
339+
// was removed in ldk-example)
340+
// Step 5: Initialize the Transaction Filter
341+
342+
// LightningWallet implements the Filter trait for us
343+
let filter = lightning_wallet.clone();
344+
338345
// Step 6: Initialize the ChainMonitor
339346
let chain_monitor: Arc<ChainMonitor> = Arc::new(chainmonitor::ChainMonitor::new(
340-
None, // TODO: Consider re-enabling the filter (lightning_wallet.clone())
347+
Some(filter.clone()),
341348
broadcaster.clone(),
342349
logger.clone(),
343350
fee_estimator.clone(),
@@ -420,10 +427,9 @@ pub fn setup(
420427

421428
// Make sure our filter is initialized with all the txs and outputs
422429
// that we need to be watching based on our set of channel monitors
423-
// TODO: Re-enable this if added filter
424-
// for (_, monitor) in channelmonitors.iter() {
425-
// monitor.load_outputs_to_watch(&filter.clone());
426-
// }
430+
for (_, monitor) in channelmonitors.iter() {
431+
monitor.load_outputs_to_watch(&filter.clone());
432+
}
427433

428434
// `Confirm` trait is not implemented on an individual ChannelMonitor
429435
// but on a tuple consisting of (channel_monitor, broadcaster, fee_estimator, logger)

0 commit comments

Comments
 (0)