diff --git a/priv_key.go b/priv_key.go index ac4760c7c..60a82636d 100644 --- a/priv_key.go +++ b/priv_key.go @@ -53,6 +53,10 @@ func (p *PrivKeyS) UnmarshalJSON(data []byte) (err error) { return } +func (p PrivKeyS) Empty() bool { + return p.PrivKey == nil +} + func PrivKeyFromBytes(privKeyBytes []byte) (privKey PrivKey, err error) { err = wire.ReadBinaryBytes(privKeyBytes, &privKey) return diff --git a/pub_key.go b/pub_key.go index 0c7f4663e..e5fe5209a 100644 --- a/pub_key.go +++ b/pub_key.go @@ -55,6 +55,10 @@ func (p *PubKeyS) UnmarshalJSON(data []byte) (err error) { return } +func (p PubKeyS) Empty() bool { + return p.PubKey == nil +} + func PubKeyFromBytes(pubKeyBytes []byte) (pubKey PubKey, err error) { err = wire.ReadBinaryBytes(pubKeyBytes, &pubKey) return diff --git a/signature.go b/signature.go index fcef20a43..376a535d6 100644 --- a/signature.go +++ b/signature.go @@ -51,6 +51,10 @@ func (p *SignatureS) UnmarshalJSON(data []byte) (err error) { return } +func (p SignatureS) Empty() bool { + return p.Signature == nil +} + func SignatureFromBytes(sigBytes []byte) (sig Signature, err error) { err = wire.ReadBinaryBytes(sigBytes, &sig) return