mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 06:04:20 +01:00
lntypes: add preimage Matches method
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user