Esempio n. 1
0
    TestingSetup() {
        fPrintToDebugLog = false; // don't want to write to debug.log file
        noui_connect();
#ifdef ENABLE_WALLET
        bitdb.MakeMock();
#endif
        pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
        boost::filesystem::create_directories(pathTemp);
        mapArgs["-datadir"] = pathTemp.string();
	mapArgs["-testnet"] = "true";
        pblocktree = new CBlockTreeDB(1 << 20, true);
        pviewTip = new TrieView();
	LoadBlockIndex();
	printf("Loaded\n");
        // If the loaded chain has a wrong genesis, bail out immediately
        // (we're likely using a testnet datadir, or the other way around).
        if (!mapBlockIndex.empty() && chainActive.Genesis() == NULL)
        	printf("Incorrect or no genesis block found. Wrong datadir for network?");
        InitBlockIndex();
	printf("Init Done\n");
#ifdef ENABLE_WALLET
        bool fFirstRun;
        pwalletMain = new CWallet("wallet.dat");
        pwalletMain->LoadWallet(fFirstRun);
        RegisterWallet(pwalletMain);
#endif
        nScriptCheckThreads = 3;
        for (int i=0; i < nScriptCheckThreads-1; i++)
            threadGroup.create_thread(&ThreadScriptCheck);
        RegisterNodeSignals(GetNodeSignals());
    }
Esempio n. 2
0
 TestingSetup() {
     fPrintToDebugger = true; // don't want to write to debug.log file
     noui_connect();
     bitdb.MakeMock();
     LoadBlockIndex(true);
     pWalletManager = new CWalletManager();
     std::ostringstream ossErrors;
     pWalletManager->LoadWallet("", ossErrors);
     pwalletMain = pWalletManager->GetDefaultWallet().get();
 }
Esempio n. 3
0
 TestingSetup() {
     fPrintToDebugger = true; // don't want to write to debug.log file
     noui_connect();
     bitdb.MakeMock();
     LoadBlockIndex(true);
     bool fFirstRun;
     pwalletMain = new CWallet("wallet.dat");
     pwalletMain->LoadWallet(fFirstRun);
     RegisterWallet(pwalletMain);
 }
Esempio n. 4
0
 TestingSetup() {
     fPrintToConsole = true; // don't want to write to debug.log file
     pwalletMain = new CWallet();
     bitdb.MakeMock();
     LoadBlockIndex(true);
     bool fFirstRun;
     pwalletMain = new CWallet("wallet.dat");
     pwalletMain->LoadWallet(fFirstRun);
     RegisterWallet(pwalletMain);
     scrapesDB = new CScrapesDB("cw");
 }
Esempio n. 5
0
 TestingSetup() {
     fPrintToDebugLog = false; // don't want to write to debug.log file
     noui_connect();
     bitdb.MakeMock();
     pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
     boost::filesystem::create_directories(pathTemp);
     mapArgs["-datadir"] = pathTemp.string();
     LoadBlockIndex(true);
     bool fFirstRun;
     pwalletMain = new CWallet("walletUT.dat");
     pwalletMain->LoadWallet(fFirstRun);
     RegisterWallet(pwalletMain);
 }
Esempio n. 6
0
 TestingSetup() {
     fPrintToDebugger = true; // don't want to write to debug.log file
     noui_connect();
     bitdb.MakeMock();
     pblocktree = new CBlockTreeDB(true);
     pcoinsdbview = new CCoinsViewDB(true);
     pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
     LoadBlockIndex(true);
     bool fFirstRun;
     pwalletMain = new CWallet("wallet.dat");
     pwalletMain->LoadWallet(fFirstRun);
     RegisterWallet(pwalletMain);
 }
Esempio n. 7
0
 TestingSetup() {
     //fPrintToDebugLog = false; // don't want to write to debug.log file
     
     //pathTemp = GetTempPath() / strprintf("test_LEOcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
     pathTemp = GetTempPath() / "test_LEOcoin";
     //printf("pathTemp %s\n", pathTemp.string().c_str());
     boost::filesystem::create_directories(pathTemp);
     mapArgs["-datadir"] = pathTemp.string();
     
     fDebug = true;
     fDebugSmsg = true;
     fDebugChain = true;
     fDebugRingSig = true;
     fDebugPoS = true;
     
     noui_connect();
     bitdb.MakeMock();
     
     LoadBlockIndex(true);
     pwalletMain = new CWallet("walletUT.dat");
     pwalletMain->LoadWallet();
     RegisterWallet(pwalletMain);
 }