1 // Copyright (c) 2014-2015 The btcsuite developers
2 // Use of this source code is governed by an ISC
3 // license that can be found in the LICENSE file.
12 // MsgFilterClear implements the Message interface and represents a bitcoin
13 // filterclear message which is used to reset a Bloom filter.
15 // This message was not added until protocol version BIP0037Version and has
17 type MsgFilterClear struct{}
19 // BtcDecode decodes r using the bitcoin protocol encoding into the receiver.
20 // This is part of the Message interface implementation.
21 func (msg *MsgFilterClear) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) error {
22 if pver < BIP0037Version {
23 str := fmt.Sprintf("filterclear message invalid for protocol "+
25 return messageError("MsgFilterClear.BtcDecode", str)
31 // BtcEncode encodes the receiver to w using the bitcoin protocol encoding.
32 // This is part of the Message interface implementation.
33 func (msg *MsgFilterClear) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) error {
34 if pver < BIP0037Version {
35 str := fmt.Sprintf("filterclear message invalid for protocol "+
37 return messageError("MsgFilterClear.BtcEncode", str)
43 // Command returns the protocol command string for the message. This is part
44 // of the Message interface implementation.
45 func (msg *MsgFilterClear) Command() string {
49 // MaxPayloadLength returns the maximum length the payload can be for the
50 // receiver. This is part of the Message interface implementation.
51 func (msg *MsgFilterClear) MaxPayloadLength(pver uint32) uint32 {
55 // NewMsgFilterClear returns a new bitcoin filterclear message that conforms to the Message
56 // interface. See MsgFilterClear for details.
57 func NewMsgFilterClear() *MsgFilterClear {
58 return &MsgFilterClear{}