Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to add genesis block to blockchain #8

Closed
iamjuarez opened this issue Aug 13, 2019 · 4 comments
Closed

failed to add genesis block to blockchain #8

iamjuarez opened this issue Aug 13, 2019 · 4 comments

Comments

@iamjuarez
Copy link
Contributor

prosus

@yerkobits
Copy link
Member

Prosus-Money forked itself (2016) and the old blockchain was copied manually to the new folder. This was always a security system to prevent "network hijacking."
The experiment worked. It is time to integrate these blocks into the block generation algorithm of the new Prosus-Money.

@yerkobits
Copy link
Member

/src/Daemon/Daemon.cpp

//std::string config_folder = "blockchain";

#include <stdio.h>  // fopen(), fwrite(), fclose()
//los siguientes archivos se obtuvieron ejecutando: xxd -i binario.dat cabecera.h
#include "genesisBlockindexes.h"
    //extern const char blockindexes_dat[];
    //extern const size_t blockindexes_dat_len;
#include "genesisBlocks.h"
    //extern const char blocks_dat[];
    //extern const size_t blocks_dat_len;

FILE *archivo1;
FILE *archivo2;
archivo1 = fopen( (config_folder+"/"+"blockindexes.dat").c_str(), "rb+");
archivo2 = fopen( (config_folder+"/"+"blocks.dat").c_str(), "rb+");
if ( (archivo1 == NULL) && (archivo2 == NULL) ) {
logger(INFO, BRIGHT_WHITE) << "blockchain-file not found, creating genesis data...";
}


if(archivo1 == NULL) { // si archivo no existe, es creado.
    archivo1 = fopen( (config_folder+"/"+"blockindexes.dat").c_str(), "w");
    fwrite(blockindexes_dat, 1, blockindexes_dat_len, archivo1);
    fclose(archivo1);
}
if(archivo2 == NULL) { 
    archivo2 = fopen( (config_folder+"/"+"blocks.dat").c_str(), "w");
    fwrite(blocks_dat, 1, blocks_dat_len, archivo2);
    fclose(archivo2);
}

yerkobits added a commit that referenced this issue Aug 28, 2019
@Goro2030
Copy link
Contributor

@yerkobits can you close this issue already?

@yerkobits
Copy link
Member

Prosus Money v0.7.2-gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants