From 4a0fc3e980bd40fe8c0296f5d8599ff3580549f0 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 8 Feb 2019 20:02:17 -0800 Subject: [PATCH] watchtower/multi: thread ChainHash to server --- watchtower/config.go | 6 ++++++ watchtower/standalone.go | 1 + 2 files changed, 7 insertions(+) diff --git a/watchtower/config.go b/watchtower/config.go index 733ebb0b..b8136682 100644 --- a/watchtower/config.go +++ b/watchtower/config.go @@ -6,6 +6,7 @@ import ( "time" "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/tor" @@ -35,6 +36,11 @@ var ( // All nil-able elements with the Config must be set in order for the Watchtower // to function properly. type Config struct { + // ChainHash identifies the chain that the watchtower will be monitoring + // for breaches and that will be advertised in the server's Init message + // to inbound clients. + ChainHash chainhash.Hash + // BlockFetcher supports the ability to fetch blocks from the network by // hash. BlockFetcher lookout.BlockFetcher diff --git a/watchtower/standalone.go b/watchtower/standalone.go index ebb3646d..f55f44cb 100644 --- a/watchtower/standalone.go +++ b/watchtower/standalone.go @@ -78,6 +78,7 @@ func New(cfg *Config) (*Standalone, error) { // Initialize the server with its required resources. server, err := wtserver.New(&wtserver.Config{ + ChainHash: cfg.ChainHash, DB: cfg.DB, NodePrivKey: cfg.NodePrivKey, Listeners: listeners,