diff --git a/peer/log.go b/peer/log.go index 8c988588fa..8a48f4bd48 100644 --- a/peer/log.go +++ b/peer/log.go @@ -81,6 +81,8 @@ func invSummary(invList []*wire.InvVect) string { return fmt.Sprintf("block %s", iv.Hash) case wire.InvTypeTx: return fmt.Sprintf("tx %s", iv.Hash) + case wire.InvTypeFilteredBlock: + return fmt.Sprintf("filtered block %s", iv.Hash) } return fmt.Sprintf("unknown (%d) %s", uint32(iv.Type), iv.Hash) @@ -198,7 +200,6 @@ func messageSummary(msg wire.Message) string { return fmt.Sprintf("blockHashes %d, voteHashes %d, tspendHashes %d", len(msg.BlockHashes), len(msg.VoteHashes), len(msg.TSpendHashes)) - } // No summary for other messages. diff --git a/peer/peer.go b/peer/peer.go index 915b3b007e..49b207904c 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -325,7 +325,7 @@ func newNetAddress(addr net.Addr, services wire.ServiceFlag) (*wire.NetAddress, // outMsg is used to house a message to be sent along with a channel to signal // when the message has been sent (or won't be sent due to things such as -// shutdown) +// shutdown). type outMsg struct { msg wire.Message doneChan chan<- struct{} diff --git a/peer/peer_test.go b/peer/peer_test.go index 7d5ac7c972..f0233981f4 100644 --- a/peer/peer_test.go +++ b/peer/peer_test.go @@ -66,7 +66,7 @@ func (c conn) SetDeadline(t time.Time) error { return nil } func (c conn) SetReadDeadline(t time.Time) error { return nil } func (c conn) SetWriteDeadline(t time.Time) error { return nil } -// addr mocks a network address +// addr mocks a network address. type addr struct { net, address string } @@ -106,7 +106,7 @@ type peerStats struct { wantBytesReceived uint64 } -// testPeer tests the given peer's flags and stats +// testPeer tests the given peer's flags and stats. func testPeer(t *testing.T, p *Peer, s peerStats) { if p.UserAgent() != s.wantUserAgent { t.Errorf("testPeer: wrong UserAgent - got %v, want %v", p.UserAgent(), s.wantUserAgent) @@ -536,7 +536,8 @@ func TestPeerListeners(t *testing.T) { { "OnCFTypes", wire.NewMsgCFTypes([]wire.FilterType{ - wire.GCSFilterRegular, wire.GCSFilterExtended}), + wire.GCSFilterRegular, wire.GCSFilterExtended, + }), }, { "OnFeeFilter", @@ -643,7 +644,7 @@ func TestOutboundPeer(t *testing.T) { p.Disconnect() // Test NewestBlock - var newestBlock = func() (*chainhash.Hash, int64, error) { + newestBlock := func() (*chainhash.Hash, int64, error) { hashStr := "14a0810ac680a3eb3f82edc878cea25ec41d6b790744e5daeef" hash, err := chainhash.NewHashFromStr(hashStr) if err != nil {