watchtower/wtpolicy: add basic validity constraints

This commit is contained in:
Conner Fromknecht committed 2019-06-13 19:54:22 -07:00
1 parent 37052f1561
commit a543c781fe
3 files changed
+140 -6

No files matched your search

+4
View File
@@ -1069,6 +1069,10 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB,
policy.SweepFeeRate = sweepRateSatPerByte.FeePerKWeight()
}
if err := policy.Validate(); err != nil {
return nil, err
}
s.towerClient, err = wtclient.New(&wtclient.Config{
Signer: cc.wallet.Cfg.Signer,
NewAddress: newSweepPkScriptGen(cc.wallet),