CSyncCheckpoint checkpointMessagePending;
CCriticalSection cs_hashSyncCheckpoint;
- bool CSyncCheckpoint::ProcessSyncCheckpoint()
+ bool CSyncCheckpoint::ProcessSyncCheckpoint(CNode* pfrom)
{
if (!CheckSignature())
return false;
{
if (!mapBlockIndex.count(hashCheckpoint))
{
- // TODO: we don't have this block yet, so ask for it
+ // We haven't accepted this block, keep the checkpoint as pending
checkpointMessagePending = *this;
+ // Ask this guy to fill in what we're missing
+ if (pfrom)
+ pfrom->PushGetBlocks(pindexBest, hashCheckpoint);
return false;
}
Checkpoints::CSyncCheckpoint checkpoint;
vRecv >> checkpoint;
- if (checkpoint.ProcessSyncCheckpoint())
+ if (checkpoint.ProcessSyncCheckpoint(pfrom))
{
// Relay
pfrom->hashCheckpointKnown = checkpoint.hashCheckpoint;