message: [Network] Add SPORK 17 and 18 to the fMissingSporks flag + move the validation below the old protocol and the connected to ourself check. No need to send the message if we are going to end up disconnecting from the peer.
diff: @@ -6262,18 +6262,6 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
  return false;
  }
  - // PIVX: We use certain sporks during IBD, so check to see if they are
  - // available. If not, ask the first peer connected for them.
  - bool fMissingSporks = !pSporkDB->SporkExists(SPORK_14_NEW_PROTOCOL_ENFORCEMENT) &&
  - !pSporkDB->SporkExists(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) &&
  - !pSporkDB->SporkExists(SPORK_16_ZEROCOIN_MAINTENANCE_MODE);
  -
  - if (fMissingSporks || !fRequestedSporksIDB){
  - LogPrintf("asking peer for sporks\n");
  - pfrom->PushMessage("getsporks");
  - fRequestedSporksIDB = true;
  - }
  -
  int64_t nTime;
  CAddress addrMe;
  CAddress addrFrom;
  @@ -6304,6 +6292,21 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
  return true;
  }
  + // PIVX: We use certain sporks during IBD, so check to see if they are
  + // available. If not, ask the first peer connected for them.
  + // TODO: Move this to an instant broadcast of the sporks.
  + bool fMissingSporks = !pSporkDB->SporkExists(SPORK_14_NEW_PROTOCOL_ENFORCEMENT) ||
  + !pSporkDB->SporkExists(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) ||
  + !pSporkDB->SporkExists(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) ||
  + !pSporkDB->SporkExists(SPORK_17_COLDSTAKING_ENFORCEMENT) ||
  + !pSporkDB->SporkExists(SPORK_18_ZEROCOIN_PUBLICSPEND_V4);
  +
  + if (fMissingSporks || !fRequestedSporksIDB){
  + LogPrintf("asking peer for sporks\n");
  + pfrom->PushMessage("getsporks");
  + fRequestedSporksIDB = true;
  + }
  +
  pfrom->addrLocal = addrMe;
  if (pfrom->fInbound && addrMe.IsRoutable()) {
  SeenLocal(addrMe);
  