@@ -26,7 +26,7 @@ use crate::c_types::*;
26
26
27
27
28
28
use lightning:: chain:: chainmonitor:: ChainMonitor as nativeChainMonitorImport;
29
- type nativeChainMonitor = nativeChainMonitorImport < crate :: chain:: keysinterface:: ChannelKeys , crate :: chain:: Filter , crate :: chain:: chaininterface:: BroadcasterInterface , crate :: chain:: chaininterface:: FeeEstimator , crate :: util:: logger:: Logger > ;
29
+ type nativeChainMonitor = nativeChainMonitorImport < crate :: chain:: keysinterface:: ChannelKeys , crate :: chain:: Filter , crate :: chain:: chaininterface:: BroadcasterInterface , crate :: chain:: chaininterface:: FeeEstimator , crate :: util:: logger:: Logger , crate :: chain :: channelmonitor :: Persist > ;
30
30
31
31
/// An implementation of [`chain::Watch`] for monitoring channels.
32
32
///
@@ -111,9 +111,9 @@ pub extern "C" fn ChainMonitor_block_disconnected(this_arg: &ChainMonitor, heade
111
111
/// [`chain::Filter`]: ../trait.Filter.html
112
112
#[ must_use]
113
113
#[ no_mangle]
114
- pub extern "C" fn ChainMonitor_new ( chain_source : * mut crate :: chain:: Filter , mut broadcaster : crate :: chain:: chaininterface:: BroadcasterInterface , mut logger : crate :: util:: logger:: Logger , mut feeest : crate :: chain:: chaininterface:: FeeEstimator ) -> ChainMonitor {
114
+ pub extern "C" fn ChainMonitor_new ( chain_source : * mut crate :: chain:: Filter , mut broadcaster : crate :: chain:: chaininterface:: BroadcasterInterface , mut logger : crate :: util:: logger:: Logger , mut feeest : crate :: chain:: chaininterface:: FeeEstimator , mut persister : crate :: chain :: channelmonitor :: Persist ) -> ChainMonitor {
115
115
let mut local_chain_source = if chain_source == std:: ptr:: null_mut ( ) { None } else { Some ( { unsafe { * Box :: from_raw ( chain_source) } } ) } ;
116
- let mut ret = lightning:: chain:: chainmonitor:: ChainMonitor :: new ( local_chain_source, broadcaster, logger, feeest) ;
116
+ let mut ret = lightning:: chain:: chainmonitor:: ChainMonitor :: new ( local_chain_source, broadcaster, logger, feeest, persister ) ;
117
117
ChainMonitor { inner : Box :: into_raw ( Box :: new ( ret) ) , is_owned : true }
118
118
}
119
119
@@ -129,8 +129,8 @@ pub extern "C" fn ChainMonitor_as_Watch(this_arg: *const ChainMonitor) -> crate:
129
129
}
130
130
use lightning:: chain:: Watch as WatchTraitImport ;
131
131
#[ must_use]
132
- extern "C" fn ChainMonitor_Watch_watch_channel ( this_arg : * const c_void , mut funding_txo : crate :: chain:: transaction:: OutPoint , mut monitor : crate :: chain:: channelmonitor:: ChannelMonitor ) -> crate :: c_types:: derived:: CResult_NoneChannelMonitorUpdateErrZ {
133
- let mut ret = unsafe { & mut * ( this_arg as * mut nativeChainMonitor ) } . watch_channel ( * unsafe { Box :: from_raw ( funding_txo . take_ptr ( ) ) } , * unsafe { Box :: from_raw ( monitor. take_ptr ( ) ) } ) ;
132
+ extern "C" fn ChainMonitor_Watch_watch_channel ( this_arg : * const c_void , mut funding_outpoint : crate :: chain:: transaction:: OutPoint , mut monitor : crate :: chain:: channelmonitor:: ChannelMonitor ) -> crate :: c_types:: derived:: CResult_NoneChannelMonitorUpdateErrZ {
133
+ let mut ret = unsafe { & mut * ( this_arg as * mut nativeChainMonitor ) } . watch_channel ( * unsafe { Box :: from_raw ( funding_outpoint . take_ptr ( ) ) } , * unsafe { Box :: from_raw ( monitor. take_ptr ( ) ) } ) ;
134
134
let mut local_ret = match ret { Ok ( mut o) => crate :: c_types:: CResultTempl :: ok ( { 0u8 /*o*/ } ) , Err ( mut e) => crate :: c_types:: CResultTempl :: err ( { crate :: chain:: channelmonitor:: ChannelMonitorUpdateErr :: native_into ( e) } ) } ;
135
135
local_ret
136
136
}
0 commit comments