Merge pull request #1315 from halseth/msgcfilter-string

peer log: add MsgCFHeaders and MsgGetCFHeaders message summary
This commit is contained in:
Olaoluwa Osuntokun 2018-10-12 17:43:50 -07:00 committed by GitHub
commit 1c5c32a5e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,6 +199,14 @@ func messageSummary(msg wire.Message) string {
case *wire.MsgHeaders: case *wire.MsgHeaders:
return fmt.Sprintf("num %d", len(msg.Headers)) return fmt.Sprintf("num %d", len(msg.Headers))
case *wire.MsgGetCFHeaders:
return fmt.Sprintf("start_height=%d, stop_hash=%v",
msg.StartHeight, msg.StopHash)
case *wire.MsgCFHeaders:
return fmt.Sprintf("stop_hash=%v, num_filter_hashes=%d",
msg.StopHash, len(msg.FilterHashes))
case *wire.MsgReject: case *wire.MsgReject:
// Ensure the variable length strings don't contain any // Ensure the variable length strings don't contain any
// characters which are even remotely dangerous such as HTML // characters which are even remotely dangerous such as HTML