code: func (p *Peer) maybeAddDeadline(pendingResponses map[string]time.Time, msgCmd string) {
  	// Setup a deadline for each message being sent that expects a response.
  	//
  	// NOTE: Pings are intentionally ignored here since they are typically
  	// sent asynchronously and as a result of a long backlock of messages,
  	// such as is typical in the case of initial block download, the
  	// response won't be received in time.
  	deadline := time.Now().Add(stallResponseTimeout)
  	switch msgCmd {
  	case wire.CmdVersion:
  		// Expects a verack message.
  		pendingResponses[wire.CmdVerAck] = deadline
  
  	case wire.CmdMemPool:
  		// Expects an inv message.
  		pendingResponses[wire.CmdInv] = deadline
  
  	case wire.CmdGetBlocks:
  		// Expects an inv message.
  		pendingResponses[wire.CmdInv] = deadline
  
  	case wire.CmdGetData:
  		// Expects a block, merkleblock, tx, or notfound message.
  		pendingResponses[wire.CmdBlock] = deadline
  		pendingResponses[wire.CmdMerkleBlock] = deadline
  		pendingResponses[wire.CmdTx] = deadline
  		pendingResponses[wire.CmdNotFound] = deadline
  
  	case wire.CmdGetHeaders:
  		// Expects a headers message.  Use a longer deadline since it
  		// can take a while for the remote peer to load all of the
  		// headers.
  		deadline = time.Now().Add(stallResponseTimeout * 3)
  		pendingResponses[wire.CmdHeaders] = deadline
  	}
  }
docs: // maybeAddDeadline potentially adds a deadline for the appropriate expected
  // response for the passed wire protocol command to the pending responses map.