watchtower/multi: thread ChainHash to server

This commit is contained in:
Conner Fromknecht 2019-02-08 20:02:17 -08:00
parent b3a9650ff9
commit 4a0fc3e980
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
2 changed files with 7 additions and 0 deletions

@ -6,6 +6,7 @@ import (
"time" "time"
"github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/tor" "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 // All nil-able elements with the Config must be set in order for the Watchtower
// to function properly. // to function properly.
type Config struct { 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 // BlockFetcher supports the ability to fetch blocks from the network by
// hash. // hash.
BlockFetcher lookout.BlockFetcher BlockFetcher lookout.BlockFetcher

@ -78,6 +78,7 @@ func New(cfg *Config) (*Standalone, error) {
// Initialize the server with its required resources. // Initialize the server with its required resources.
server, err := wtserver.New(&wtserver.Config{ server, err := wtserver.New(&wtserver.Config{
ChainHash: cfg.ChainHash,
DB: cfg.DB, DB: cfg.DB,
NodePrivKey: cfg.NodePrivKey, NodePrivKey: cfg.NodePrivKey,
Listeners: listeners, Listeners: listeners,