message: Disconnect peers that have exceeded their download timeout for a graphene block
diff: @@ -7052,10 +7052,10 @@ bool SendMessages(CNode *pto)
  }
  }
  - // Check to see if there are any thinblocks in flight that have gone beyond the timeout interval.
  - // If so then we need to disconnect them so that the thinblock data is nullified. We coud null
  - // the thinblock data here but that would possible cause a node to be baneed later if the thinblock
  - // finally did show up. Better to just disconnect this slow node instead.
  + // Check to see if there are any thinblocks or graphene blocks in flight that have gone beyond the
  + // timeout interval. If so then we need to disconnect them so that the thinblock data is nullified.
  + // We could null the associated data here but that would possibly cause a node to be banned later if
  + // the thinblock or graphene block finally did show up, so instead we just disconnect this slow node.
  if (pto->mapThinBlocksInFlight.size() > 0)
  {
  LOCK(pto->cs_mapthinblocksinflight);
  @@ -7079,6 +7079,29 @@ bool SendMessages(CNode *pto)
  iter++;
  }
  }
  + if (pto->mapGrapheneBlocksInFlight.size() > 0)
  + {
  + LOCK(pto->cs_mapgrapheneblocksinflight);
  + std::map<uint256, CNode::CGrapheneBlockInFlight>::iterator iter = pto->mapGrapheneBlocksInFlight.begin();
  + while (iter != pto->mapGrapheneBlocksInFlight.end())
  + {
  + // Use a timeout of 6 times the retry inverval before disconnecting. This way only a max of 6
  + // re-requested thinblocks could be in memory at any one time.
  + if (!(*iter).second.fReceived &&
  + (GetTime() - (*iter).second.nRequestTime) > 6 * blkReqRetryInterval / 1000000)
  + {
  + if (!pto->fWhitelisted && Params().NetworkIDString() != "regtest")
  + {
  + LOG(THIN, "ERROR: Disconnecting peer %s due to thinblock download timeout exceeded "
  + "(%d secs)\n",
  + pto->GetLogName(), (GetTime() - (*iter).second.nRequestTime));
  + pto->fDisconnect = true;
  + break;
  + }
  + }
  + iter++;
  + }
  + }
  // Check for block download timeout and disconnect node if necessary. Does not require cs_main.
  int64_t nNow = GetTimeMicros();
  