@@ -52,25 +52,28 @@ func currencyString(_ currency: Currency) -> String {
5252func getProbabilisticScorer( path: URL , networkGraph: NetworkGraph , logger: LdkLogger ) -> ProbabilisticScorer {
5353 let scoringParams = ProbabilisticScoringParameters . initWithDefault ( )
5454
55- var probabalisticScorer : ProbabilisticScorer ?
56- if let storedScorer = try ? Data ( contentsOf: path. appendingPathComponent ( LdkFileNames . scorer. rawValue) . standardizedFileURL) {
57- let scorerRead = ProbabilisticScorer . read ( ser: [ UInt8] ( storedScorer) , argA: scoringParams, argB: networkGraph, argC: logger)
58-
59- if scorerRead. isOk ( ) {
60- LdkEventEmitter . shared. send ( withEvent: . native_log, body: " Loaded scorer from disk " )
61- probabalisticScorer = scorerRead. getValue ( )
62- } else {
63- LdkEventEmitter . shared. send ( withEvent: . native_log, body: " Failed to load cached scorer " )
64- }
65- }
66-
67- //Doesn't exist or error reading it
68- if probabalisticScorer == nil {
69- LdkEventEmitter . shared. send ( withEvent: . native_log, body: " Starting scorer from scratch " )
70- probabalisticScorer = ProbabilisticScorer ( params: scoringParams, networkGraph: networkGraph, logger: logger)
71- }
55+ //TODO remove below line and uncomment below to enable reading cached scorer again
56+ return ProbabilisticScorer ( params: scoringParams, networkGraph: networkGraph, logger: logger)
7257
73- return probabalisticScorer!
58+ // var probabalisticScorer: ProbabilisticScorer?
59+ // if let storedScorer = try? Data(contentsOf: path.appendingPathComponent(LdkFileNames.scorer.rawValue).standardizedFileURL) {
60+ // let scorerRead = ProbabilisticScorer.read(ser: [UInt8](storedScorer), argA: scoringParams, argB: networkGraph, argC: logger)
61+ //
62+ // if scorerRead.isOk() {
63+ // LdkEventEmitter.shared.send(withEvent: .native_log, body: "Loaded scorer from disk")
64+ // probabalisticScorer = scorerRead.getValue()
65+ // } else {
66+ // LdkEventEmitter.shared.send(withEvent: .native_log, body: "Failed to load cached scorer")
67+ // }
68+ // }
69+ //
70+ // //Doesn't exist or error reading it
71+ // if probabalisticScorer == nil {
72+ // LdkEventEmitter.shared.send(withEvent: .native_log, body: "Starting scorer from scratch")
73+ // probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
74+ // }
75+ //
76+ // return probabalisticScorer!
7477}
7578
7679extension Invoice {
0 commit comments