diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 72c403a57..521dd02ab 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -338,7 +338,9 @@ bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const Consensus::Pa // Short-circuit most stuff in case its from the same node map::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash); if (itInFlight != mapBlocksInFlight.end() && itInFlight->second.first == nodeid) { - *pit = &itInFlight->second.second; + if (pit) { + *pit = &itInFlight->second.second; + } return false; }