Intro

NetMsgType

  • https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/protocol.cpp#L47-L74
Data Msg

screen shot 2017-11-05 at 4 00 56 pm

Control Msg

screen shot 2017-11-05 at 4 04 41 pm

Message Process

  • https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/net_processing.cpp#L1175

headers-first sync

  • https://bitcoin.org/en/glossary/headers-first-sync
  • https://bitcoin.org/en/developer-reference#headers
  • https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers
  • https://en.bitcoin.it/wiki/Protocol_documentation#headers
  • strCommand == NetMsgType::HEADERS https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/net_processing.cpp#L2238
  • https://bitcoin.org/en/developer-reference#block
  • https://en.bitcoin.it/wiki/Protocol_documentation#block
  • strCommand == NetMsgType::BLOCK https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/net_processing.cpp#L2387

References

  • https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/net_processing.cpp#L2883,L2906
  • https://github.com/bitcoin/bitcoin/pull/4468/files
  • https://bitcoin.org/en/developer-reference#p2p-network
  • https://en.bitcoin.it/wiki/Protocol_documentation#Message_types
    • CN (https://zh-cn.bitcoin.it/wiki/%E5%8D%8F%E8%AE%AE%E8%AF%B4%E6%98%8E)