@@ -40,6 +40,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
40
40
fileprivate var scorer : MultiThreadedLockableScore ?
41
41
fileprivate let keysInterface : KeysInterface !
42
42
public private( set) var payer : InvoicePayer ?
43
+ fileprivate var payerRetries : Retry !
43
44
public let peerManager : PeerManager
44
45
private var tcpPeerHandler : TCPPeerHandler ?
45
46
@@ -54,7 +55,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
54
55
private let chain_monitor : ChainMonitor
55
56
56
57
57
- public init ( channelManagerSerialized: [ UInt8 ] , channelMonitorsSerialized: [ [ UInt8 ] ] , keysInterface: KeysInterface , feeEstimator: FeeEstimator , chainMonitor: ChainMonitor , filter: Filter ? , netGraphSerialized: [ UInt8 ] ? , txBroadcaster: BroadcasterInterface , logger: Logger , enableP2PGossip: Bool = false , userConfig: UserConfig = UserConfig . initWithDefault ( ) ) throws {
58
+ public init ( channelManagerSerialized: [ UInt8 ] , channelMonitorsSerialized: [ [ UInt8 ] ] , keysInterface: KeysInterface , feeEstimator: FeeEstimator , chainMonitor: ChainMonitor , filter: Filter ? , netGraphSerialized: [ UInt8 ] ? , txBroadcaster: BroadcasterInterface , logger: Logger , enableP2PGossip: Bool = false , userConfig: UserConfig = UserConfig . initWithDefault ( ) , payerRetries : Retry = Retry . initWithAttempts ( a : UInt ( 3 ) ) ) throws {
58
59
59
60
var monitors : [ ChannelMonitor ] = [ ]
60
61
self . channel_monitors = [ ]
@@ -98,6 +99,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
98
99
self . channel_manager_latest_block_hash = latestBlockHash
99
100
self . chain_monitor = chainMonitor
100
101
self . keysInterface = keysInterface
102
+ self . payerRetries = payerRetries
101
103
self . logger = logger
102
104
103
105
let random_data = keysInterface. getSecureRandomBytes ( ) ;
@@ -142,14 +144,15 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
142
144
/**
143
145
* Constructs a channel manager from the given interface implementations
144
146
*/
145
- public init ( network: Network , userConfig: UserConfig , currentBlockchainTipHash: [ UInt8 ] , currentBlockchainTipHeight: UInt32 , keysInterface: KeysInterface , feeEstimator: FeeEstimator , chainMonitor: ChainMonitor , netGraph: NetworkGraph ? , txBroadcaster: BroadcasterInterface , logger: Logger , enableP2PGossip: Bool = false ) {
147
+ public init ( network: Network , userConfig: UserConfig , currentBlockchainTipHash: [ UInt8 ] , currentBlockchainTipHeight: UInt32 , keysInterface: KeysInterface , feeEstimator: FeeEstimator , chainMonitor: ChainMonitor , netGraph: NetworkGraph ? , txBroadcaster: BroadcasterInterface , logger: Logger , enableP2PGossip: Bool = false , payerRetries : Retry = Retry . initWithAttempts ( a : UInt ( 3 ) ) ) {
146
148
147
149
self . channel_monitors = [ ]
148
150
self . channel_manager_latest_block_hash = nil
149
151
self . chain_monitor = chainMonitor
150
152
let block = BestBlock ( blockHash: currentBlockchainTipHash, height: currentBlockchainTipHeight)
151
153
let chainParameters = ChainParameters ( networkArg: network, bestBlockArg: block)
152
154
self . channelManager = ChannelManager ( feeEst: feeEstimator, chainMonitor: chainMonitor. asWatch ( ) , txBroadcaster: txBroadcaster, logger: logger, keysManager: keysInterface, config: userConfig, params: chainParameters)
155
+ self . payerRetries = payerRetries
153
156
self . logger = logger
154
157
155
158
self . keysInterface = keysInterface
@@ -214,7 +217,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
214
217
// either dangle router, or set is_owned to false
215
218
// scorer.cType!.is_owned = false
216
219
// router.cType!.is_owned = false
217
- self . payer = InvoicePayer ( payer: self . channelManager. asPayer ( ) , router: router. asRouter ( ) , logger: self . logger, eventHandler: self . customEventHandler!, retry: Retry . initWithAttempts ( a : UInt ( 3 ) ) )
220
+ self . payer = InvoicePayer ( payer: self . channelManager. asPayer ( ) , router: router. asRouter ( ) , logger: self . logger, eventHandler: self . customEventHandler!, retry: self . payerRetries )
218
221
// router.cType!.is_owned = true
219
222
self . customEventHandler = self . payer!. asEventHandler ( )
220
223
}
0 commit comments