@@ -4,15 +4,14 @@ public class ChainMonitor {
4
4
5
5
/* DEFAULT_CONSTRUCTOR_START */
6
6
public init ( chain_source: Filter ? , broadcaster: BroadcasterInterface , logger: Logger , feeest: FeeEstimator , persister: Persist ) {
7
-
7
+
8
8
var chain_sourcePointer : UnsafeMutablePointer < LDKFilter > ? = nil
9
9
if let chain_sourceUnwrapped = chain_source {
10
10
chain_sourcePointer = UnsafeMutablePointer< LDKFilter> . allocate( capacity: 1 )
11
11
chain_sourcePointer!. initialize ( to: chain_sourceUnwrapped. cOpaqueStruct!)
12
12
}
13
-
13
+
14
14
self . cOpaqueStruct = ChainMonitor_new ( chain_sourcePointer, broadcaster. cOpaqueStruct!, logger. cOpaqueStruct!, feeest. cOpaqueStruct!, persister. cOpaqueStruct!)
15
- chain_sourcePointer? . deallocate ( )
16
15
}
17
16
/* DEFAULT_CONSTRUCTOR_END */
18
17
@@ -23,45 +22,43 @@ public class ChainMonitor {
23
22
/* STRUCT_METHODS_START */
24
23
25
24
public func as_Listen( ) -> Listen {
26
-
25
+
27
26
return NativelyImplementedListen ( pointer: withUnsafePointer ( to: self . cOpaqueStruct!) { ( this_argPointer: UnsafePointer < LDKChainMonitor > ) in
28
27
ChainMonitor_as_Listen ( this_argPointer)
29
28
} ) ;
30
29
}
31
30
32
31
public func as_Confirm( ) -> Confirm {
33
-
32
+
34
33
return NativelyImplementedConfirm ( pointer: withUnsafePointer ( to: self . cOpaqueStruct!) { ( this_argPointer: UnsafePointer < LDKChainMonitor > ) in
35
34
ChainMonitor_as_Confirm ( this_argPointer)
36
35
} ) ;
37
36
}
38
37
39
38
public func as_Watch( ) -> Watch {
40
-
39
+
41
40
return NativelyImplementedWatch ( pointer: withUnsafePointer ( to: self . cOpaqueStruct!) { ( this_argPointer: UnsafePointer < LDKChainMonitor > ) in
42
41
ChainMonitor_as_Watch ( this_argPointer)
43
42
} ) ;
44
43
}
45
44
46
45
public func as_EventsProvider( ) -> EventsProvider {
47
-
46
+
48
47
return NativelyImplementedEventsProvider ( pointer: withUnsafePointer ( to: self . cOpaqueStruct!) { ( this_argPointer: UnsafePointer < LDKChainMonitor > ) in
49
48
ChainMonitor_as_EventsProvider ( this_argPointer)
50
49
} ) ;
51
50
}
52
51
53
-
52
+
54
53
deinit {
55
- if self . cOpaqueStruct? . is_owned == false {
56
-
57
-
58
-
54
+
55
+
56
+
59
57
ChainMonitor_free ( self . cOpaqueStruct!)
60
-
61
- }
62
-
58
+
59
+
63
60
}
64
-
61
+
65
62
/* STRUCT_METHODS_END */
66
63
67
64
}
0 commit comments