| 2057 | } |
| 2058 | |
| 2059 | void PushGetBlocks(CNode *pNode, CBlockIndex *pIndexBegin, uint256 hashEnd) { |
| 2060 | // Ask this guy to fill in what we're missing |
| 2061 | AssertLockHeld(cs_main); |
| 2062 | // Filter out duplicate requests |
| 2063 | if (pIndexBegin == pNode->pIndexLastGetBlocksBegin && hashEnd == pNode->hashLastGetBlocksEnd) { |
| 2064 | LogPrint(BCLog::NET, "filter the same GetLocator from peer %s\n", pNode->addr.ToString()); |
| 2065 | return; |
| 2066 | } |
| 2067 | pNode->pIndexLastGetBlocksBegin = pIndexBegin; |
| 2068 | pNode->hashLastGetBlocksEnd = hashEnd; |
| 2069 | CBlockLocator blockLocator = chainActive.GetLocator(pIndexBegin); |
| 2070 | pNode->PushMessage(NetMsgType::GETBLOCKS, blockLocator, hashEnd); |
| 2071 | LogPrint(BCLog::NET, "getblocks from peer %s, hashEnd:%s\n", pNode->addr.ToString(), hashEnd.GetHex()); |
| 2072 | } |
| 2073 | |
| 2074 | void PushGetBlocksOnCondition(CNode *pNode, CBlockIndex *pIndexBegin, uint256 hashEnd) { |
| 2075 | // Ask this guy to fill in what we're missing |
no test coverage detected