We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52ec12d commit eeb112fCopy full SHA for eeb112f
src/masternode.h
@@ -251,14 +251,20 @@ class CMasternode : public CSignedMessage
251
252
int GetMasternodeInputAge()
253
{
254
- if (chainActive.Tip() == NULL) return 0;
+ int tipHeight;
255
+ {
256
+ LOCK(cs_main);
257
+ CBlockIndex *pindex = chainActive.Tip();
258
+ if (!pindex) return 0;
259
+ tipHeight = pindex->nHeight;
260
+ }
261
262
if (cacheInputAge == 0) {
263
cacheInputAge = GetInputAge(vin);
- cacheInputAgeBlock = chainActive.Tip()->nHeight;
264
+ cacheInputAgeBlock = tipHeight;
265
}
266
- return cacheInputAge + (chainActive.Tip()->nHeight - cacheInputAgeBlock);
267
+ return cacheInputAge + (tipHeight - cacheInputAgeBlock);
268
269
270
std::string Status()
0 commit comments