diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5610de9..1a4c9ea 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
| @@ -1494,6 +1494,11 @@ bool CBlock::AcceptBlock() | |||
| 1494 | 1494 | ||
| 1495 | bool ProcessBlock(CNode* pfrom, CBlock* pblock) | 1495 | bool ProcessBlock(CNode* pfrom, CBlock* pblock) |
| 1496 | { | 1496 | { |
| 1497 | // Counted before any check, so the ratio below is against everything that | ||
| 1498 | // arrived rather than everything that was any good. | ||
| 1499 | if (pfrom) | ||
| 1500 | nBlocksReceived++; | ||
| 1501 | |||
| 1497 | // Check for duplicate | 1502 | // Check for duplicate |
| 1498 | uint256 hash = pblock->GetHash(); | 1503 | uint256 hash = pblock->GetHash(); |
| 1499 | if (mapBlockIndex.count(hash)) | 1504 | if (mapBlockIndex.count(hash)) |
| @@ -1512,6 +1517,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) | |||
| 1512 | if (!mapBlockIndex.count(pblock->hashPrevBlock)) | 1517 | if (!mapBlockIndex.count(pblock->hashPrevBlock)) |
| 1513 | { | 1518 | { |
| 1514 | printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,14).c_str()); | 1519 | printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,14).c_str()); |
| 1520 | if (pfrom) | ||
| 1521 | nBlocksWithoutParent++; | ||
| 1515 | mapOrphanBlocks.insert(make_pair(hash, pblock)); | 1522 | mapOrphanBlocks.insert(make_pair(hash, pblock)); |
| 1516 | mapOrphanBlocksByPrev.insert(make_pair(pblock->hashPrevBlock, pblock)); | 1523 | mapOrphanBlocksByPrev.insert(make_pair(pblock->hashPrevBlock, pblock)); |
| 1517 | 1524 | ||