From c762fe0caafe3c6e8db3dcfbae3d4de88d30b5e0 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Mon, 12 Mar 2018 13:40:06 -0700 Subject: [PATCH] htlcswitch/switch: pass ExtractErrorEncrypter to circuitMap --- htlcswitch/switch.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index 3971e5e1..f1c8efc5 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -130,6 +130,11 @@ type Config struct { // active channels. This gives the switch the ability to read arbitrary // forwarding packages, and ack settles and fails contained within them. SwitchPackager channeldb.FwdOperator + + // ExtractErrorEncrypter is an interface allowing switch to reextract + // error encrypters stored in the circuit map on restarts, since they + // are not stored directly within the database. + ExtractErrorEncrypter ErrorEncrypterExtracter } // Switch is the central messaging bus for all incoming/outgoing HTLCs. @@ -214,7 +219,10 @@ type Switch struct { // New creates the new instance of htlc switch. func New(cfg Config) (*Switch, error) { - circuitMap, err := NewCircuitMap(cfg.DB) + circuitMap, err := NewCircuitMap(&CircuitMapConfig{ + DB: cfg.DB, + ExtractErrorEncrypter: cfg.ExtractErrorEncrypter, + }) if err != nil { return nil, err }