src/checkpointsync.cpp
bool CheckCheckpointPubKey()
{
    string strPubKey = "";
    string strMasterPubKey = Params().CheckpointPubKey();

    if (!pblocktree->ReadCheckpointPubKey(strPubKey) || strPubKey != strMasterPubKey)
    {
        // write checkpoint master key to db
        if (!pblocktree->WriteCheckpointPubKey(strMasterPubKey))
            return error("CheckCheckpointPubKey() : failed to write new checkpoint master key to db");
        if (!pblocktree->Sync())
            return error("CheckCheckpointPubKey() : failed to commit new checkpoint master key to db");
        if (!ResetSyncCheckpoint())
            return error("CheckCheckpointPubKey() : failed to reset sync-checkpoint");
    }

    return true;
}
// Verify sync checkpoint master pubkey and reset sync checkpoint if changed
Verify sync checkpoint master pubkey and reset sync checkpoint if changed
Verify sync checkpoint master pubkey and reset sync checkpoint if changed
bool CheckCheckpointPubKey()
{
    string strPubKey = "";
    string strMasterPubKey = Params().CheckpointPubKey();
    if (!pblocktree->ReadCheckpointPubKey(strPubKey) || strPubKey != strMasterPubKey)
    {
        if (!pblocktree->WriteCheckpointPubKey(strMasterPubKey))
            return error("CheckCheckpointPubKey() : failed to write new checkpoint master key to db");
        if (!pblocktree->Sync())
            return error("CheckCheckpointPubKey() : failed to commit new checkpoint master key to db");
        if (!ResetSyncCheckpoint())
            return error("CheckCheckpointPubKey() : failed to reset sync-checkpoint");
    }
    return true;
}
bool CheckCheckpointPubKey ( ) { string strPubKey = " " ; string strMasterPubKey = Params ( ) . CheckpointPubKey ( ) ; if ( ! pblocktree -> ReadCheckpointPubKey ( strPubKey ) || strPubKey != strMasterPubKey ) { if ( ! pblocktree -> WriteCheckpointPubKey ( strMasterPubKey ) ) return error ( " " ) ; if ( ! pblocktree -> Sync ( ) ) return error ( " " ) ; if ( ! ResetSyncCheckpoint ( ) ) return error ( " " ) ; } return true ; }
Verify sync checkpoint master pubkey and reset sync checkpoint if changed
Verify sync checkpoint master pubkey and reset sync checkpoint if changed
// write checkpoint master key to db