比特币情景分析 - 区块同步协议

INV消息
The inv message (inventory message) transmits one or more inventories of objects known to the transmitting peer. It can be sent unsolicited to announce new transactions or blocks, or it can be sent in reply to a getblocks message or mempool message.

The receiving peer can compare the inventories from an inv message against the inventories it has already seen, and then use a follow-up message to request unseen objects.

Bytes | Name | Data Type | Description

  • | :-: | -:
    Varies | count| compactSize uint |The number of inventory entries.
    Varies| inventory | inventory|One or more inventory entries up to a maximum of 50,000 entries.

The following annotated hexdump shows an inv message with two inventory entries. (The message header has been omitted.)

02 ................................. Count: 2

01000000 ........................... Type: MSG_TX
de55ffd709ac1f5dc509a0925d0b1fc4
42ca034f224732e429081da1b621f55a ... Hash (TXID)

01000000 ........................... Type: MSG_TX
91d36d997037e08018262978766f24b8
a055aaf1d872e94ae85e9817b2c68dc7 ... Hash (TXID)

两种情况获取到区块
1.被动
收到peer发来的inv消息 -> 发送getheaders消息 -> 收到peer发来的headers消息 -> 发送getdata消息 -> 收到peer发来的block消息

搞清楚节点什么情况下主动发送inv消息

2.主动
local节点发送getheaders,peer节点接收到getheaders消息后进行逻辑处理后返回headers消息,local节点收到header消息后会发生getdata消息,peer节点接收到getdata消息后会返回block消息,local节点收到block消息后进行区块处理。

可根据log查看这个过程:

..........

2018-09-07T03:03:54Z dnsseed thread exit
2018-09-07T03:03:54Z socket closed
2018-09-07T03:03:54Z disconnecting peer=3
2018-09-07T03:03:54Z Cleared nodestate for peer=3
2018-09-07T03:03:55Z received: inv (73 bytes) peer=2
2018-09-07T03:03:55Z got inv: tx ad5ed4c0c91c1483d4a54b4865463f840aeb0e3ad7ed70d8c982c8b231794cf4  new peer=2
2018-09-07T03:03:55Z got inv: tx 4a2ff8c8b639429109217a734c735ec931ccca921becf90125ea0ecee3d07de2  new peer=2
2018-09-07T03:03:55Z received: headers (162003 bytes) peer=1
2018-09-07T03:03:55Z more getheaders (2000) to end to peer=1 (startheight:540287)
2018-09-07T03:03:55Z sending getheaders (741 bytes) peer=1
2018-09-07T03:03:55Z Protecting outbound peer=1 from eviction
2018-09-07T03:03:55Z Requesting block 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 (1) peer=1
2018-09-07T03:03:55Z Requesting block 000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd (2) peer=1
2018-09-07T03:03:55Z Requesting block 0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449 (3) peer=1
2018-09-07T03:03:55Z Requesting block 000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485 (4) peer=1
2018-09-07T03:03:55Z Requesting block 000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc (5) peer=1
2018-09-07T03:03:55Z Requesting block 000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d (6) peer=1
2018-09-07T03:03:55Z Requesting block 0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444 (7) peer=1
2018-09-07T03:03:55Z Requesting block 00000000408c48f847aa786c2268fc3e6ec2af68e8468a34a28c61b7f1de0dc6 (8) peer=1
2018-09-07T03:03:55Z Requesting block 000000008d9dc510f23c2657fc4f67bea30078cc05a90eb89e84cc475c080805 (9) peer=1
2018-09-07T03:03:55Z Requesting block 000000002c05cc2e78923c34df87fd108b22221ac6076c18f3ade378a4d915e9 (10) peer=1
2018-09-07T03:03:55Z Requesting block 0000000097be56d606cdd9c54b04d4747e957d3608abe69198c661f2add73073 (11) peer=1
2018-09-07T03:03:55Z Requesting block 0000000027c2488e2510d1acf4369787784fa20ee084c258b58d9fbd43802b5e (12) peer=1
2018-09-07T03:03:55Z Requesting block 000000005c51de2031a895adc145ee2242e919a01c6d61fb222a54a54b4d3089 (13) peer=1
2018-09-07T03:03:55Z Requesting block 0000000080f17a0c5a67f663a9bc9969eb37e81666d9321125f0e293656f8a37 (14) peer=1
2018-09-07T03:03:55Z Requesting block 00000000b3322c8c3ef7d2cf6da009a776e6a99ee65ec5a32f3f345712238473 (15) peer=1
2018-09-07T03:03:55Z Requesting block 00000000174a25bb399b009cc8deff1c4b3ea84df7e93affaaf60dc3416cc4f5 (16) peer=1
2018-09-07T03:03:55Z sending getdata (577 bytes) peer=1
2018-09-07T03:03:55Z received: inv (217 bytes) peer=1
2018-09-07T03:03:55Z got inv: tx e38e0d65525d99edcaf922a219f3737fac4a8bc86edf5160a3caa4114fddcbad  new peer=1
2018-09-07T03:03:55Z got inv: tx c096ae719c8c60eed3b8593c82319971e4b2f36a31c718522d4b0b303d01246f  new peer=1
2018-09-07T03:03:55Z got inv: tx 2c12572233c47fe8aeeb87e10f882b479d23cfd9f301edb7c857fdbe149be383  new peer=1
2018-09-07T03:03:55Z got inv: tx 4c4ea50a54083243764a5583e307d2909b3097f45789d190f42aebfcc37b7086  new peer=1
2018-09-07T03:03:55Z got inv: tx 86cb2f7d603103c442d57cc182c4c344fa53157e279ef2bd86f48a22b148eb9b  new peer=1
2018-09-07T03:03:55Z got inv: tx e0796cbf67ac0c27e9335490f337d112aa016c5d9e2a055b265c49502f31df82  new peer=1
2018-09-07T03:03:57Z received: headers (162003 bytes) peer=1
2018-09-07T03:03:57Z more getheaders (4000) to end to peer=1 (startheight:540287)
2018-09-07T03:03:57Z sending getheaders (773 bytes) peer=1
2018-09-07T03:03:57Z received: block (215 bytes) peer=1
2018-09-07T03:03:57Z received block 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 peer=1
2018-09-07T03:03:57Z ProcessNewBlock(), pblock=CBlock(hash=00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048, ver=0x00000001, hashPrevBlock=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, hashMerkleRoot=0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098, nTime=1231469665, nBits=1d00ffff, nNonce=2573394689, vtx=1)
  CTransaction(hash=0e3e2357e8, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 04ffff001d0104)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=410496b538e853519c726a2c91e61e)

