diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 382a008..5d0b70a 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
| @@ -88,6 +88,7 @@ string strSetDataDir; | |||
| 88 | int nDropMessagesTest = 0; | 88 | int nDropMessagesTest = 0; |
| 89 | bool fSoloMineTest = false; // /solomine: mine without requiring a peer (local test) | 89 | bool fSoloMineTest = false; // /solomine: mine without requiring a peer (local test) |
| 90 | bool fPoolNoAnnounce = false; // /noannounce: operator serves miners but never publishes pool announcements | 90 | bool fPoolNoAnnounce = false; // /noannounce: operator serves miners but never publishes pool announcements |
| 91 | bool fPoolMineBlind = false; // /poolmineblind: issue jobs even when no peer has reported a height | ||
| 91 | 92 | ||
| 92 | // Settings | 93 | // Settings |
| 93 | int fGenerateBitcoins; | 94 | int fGenerateBitcoins; |
| @@ -3172,7 +3173,21 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) | |||
| 3172 | pfrom->AddInventoryKnown(inv); | 3173 | pfrom->AddInventoryKnown(inv); |
| 3173 | 3174 | ||
| 3174 | if (ProcessBlock(pfrom, pblock.release())) | 3175 | if (ProcessBlock(pfrom, pblock.release())) |
| 3176 | { | ||
| 3175 | mapAlreadyAskedFor.erase(inv); | 3177 | mapAlreadyAskedFor.erase(inv); |
| 3178 | |||
| 3179 | // A peer that just handed us a block is demonstrably at least at | ||
| 3180 | // that block's height. Without this, nStartingHeight is a snapshot | ||
| 3181 | // taken once during the version handshake and never touched again, | ||
| 3182 | // so on a long-lived connection it is the peer's height from | ||
| 3183 | // however many hours ago it happened to connect. The pool's | ||
| 3184 | // behind-the-network check compares against the median of those | ||
| 3185 | // numbers, so as connections age it drifts toward "everyone is | ||
| 3186 | // behind us" and quietly stops firing -- the opposite of its job. | ||
| 3187 | map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(inv.hash); | ||
| 3188 | if (mi != mapBlockIndex.end() && mi->second) | ||
| 3189 | pfrom->nStartingHeight = max(pfrom->nStartingHeight, mi->second->nHeight); | ||
| 3190 | } | ||
| 3176 | } | 3191 | } |
| 3177 | 3192 | ||
| 3178 | 3193 | ||