Skip to content

Commit

Permalink
Merge pull request #166 from p2pderivatives/byo-chain-monitor
Browse files Browse the repository at this point in the history
Load ChainMonitor in (DLC) Manager constructor if possible
  • Loading branch information
luckysori authored Nov 3, 2023
2 parents 6801d17 + 9656c8e commit dda16c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dlc-manager/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,18 @@ where
time: T,
fee_estimator: F,
) -> Result<Self, Error> {
let chain_monitor = store
.get_chain_monitor()?
.unwrap_or(ChainMonitor::new(blockchain.get_blockchain_height()?));

Ok(Manager {
secp: secp256k1_zkp::Secp256k1::new(),
wallet,
store,
oracles,
time,
fee_estimator,
chain_monitor: Mutex::new(ChainMonitor::new(blockchain.get_blockchain_height()?)),
chain_monitor: Mutex::new(chain_monitor),
blockchain,
})
}
Expand Down

0 comments on commit dda16c3

Please sign in to comment.