watchtower/wtpolicy: add IsAnchorChannel helper

This commit is contained in:
Conner Fromknecht
2020-11-25 15:04:23 -08:00
parent dd325f04d2
commit 74416c63f8
2 changed files with 24 additions and 0 deletions

View File

@@ -120,6 +120,11 @@ func (p Policy) String() string {
p.SweepFeeRate)
}
// IsAnchorChannel returns true if the session policy requires anchor channels.
func (p Policy) IsAnchorChannel() bool {
return p.TxPolicy.BlobType.IsAnchorChannel()
}
// Validate ensures that the policy satisfies some minimal correctness
// constraints.
func (p Policy) Validate() error {