Browse Source

lntypes: add preimage Matches method

master
Joost Jager 5 years ago
parent
commit
10a655b6b1
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
  1. 5
      lntypes/preimage.go

5
lntypes/preimage.go

@ -53,3 +53,8 @@ func MakePreimageFromStr(newPreimage string) (Preimage, error) {
func (p *Preimage) Hash() Hash {
return Hash(sha256.Sum256(p[:]))
}
// Matches returns whether this preimage is the preimage of the given hash.
func (p *Preimage) Matches(h Hash) bool {
return h == p.Hash()
}

Loading…
Cancel
Save