, fForceProcessing=true
2018-09-07T03:03:57Z AcceptBlock(), fAlreadyHave=false
2018-09-07T03:03:57Z AcceptBlock(), blockPos.IsNull()=false
2018-09-07T03:03:57Z ActivateBestChain()
2018-09-07T03:03:57Z ConnectBlock(), hashAssumeValid.IsNull()=false
2018-09-07T03:03:57Z ConnectBlock(), fScriptChecks=true
2018-09-07T03:03:57Z ConnectBlock(), block.vtx.size()=1
2018-09-07T03:03:57Z ConnectBlock(),  blockundo.vtxundo.size()=0
2018-09-07T03:03:57Z Pre-allocating up to position 0x100000 in rev00000.dat
2018-09-07T03:03:57Z UpdateTip: new best=00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 height=1 version=0x00000001 log2_work=33.000022 tx=2 date='2009-01-09T02:54:25Z' progress=0.000000 cache=0.0MiB(1txo)
2018-09-07T03:03:57Z ActivateBestChain(), pindexFork != pindexNewTipRequesting block 000000003ff1d0d70147acfbef5d6a87460ff5bcfce807c2d5b6f0a66bfdf809 (17) peer=1

...............

3.peer节点挖出新区块后广播区块,local节点收到该区块。
下面的log是local节点启动后从peer节点同步区块时的debug.log消息记录,注意,这里所有的区块都只包含一笔创币交易。

2018-09-07T07:39:27Z 




2018-09-07T07:39:27Z Bitcoin Core version v0.17.99.0-0786c5d93 (release build)
2018-09-07T07:39:27Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-09-07T07:39:27Z Assuming ancestors of block 0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8 have valid signatures.
2018-09-07T07:39:27Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2018-09-07T07:39:27Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
2018-09-07T07:39:27Z Using RdRand as an additional entropy source
2018-09-07T07:39:27Z Default data directory /home/y/.bitcoin
2018-09-07T07:39:27Z Using data directory /home/y/.bitcoin
2018-09-07T07:39:27Z Using config file /home/y/.bitcoin/bitcoin.conf
2018-09-07T07:39:27Z Using at most 125 automatic connections (1024 file descriptors available)
2018-09-07T07:39:27Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-09-07T07:39:27Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-09-07T07:39:27Z Using 2 threads for script verification
2018-09-07T07:39:27Z scheduler thread start
2018-09-07T07:39:27Z HTTP: creating work queue of depth 16
2018-09-07T07:39:27Z No rpcpassword set - using random cookie authentication.
2018-09-07T07:39:27Z Generated RPC authentication cookie /home/y/.bitcoin/.cookie
2018-09-07T07:39:27Z HTTP: starting 4 worker threads
2018-09-07T07:39:27Z Using wallet directory /home/y/.bitcoin/wallets
2018-09-07T07:39:27Z init message: Verifying wallet(s)...
2018-09-07T07:39:27Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-09-07T07:39:27Z Using wallet wallet.dat
2018-09-07T07:39:27Z BerkeleyEnvironment::Open: LogDir=/home/y/.bitcoin/wallets/database ErrorFile=/home/y/.bitcoin/wallets/db.log
2018-09-07T07:39:27Z net: setting try another outbound peer=false
2018-09-07T07:39:27Z Cache configuration:
2018-09-07T07:39:27Z * Using 2.0MiB for block index database
2018-09-07T07:39:27Z * Using 8.0MiB for chain state database
2018-09-07T07:39:27Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-09-07T07:39:27Z init message: Loading block index...
2018-09-07T07:39:27Z Opening LevelDB in /home/y/.bitcoin/blocks/index
2018-09-07T07:39:27Z Opened LevelDB successfully
2018-09-07T07:39:27Z Using obfuscation key for /home/y/.bitcoin/blocks/index: 0000000000000000
2018-09-07T07:39:27Z LoadBlockIndexDB: last block file = 0
2018-09-07T07:39:27Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2018-09-07T07:39:27Z Checking all blk files are present...
2018-09-07T07:39:27Z Initializing databases...
2018-09-07T07:39:27Z Pre-allocating up to position 0x1000000 in blk00000.dat
2018-09-07T07:39:27Z Opening LevelDB in /home/y/.bitcoin/chainstate
2018-09-07T07:39:27Z Opened LevelDB successfully
2018-09-07T07:39:27Z Wrote new obfuscate key for /home/y/.bitcoin/chainstate: a8ad4a2a90bfe28f
2018-09-07T07:39:27Z Using obfuscation key for /home/y/.bitcoin/chainstate: a8ad4a2a90bfe28f
2018-09-07T07:39:27Z init message: Rewinding blocks...
2018-09-07T07:39:27Z  block index              62ms
2018-09-07T07:39:27Z init message: Loading wallet...
2018-09-07T07:39:27Z [default wallet] nFileVersion = 179900
2018-09-07T07:39:27Z [default wallet] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2018-09-07T07:39:27Z [default wallet] Performing wallet upgrade to 169900
2018-09-07T07:39:28Z [default wallet] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2018-09-07T07:39:28Z [default wallet] Wallet completed loading in            1182ms
2018-09-07T07:39:28Z [default wallet] setKeyPool.size() = 2000
2018-09-07T07:39:28Z [default wallet] mapWallet.size() = 0
2018-09-07T07:39:28Z [default wallet] mapAddressBook.size() = 0
2018-09-07T07:39:28Z UpdateTip: new best=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f height=0 version=0x00000001 log2_work=32.000022 tx=1 date='2009-01-03T18:15:05Z' progress=0.000000 cache=0.0MiB(0txo)
2018-09-07T07:39:28Z Failed to open mempool file from disk. Continuing anyway.
2018-09-07T07:39:28Z mapBlockIndex.size() = 1
2018-09-07T07:39:28Z nBestHeight = 0
2018-09-07T07:39:28Z torcontrol thread start
2018-09-07T07:39:28Z Bound to [::]:8333
2018-09-07T07:39:28Z Bound to 0.0.0.0:8333
2018-09-07T07:39:28Z init message: Loading P2P addresses...
2018-09-07T07:39:28Z ERROR: DeserializeFileDB: Failed to open file /home/y/.bitcoin/peers.dat
2018-09-07T07:39:28Z Invalid or missing peers.dat; recreating
2018-09-07T07:39:28Z Flushed 0 addresses to peers.dat  1ms
2018-09-07T07:39:28Z init message: Loading banlist...
2018-09-07T07:39:28Z ERROR: DeserializeFileDB: Failed to open file /home/y/.bitcoin/banlist.dat
2018-09-07T07:39:28Z Invalid or missing banlist.dat; recreating
2018-09-07T07:39:28Z Flushed 0 banned node ips/subnets to banlist.dat  11ms
2018-09-07T07:39:28Z init message: Starting network threads...
2018-09-07T07:39:28Z DNS seeding disabled
2018-09-07T07:39:28Z net thread start
2018-09-07T07:39:28Z addcon thread start
2018-09-07T07:39:28Z init message: Done loading
2018-09-07T07:39:28Z trying connection 192.168.51.176 lastseen=0.0hrs
2018-09-07T07:39:28Z msghand thread start
2018-09-07T07:39:28Z opencon thread start
2018-09-07T07:39:28Z Added connection peer=0
2018-09-07T07:39:28Z sending version (103 bytes) peer=0
2018-09-07T07:39:28Z send version message: version 70015, blocks=0, us=[::]:0, peer=0
2018-09-07T07:39:28Z received: version (103 bytes) peer=0
2018-09-07T07:39:28Z sending verack (0 bytes) peer=0
2018-09-07T07:39:28Z sending getaddr (0 bytes) peer=0
2018-09-07T07:39:28Z receive version message: /Satoshi:0.17.99/: version 70015, blocks=17, us=[::]:0, peer=0
2018-09-07T07:39:28Z added time data, samples 2, offset +0 (+0 minutes)
2018-09-07T07:39:28Z received: verack (0 bytes) peer=0
2018-09-07T07:39:28Z New outbound peer connected: version: 70015, blocks=17, peer=0
2018-09-07T07:39:28Z sending sendheaders (0 bytes) peer=0
2018-09-07T07:39:28Z sending sendcmpct (9 bytes) peer=0
2018-09-07T07:39:28Z sending sendcmpct (9 bytes) peer=0
2018-09-07T07:39:28Z sending ping (8 bytes) peer=0
2018-09-07T07:39:28Z initial getheaders (0) to peer=0 (startheight:17)
2018-09-07T07:39:28Z sending getheaders (69 bytes) peer=0
2018-09-07T07:39:28Z sending feefilter (8 bytes) peer=0
2018-09-07T07:39:28Z received: sendheaders (0 bytes) peer=0
2018-09-07T07:39:28Z received: sendcmpct (9 bytes) peer=0
2018-09-07T07:39:28Z received: sendcmpct (9 bytes) peer=0
2018-09-07T07:39:28Z received: ping (8 bytes) peer=0
2018-09-07T07:39:28Z sending pong (8 bytes) peer=0
2018-09-07T07:39:28Z received: getheaders (485 bytes) peer=0
2018-09-07T07:39:28Z Ignoring getheaders from peer=0 because node is in initial block download
2018-09-07T07:39:28Z received: feefilter (8 bytes) peer=0
2018-09-07T07:39:28Z received: feefilter of 0.00001000 BTC/kB from peer=0
2018-09-07T07:39:28Z received: pong (8 bytes) peer=0
2018-09-07T07:39:28Z received: headers (1378 bytes) peer=0
2018-09-07T07:39:28Z Requesting block 000000005c131ac012847c6468ffbb49286785ab4c3723fe3e16bcedabe465fe (1) peer=0
2018-09-07T07:39:28Z Requesting block 000000004aed11654a812fb2363d4507326860b630e5e7cdbb0fda6ff6c085e6 (2) peer=0
2018-09-07T07:39:28Z Requesting block 000000002d0e73d35a1c1bd116d5cbc2d2861012cb8d3681fb572fedcf3bd5f9 (3) peer=0
2018-09-07T07:39:28Z Requesting block 0000000082157040ceb3ca4cfb9fa928da799de67a9c27cab25d2619382d3fd6 (4) peer=0
2018-09-07T07:39:28Z Requesting block 000000008b55f545f93531c53a0cc1643cffd3b202488fde8b2307e1098888a8 (5) peer=0
2018-09-07T07:39:28Z Requesting block 0000000063e5429ebe62c7cc7284834eb358b3dd1b09af0e8d468ca3093bf27e (6) peer=0
2018-09-07T07:39:28Z Requesting block 000000005b8f1756fa5cf9447096b633d6638305b7793b738cc206e698a87cbb (7) peer=0
2018-09-07T07:39:28Z Requesting block 0000000045f70e70423be482c7793d93c36400511139393513a804d6a9a76806 (8) peer=0
2018-09-07T07:39:28Z Requesting block 0000000002cf9201186e6ef01bb6a4ceb69cb4caf641f3e2e20f03a439b95c03 (9) peer=0
2018-09-07T07:39:28Z Requesting block 00000000e882e2c41651ae4eb14e345b8608e938007efb9ec8385bfccb1ee6f4 (10) peer=0
2018-09-07T07:39:28Z Requesting block 00000000eb97338dc30aa8320b667617954638901b05739e4ffc7ad3833a9f89 (11) peer=0
2018-09-07T07:39:28Z Requesting block 00000000671eb0b5d7b5ba448a9681dd48e603eeda9a8e6876de28a68d0a25d6 (12) peer=0
2018-09-07T07:39:28Z Requesting block 0000000074d54f0baf51cc11bb4ab1ec7f88df8a9c21e7f4ba88a1aa170b45ad (13) peer=0
2018-09-07T07:39:28Z Requesting block 000000001464cbd27983f403af4a506d93364ce8e6d07c2ff8b94adf90ffb9b6 (14) peer=0
2018-09-07T07:39:28Z Requesting block 00000000fc326ac2fa2784d9c5a39121f31a9fa29c5c84b9b9d27e526de8101f (15) peer=0
2018-09-07T07:39:28Z Requesting block 00000000cd164ead893dfb18b8485e67499f9aed1326ab40e5b2db82b3e2486a (16) peer=0
2018-09-07T07:39:28Z sending getdata (577 bytes) peer=0
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000005c131ac012847c6468ffbb49286785ab4c3723fe3e16bcedabe465fe peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000005c131ac012847c6468ffbb49286785ab4c3723fe3e16bcedabe465fe, ver=0x20000000, hashPrevBlock=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, hashMerkleRoot=6f2926ca39177fd1e17714e23011e332617995137fcd40d0d1583afff048ad59, nTime=1536214807, nBits=1d00ffff, nNonce=481834768, vtx=1)
  CTransaction(hash=6f2926ca39, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 510101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21037db3acbf7a34e89033556b26d1)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z Pre-allocating up to position 0x100000 in rev00000.dat
2018-09-07T07:39:28Z UpdateTip: new best=000000005c131ac012847c6468ffbb49286785ab4c3723fe3e16bcedabe465fe height=1 version=0x20000000 log2_work=33.000022 tx=2 date='2018-09-06T06:20:07Z' progress=0.000000 cache=0.0MiB(1txo)
2018-09-07T07:39:28Z Requesting block 000000007219a2294bd2b1eab557c33a422397c656a266ceafc1dcd9961173d8 (17) peer=0
2018-09-07T07:39:28Z sending getdata (37 bytes) peer=0
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000004aed11654a812fb2363d4507326860b630e5e7cdbb0fda6ff6c085e6 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000004aed11654a812fb2363d4507326860b630e5e7cdbb0fda6ff6c085e6, ver=0x20000000, hashPrevBlock=000000005c131ac012847c6468ffbb49286785ab4c3723fe3e16bcedabe465fe, hashMerkleRoot=a52c1c94b17b9f79b3e98585e81665acf5f52558634b85e622c9178477db3f3d, nTime=1536214856, nBits=1d00ffff, nNonce=99131039, vtx=1)
  CTransaction(hash=a52c1c94b1, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 520101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21037db3acbf7a34e89033556b26d1)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=000000004aed11654a812fb2363d4507326860b630e5e7cdbb0fda6ff6c085e6 height=2 version=0x20000000 log2_work=33.584985 tx=3 date='2018-09-06T06:20:56Z' progress=0.000000 cache=0.0MiB(2txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000002d0e73d35a1c1bd116d5cbc2d2861012cb8d3681fb572fedcf3bd5f9 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000002d0e73d35a1c1bd116d5cbc2d2861012cb8d3681fb572fedcf3bd5f9, ver=0x20000000, hashPrevBlock=000000004aed11654a812fb2363d4507326860b630e5e7cdbb0fda6ff6c085e6, hashMerkleRoot=6cbd11adc9cb6f8e53ccce1e80c22b390d6ee62a8153872b6bf39cf26da19109, nTime=1536215617, nBits=1d00ffff, nNonce=1531356824, vtx=1)
  CTransaction(hash=6cbd11adc9, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 530101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21037db3acbf7a34e89033556b26d1)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=000000002d0e73d35a1c1bd116d5cbc2d2861012cb8d3681fb572fedcf3bd5f9 height=3 version=0x20000000 log2_work=34.000022 tx=4 date='2018-09-06T06:33:37Z' progress=0.000000 cache=0.0MiB(3txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 0000000082157040ceb3ca4cfb9fa928da799de67a9c27cab25d2619382d3fd6 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=0000000082157040ceb3ca4cfb9fa928da799de67a9c27cab25d2619382d3fd6, ver=0x20000000, hashPrevBlock=000000002d0e73d35a1c1bd116d5cbc2d2861012cb8d3681fb572fedcf3bd5f9, hashMerkleRoot=9a3da06d929af26f9bb11efa5d1b139130634bcb5c9ccd9e8a22bbbfa2703051, nTime=1536220927, nBits=1d00ffff, nNonce=1389270674, vtx=1)
  CTransaction(hash=9a3da06d92, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 540103)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21037db3acbf7a34e89033556b26d1)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z Leaving InitialBlockDownload (latching to false)
2018-09-07T07:39:28Z UpdateTip: new best=0000000082157040ceb3ca4cfb9fa928da799de67a9c27cab25d2619382d3fd6 height=4 version=0x20000000 log2_work=34.32195 tx=5 date='2018-09-06T08:02:07Z' progress=0.000000 cache=0.0MiB(4txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000008b55f545f93531c53a0cc1643cffd3b202488fde8b2307e1098888a8 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000008b55f545f93531c53a0cc1643cffd3b202488fde8b2307e1098888a8, ver=0x20000000, hashPrevBlock=0000000082157040ceb3ca4cfb9fa928da799de67a9c27cab25d2619382d3fd6, hashMerkleRoot=f4b6273f0dd673476c789babaf540332914d7854c68da68843bf4954dcf98801, nTime=1536225995, nBits=1d00ffff, nNonce=3318071809, vtx=1)
  CTransaction(hash=f4b6273f0d, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 550101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=2103341163db163432b49357d4422f)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=000000008b55f545f93531c53a0cc1643cffd3b202488fde8b2307e1098888a8 height=5 version=0x20000000 log2_work=34.584985 tx=6 date='2018-09-06T09:26:35Z' progress=0.000000 cache=0.0MiB(5txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 0000000063e5429ebe62c7cc7284834eb358b3dd1b09af0e8d468ca3093bf27e peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=0000000063e5429ebe62c7cc7284834eb358b3dd1b09af0e8d468ca3093bf27e, ver=0x20000000, hashPrevBlock=000000008b55f545f93531c53a0cc1643cffd3b202488fde8b2307e1098888a8, hashMerkleRoot=811ab4b154cd5181ad013cedf9d3956b2429fa35fe8a049f4a840309737cf6b3, nTime=1536233254, nBits=1d00ffff, nNonce=1187964143, vtx=1)
  CTransaction(hash=811ab4b154, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 560104)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=2103341163db163432b49357d4422f)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=0000000063e5429ebe62c7cc7284834eb358b3dd1b09af0e8d468ca3093bf27e height=6 version=0x20000000 log2_work=34.807377 tx=7 date='2018-09-06T11:27:34Z' progress=0.000000 cache=0.0MiB(6txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000005b8f1756fa5cf9447096b633d6638305b7793b738cc206e698a87cbb peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000005b8f1756fa5cf9447096b633d6638305b7793b738cc206e698a87cbb, ver=0x20000000, hashPrevBlock=0000000063e5429ebe62c7cc7284834eb358b3dd1b09af0e8d468ca3093bf27e, hashMerkleRoot=d766b03b2d7aa63847fadb6ded5288ffff62e9d64d93bec80d28f36f1417cbfb, nTime=1536286052, nBits=1d00ffff, nNonce=1807176385, vtx=1)
  CTransaction(hash=d766b03b2d, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 570101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=000000005b8f1756fa5cf9447096b633d6638305b7793b738cc206e698a87cbb height=7 version=0x20000000 log2_work=35.000022 tx=8 date='2018-09-07T02:07:32Z' progress=0.000000 cache=0.0MiB(7txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 0000000045f70e70423be482c7793d93c36400511139393513a804d6a9a76806 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=0000000045f70e70423be482c7793d93c36400511139393513a804d6a9a76806, ver=0x20000000, hashPrevBlock=000000005b8f1756fa5cf9447096b633d6638305b7793b738cc206e698a87cbb, hashMerkleRoot=ab9b5e7efa2034954ef44dc0e683f35b2625e7b3f8afbe9285cc3162af0dc1a6, nTime=1536287389, nBits=1d00ffff, nNonce=2611614845, vtx=1)
  CTransaction(hash=ab9b5e7efa, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 580101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=0000000045f70e70423be482c7793d93c36400511139393513a804d6a9a76806 height=8 version=0x20000000 log2_work=35.169947 tx=9 date='2018-09-07T02:29:49Z' progress=0.000000 cache=0.0MiB(8txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 0000000002cf9201186e6ef01bb6a4ceb69cb4caf641f3e2e20f03a439b95c03 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=0000000002cf9201186e6ef01bb6a4ceb69cb4caf641f3e2e20f03a439b95c03, ver=0x20000000, hashPrevBlock=0000000045f70e70423be482c7793d93c36400511139393513a804d6a9a76806, hashMerkleRoot=7f78448c8a3c35d5695a73395465f7139e27aa184451f91fe969ef0f93cecec7, nTime=1536289576, nBits=1d00ffff, nNonce=73903890, vtx=1)
  CTransaction(hash=7f78448c8a, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 590102)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=0000000002cf9201186e6ef01bb6a4ceb69cb4caf641f3e2e20f03a439b95c03 height=9 version=0x20000000 log2_work=35.32195 tx=10 date='2018-09-07T03:06:16Z' progress=0.000000 cache=0.0MiB(9txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 00000000e882e2c41651ae4eb14e345b8608e938007efb9ec8385bfccb1ee6f4 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=00000000e882e2c41651ae4eb14e345b8608e938007efb9ec8385bfccb1ee6f4, ver=0x20000000, hashPrevBlock=0000000002cf9201186e6ef01bb6a4ceb69cb4caf641f3e2e20f03a439b95c03, hashMerkleRoot=8ac94263efd24236083594a203ff56ae3ba962573fdf022e90ab682051eb21e7, nTime=1536290294, nBits=1d00ffff, nNonce=1399937789, vtx=1)
  CTransaction(hash=8ac94263ef, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5a0101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=00000000e882e2c41651ae4eb14e345b8608e938007efb9ec8385bfccb1ee6f4 height=10 version=0x20000000 log2_work=35.459454 tx=11 date='2018-09-07T03:18:14Z' progress=0.000000 cache=0.0MiB(10txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 00000000eb97338dc30aa8320b667617954638901b05739e4ffc7ad3833a9f89 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=00000000eb97338dc30aa8320b667617954638901b05739e4ffc7ad3833a9f89, ver=0x20000000, hashPrevBlock=00000000e882e2c41651ae4eb14e345b8608e938007efb9ec8385bfccb1ee6f4, hashMerkleRoot=659677500f61bdf03b458992d7a8004280a2f49341abc3a3acdccdde843bc8d4, nTime=1536293919, nBits=1d00ffff, nNonce=2828047467, vtx=1)
  CTransaction(hash=659677500f, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5b0102)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=00000000eb97338dc30aa8320b667617954638901b05739e4ffc7ad3833a9f89 height=11 version=0x20000000 log2_work=35.584985 tx=12 date='2018-09-07T04:18:39Z' progress=0.000000 cache=0.0MiB(11txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 00000000671eb0b5d7b5ba448a9681dd48e603eeda9a8e6876de28a68d0a25d6 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=00000000671eb0b5d7b5ba448a9681dd48e603eeda9a8e6876de28a68d0a25d6, ver=0x20000000, hashPrevBlock=00000000eb97338dc30aa8320b667617954638901b05739e4ffc7ad3833a9f89, hashMerkleRoot=bba435adca5ebdb53298683fcbc8bdac5955dc7c76a178cb1b4c9a38722d7755, nTime=1536296734, nBits=1d00ffff, nNonce=1217547807, vtx=1)
  CTransaction(hash=bba435adca, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5c0102)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=00000000671eb0b5d7b5ba448a9681dd48e603eeda9a8e6876de28a68d0a25d6 height=12 version=0x20000000 log2_work=35.700462 tx=13 date='2018-09-07T05:05:34Z' progress=0.000000 cache=0.0MiB(12txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 0000000074d54f0baf51cc11bb4ab1ec7f88df8a9c21e7f4ba88a1aa170b45ad peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=0000000074d54f0baf51cc11bb4ab1ec7f88df8a9c21e7f4ba88a1aa170b45ad, ver=0x20000000, hashPrevBlock=00000000671eb0b5d7b5ba448a9681dd48e603eeda9a8e6876de28a68d0a25d6, hashMerkleRoot=b7d1f966efc2e29982a3d7868f26a7f265a563fa91f305795a31b6cdd4717ebf, nTime=1536298998, nBits=1d00ffff, nNonce=138039814, vtx=1)
  CTransaction(hash=b7d1f966ef, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5d0102)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=0000000074d54f0baf51cc11bb4ab1ec7f88df8a9c21e7f4ba88a1aa170b45ad height=13 version=0x20000000 log2_work=35.807377 tx=14 date='2018-09-07T05:43:18Z' progress=0.000000 cache=0.0MiB(13txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 000000001464cbd27983f403af4a506d93364ce8e6d07c2ff8b94adf90ffb9b6 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000001464cbd27983f403af4a506d93364ce8e6d07c2ff8b94adf90ffb9b6, ver=0x20000000, hashPrevBlock=0000000074d54f0baf51cc11bb4ab1ec7f88df8a9c21e7f4ba88a1aa170b45ad, hashMerkleRoot=dae19840c5332776724195e1112ef862a31211e8861693791b14c8ea1ffa6799, nTime=1536300588, nBits=1d00ffff, nNonce=3069415704, vtx=1)
  CTransaction(hash=dae19840c5, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5e0101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=000000001464cbd27983f403af4a506d93364ce8e6d07c2ff8b94adf90ffb9b6 height=14 version=0x20000000 log2_work=35.906913 tx=15 date='2018-09-07T06:09:48Z' progress=0.000000 cache=0.0MiB(14txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 00000000fc326ac2fa2784d9c5a39121f31a9fa29c5c84b9b9d27e526de8101f peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=00000000fc326ac2fa2784d9c5a39121f31a9fa29c5c84b9b9d27e526de8101f, ver=0x20000000, hashPrevBlock=000000001464cbd27983f403af4a506d93364ce8e6d07c2ff8b94adf90ffb9b6, hashMerkleRoot=0bbb309a58677fd98908c36eeeb3f694d9bd976eca310504fb7b6c5debc422c9, nTime=1536302945, nBits=1d00ffff, nNonce=223124502, vtx=1)
  CTransaction(hash=0bbb309a58, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 5f0102)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=00000000fc326ac2fa2784d9c5a39121f31a9fa29c5c84b9b9d27e526de8101f height=15 version=0x20000000 log2_work=36.000022 tx=16 date='2018-09-07T06:49:05Z' progress=0.000000 cache=0.0MiB(15txo)
2018-09-07T07:39:28Z received: block (226 bytes) peer=0
2018-09-07T07:39:28Z received block 00000000cd164ead893dfb18b8485e67499f9aed1326ab40e5b2db82b3e2486a peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=00000000cd164ead893dfb18b8485e67499f9aed1326ab40e5b2db82b3e2486a, ver=0x20000000, hashPrevBlock=00000000fc326ac2fa2784d9c5a39121f31a9fa29c5c84b9b9d27e526de8101f, hashMerkleRoot=d433b2b49906e42d5e8f64c5c0fd6c107f84498d270a3d71f9eea927d6aec5e1, nTime=1536303686, nBits=1d00ffff, nNonce=1426476435, vtx=1)
  CTransaction(hash=d433b2b499, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 600101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z UpdateTip: new best=00000000cd164ead893dfb18b8485e67499f9aed1326ab40e5b2db82b3e2486a height=16 version=0x20000000 log2_work=36.087485 tx=17 date='2018-09-07T07:01:26Z' progress=0.000000 cache=0.0MiB(16txo)
2018-09-07T07:39:28Z received: block (227 bytes) peer=0
2018-09-07T07:39:28Z received block 000000007219a2294bd2b1eab557c33a422397c656a266ceafc1dcd9961173d8 peer=0
2018-09-07T07:39:28Z ProcessNewBlock(), pblock=CBlock(hash=000000007219a2294bd2b1eab557c33a422397c656a266ceafc1dcd9961173d8, ver=0x20000000, hashPrevBlock=00000000cd164ead893dfb18b8485e67499f9aed1326ab40e5b2db82b3e2486a, hashMerkleRoot=1d22e9924c93cf2e0ce23f3e1115994a202961994012e6c6be4de46654c1d3cd, nTime=1536305024, nBits=1d00ffff, nNonce=2607386650, vtx=1)
  CTransaction(hash=1d22e9924c, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 01110101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:39:28Z sending sendcmpct (9 bytes) peer=0
2018-09-07T07:39:28Z UpdateTip: new best=000000007219a2294bd2b1eab557c33a422397c656a266ceafc1dcd9961173d8 height=17 version=0x20000000 log2_work=36.169947 tx=18 date='2018-09-07T07:23:44Z' progress=0.000000 cache=0.0MiB(17txo)
2018-09-07T07:40:29Z Adding fixed seed nodes as DNS doesn't seem to be available.
2018-09-07T07:41:28Z sending ping (8 bytes) peer=0
2018-09-07T07:41:28Z received: pong (8 bytes) peer=0
2018-09-07T07:41:28Z received: ping (8 bytes) peer=0
2018-09-07T07:41:28Z sending pong (8 bytes) peer=0
2018-09-07T07:43:28Z sending ping (8 bytes) peer=0
2018-09-07T07:43:28Z received: pong (8 bytes) peer=0
2018-09-07T07:43:28Z received: ping (8 bytes) peer=0
2018-09-07T07:43:28Z sending pong (8 bytes) peer=0
2018-09-07T07:45:28Z received: ping (8 bytes) peer=0
2018-09-07T07:45:28Z sending pong (8 bytes) peer=0
2018-09-07T07:45:28Z sending ping (8 bytes) peer=0
2018-09-07T07:45:28Z received: pong (8 bytes) peer=0
2018-09-07T07:47:28Z received: ping (8 bytes) peer=0
2018-09-07T07:47:28Z sending pong (8 bytes) peer=0
2018-09-07T07:47:28Z sending ping (8 bytes) peer=0
2018-09-07T07:47:28Z received: pong (8 bytes) peer=0
2018-09-07T07:49:28Z sending ping (8 bytes) peer=0
2018-09-07T07:49:28Z received: pong (8 bytes) peer=0
2018-09-07T07:49:28Z received: ping (8 bytes) peer=0
2018-09-07T07:49:28Z sending pong (8 bytes) peer=0
2018-09-07T07:51:28Z sending ping (8 bytes) peer=0
2018-09-07T07:51:28Z received: pong (8 bytes) peer=0
2018-09-07T07:51:28Z received: ping (8 bytes) peer=0
2018-09-07T07:51:28Z sending pong (8 bytes) peer=0
2018-09-07T07:53:28Z sending ping (8 bytes) peer=0
2018-09-07T07:53:28Z received: pong (8 bytes) peer=0
2018-09-07T07:53:28Z received: ping (8 bytes) peer=0
2018-09-07T07:53:28Z sending pong (8 bytes) peer=0
2018-09-07T07:54:28Z Flushed 0 addresses to peers.dat  4ms
2018-09-07T07:55:28Z sending ping (8 bytes) peer=0
2018-09-07T07:55:28Z received: pong (8 bytes) peer=0
2018-09-07T07:55:28Z received: ping (8 bytes) peer=0
2018-09-07T07:55:28Z sending pong (8 bytes) peer=0
2018-09-07T07:57:29Z sending ping (8 bytes) peer=0
2018-09-07T07:57:29Z received: pong (8 bytes) peer=0
2018-09-07T07:57:29Z received: ping (8 bytes) peer=0
2018-09-07T07:57:29Z sending pong (8 bytes) peer=0
2018-09-07T07:58:48Z received: cmpctblock (237 bytes) peer=0
2018-09-07T07:58:48Z received: blocktxn (33 bytes) peer=0
2018-09-07T07:58:48Z ProcessNewBlock(), pblock=CBlock(hash=000000007962a8f1978f3406fe30848da5554819afc7bf9066c977a9d1f4cc0c, ver=0x20000000, hashPrevBlock=000000007219a2294bd2b1eab557c33a422397c656a266ceafc1dcd9961173d8, hashMerkleRoot=5dcfb41f00f26e8dc24a4a52ebbb9c46946c6ce7949571106c6c9b7772400d66, nTime=1536307128, nBits=1d00ffff, nNonce=3858501923, vtx=1)
  CTransaction(hash=5dcfb41f00, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 01120101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T07:58:48Z UpdateTip: new best=000000007962a8f1978f3406fe30848da5554819afc7bf9066c977a9d1f4cc0c height=18 version=0x20000000 log2_work=36.24795 tx=19 date='2018-09-07T07:58:48Z' progress=0.000000 cache=0.0MiB(18txo)
2018-09-07T07:59:29Z received: ping (8 bytes) peer=0
2018-09-07T07:59:29Z sending pong (8 bytes) peer=0
2018-09-07T07:59:29Z sending ping (8 bytes) peer=0
2018-09-07T07:59:29Z received: pong (8 bytes) peer=0
2018-09-07T08:01:29Z sending ping (8 bytes) peer=0
2018-09-07T08:01:29Z received: pong (8 bytes) peer=0
2018-09-07T08:01:29Z received: ping (8 bytes) peer=0
2018-09-07T08:01:29Z sending pong (8 bytes) peer=0
2018-09-07T08:03:29Z received: ping (8 bytes) peer=0
2018-09-07T08:03:29Z sending pong (8 bytes) peer=0
2018-09-07T08:03:29Z sending ping (8 bytes) peer=0
2018-09-07T08:03:29Z received: pong (8 bytes) peer=0
2018-09-07T08:05:29Z sending ping (8 bytes) peer=0
2018-09-07T08:05:29Z received: pong (8 bytes) peer=0
2018-09-07T08:05:29Z received: ping (8 bytes) peer=0
2018-09-07T08:05:29Z sending pong (8 bytes) peer=0
2018-09-07T08:07:29Z received: ping (8 bytes) peer=0
2018-09-07T08:07:29Z sending pong (8 bytes) peer=0
2018-09-07T08:07:29Z sending ping (8 bytes) peer=0
2018-09-07T08:07:29Z received: pong (8 bytes) peer=0
2018-09-07T08:09:28Z Flushed 0 addresses to peers.dat  3ms
2018-09-07T08:09:29Z received: ping (8 bytes) peer=0
2018-09-07T08:09:29Z sending pong (8 bytes) peer=0
2018-09-07T08:09:29Z sending ping (8 bytes) peer=0
2018-09-07T08:09:29Z received: pong (8 bytes) peer=0
2018-09-07T08:11:29Z sending ping (8 bytes) peer=0
2018-09-07T08:11:29Z received: pong (8 bytes) peer=0
2018-09-07T08:11:29Z received: ping (8 bytes) peer=0
2018-09-07T08:11:29Z sending pong (8 bytes) peer=0
2018-09-07T08:13:29Z sending ping (8 bytes) peer=0
2018-09-07T08:13:29Z received: pong (8 bytes) peer=0
2018-09-07T08:13:29Z received: ping (8 bytes) peer=0
2018-09-07T08:13:29Z sending pong (8 bytes) peer=0
2018-09-07T08:15:29Z received: ping (8 bytes) peer=0
2018-09-07T08:15:29Z sending pong (8 bytes) peer=0
2018-09-07T08:15:29Z sending ping (8 bytes) peer=0
2018-09-07T08:15:29Z received: pong (8 bytes) peer=0
2018-09-07T08:16:33Z received: cmpctblock (237 bytes) peer=0
2018-09-07T08:16:33Z received: blocktxn (33 bytes) peer=0
2018-09-07T08:16:33Z ProcessNewBlock(), pblock=CBlock(hash=00000000ca13c6dc3d788970fb41cc966954292f05c885c09f9aa688358796e9, ver=0x20000000, hashPrevBlock=000000007962a8f1978f3406fe30848da5554819afc7bf9066c977a9d1f4cc0c, hashMerkleRoot=c2cdd1ce76afe9004258c4964f948f7e18f7301b1a74b16de833f9ad2e0e1d25, nTime=1536308193, nBits=1d00ffff, nNonce=1935244833, vtx=1)
  CTransaction(hash=c2cdd1ce76, ver=2, vin.size=1, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 01130101)
    CScriptWitness()
    CTxOut(nValue=50.00000000, scriptPubKey=21027d18c82991f5e8fe704eee3ec9)
    CTxOut(nValue=0.00000000, scriptPubKey=6a24aa21a9ede2f61c3f71d1defd3f)

, fForceProcessing=true
2018-09-07T08:16:33Z UpdateTip: new best=00000000ca13c6dc3d788970fb41cc966954292f05c885c09f9aa688358796e9 height=19 version=0x20000000 log2_work=36.32195 tx=20 date='2018-09-07T08:16:33Z' progress=0.000000 cache=0.0MiB(19txo)
2018-09-07T08:17:29Z sending ping (8 bytes) peer=0
2018-09-07T08:17:29Z received: pong (8 bytes) peer=0
2018-09-07T08:17:29Z received: ping (8 bytes) peer=0
2018-09-07T08:17:29Z sending pong (8 bytes) peer=0

上述log中,最后两个区块(即height=18和height=19)就是peer节点广播过来的区块。
注意,当local节点收到cmpctblock消息(cmpctblock消息包含a header and list of “short txids”,即包含一个区块头和一些短交易id)后,经过一系列逻辑判断如果发现能够从cmpctblock消息中解码出区块的所有交易id,则不需要发送getblocktxn消息去获取该区块里的交易数据,而是会构造一个虚拟的空的blocktxn消息,然后直接调用ProcessMessage()方法处理后续的逻辑:

        if (fProcessBLOCKTXN)
            return ProcessMessage(pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams, connman, interruptMsgProc, enable_bip61);

所以上面会log中看到local节点收到一个cmpctblock消息后,没有发送任何消息,却立马又收到一个blocktxn消息:

2018-09-07T08:16:33Z received: cmpctblock (237 bytes) peer=0
2018-09-07T08:16:33Z received: blocktxn (33 bytes) peer=0

log中显示的收到的blocktxn消息其实是主动调用ProcessMessage()方法输出的log而已,并不是真正的收到一个blocktxn消息。

参考:
比特币源码情景分析之区块同步消息(message)处理

比特币p2p网络以及协议相关的官方文档:
developer-documentation:https://bitcoin.org/en/developer-documentation#p2p-network
P2P Network Guide:https://bitcoin.org/en/developer-guide#p2p-network
P2P Network Reference: https://bitcoin.org/en/developer-reference#p2p-network
P2P Network Examples:https://bitcoin.org/en/developer-examples#p2p-network
Full Protocol Specification - Wiki: https://en.bitcoin.it/wiki/Protocol_documentation

你可能感兴趣的:(区块链)