Convert MsgMemPool errors to MessageError type.
This commit is contained in:
parent
bd1dcf8a0c
commit
f6cdbd430e
1 changed files with 6 additions and 4 deletions
|
@ -21,8 +21,9 @@ type MsgMemPool struct{}
|
||||||
// This is part of the Message interface implementation.
|
// This is part of the Message interface implementation.
|
||||||
func (msg *MsgMemPool) BtcDecode(r io.Reader, pver uint32) error {
|
func (msg *MsgMemPool) BtcDecode(r io.Reader, pver uint32) error {
|
||||||
if pver < BIP0035Version {
|
if pver < BIP0035Version {
|
||||||
err := fmt.Errorf("mempool message invalid for protocol version: %d", pver)
|
str := fmt.Sprintf("mempool message invalid for protocol "+
|
||||||
return err
|
"version %d", pver)
|
||||||
|
return messageError("MsgMemPool.BtcDecode", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -32,8 +33,9 @@ func (msg *MsgMemPool) BtcDecode(r io.Reader, pver uint32) error {
|
||||||
// This is part of the Message interface implementation.
|
// This is part of the Message interface implementation.
|
||||||
func (msg *MsgMemPool) BtcEncode(w io.Writer, pver uint32) error {
|
func (msg *MsgMemPool) BtcEncode(w io.Writer, pver uint32) error {
|
||||||
if pver < BIP0035Version {
|
if pver < BIP0035Version {
|
||||||
err := fmt.Errorf("mempool message invalid for protocol version: %d", pver)
|
str := fmt.Sprintf("mempool message invalid for protocol "+
|
||||||
return err
|
"version %d", pver)
|
||||||
|
return messageError("MsgMemPool.BtcEncode", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue