upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
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;
88int nDropMessagesTest = 0; 88int nDropMessagesTest = 0;
89bool fSoloMineTest = false; // /solomine: mine without requiring a peer (local test) 89bool fSoloMineTest = false; // /solomine: mine without requiring a peer (local test)
90bool fPoolNoAnnounce = false; // /noannounce: operator serves miners but never publishes pool announcements 90bool fPoolNoAnnounce = false; // /noannounce: operator serves miners but never publishes pool announcements
91bool fPoolMineBlind = false; // /poolmineblind: issue jobs even when no peer has reported a height
91 92
92// Settings 93// Settings
93int fGenerateBitcoins; 94int 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