From 4a325e7ebe559fcfe11d471d3d21c9bbb934d543 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 5 Apr 2015 01:56:29 +0300 Subject: [PATCH] fix CreateNewBlock --- src/miner.cpp | 5 --- src/test/test_darkcoin.cpp | 92 -------------------------------------- 2 files changed, 97 deletions(-) delete mode 100644 src/test/test_darkcoin.cpp diff --git a/src/miner.cpp b/src/miner.cpp index 08ca882f95..407c48a1f0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -111,11 +111,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) txNew.vout.resize(1); txNew.vout[0].scriptPubKey = scriptPubKeyIn; - // Add dummy coinbase tx as first transaction - pblock->vtx.push_back(CTransaction()); - pblocktemplate->vTxFees.push_back(-1); // updated at end - pblocktemplate->vTxSigOps.push_back(-1); // updated at end - // Largest block you're willing to create: unsigned int nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE); // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity: diff --git a/src/test/test_darkcoin.cpp b/src/test/test_darkcoin.cpp deleted file mode 100644 index 883c1a3161..0000000000 --- a/src/test/test_darkcoin.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#define BOOST_TEST_MODULE Bitcoin Test Suite - -#include "main.h" -#include "random.h" -#include "txdb.h" -#include "ui_interface.h" -#include "util.h" -#include "activemasternode.h" -#ifdef ENABLE_WALLET -#include "db.h" -#include "wallet.h" -#endif - -#include -#include -#include - -CClientUIInterface uiInterface; -CWallet* pwalletMain; - -extern bool fPrintToConsole; -extern void noui_connect(); - -struct TestingSetup { - CCoinsViewDB *pcoinsdbview; - boost::filesystem::path pathTemp; - boost::thread_group threadGroup; - - TestingSetup() { - fPrintToDebugLog = false; // don't want to write to debug.log file - SelectParams(CBaseChainParams::UNITTEST); - noui_connect(); -#ifdef ENABLE_WALLET - bitdb.MakeMock(); -#endif - pathTemp = GetTempPath() / strprintf("test_dash_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); - boost::filesystem::create_directories(pathTemp); - mapArgs["-datadir"] = pathTemp.string(); - pblocktree = new CBlockTreeDB(1 << 20, true); - pcoinsdbview = new CCoinsViewDB(1 << 23, true); - pcoinsTip = new CCoinsViewCache(pcoinsdbview); - InitBlockIndex(); -#ifdef ENABLE_WALLET - bool fFirstRun; - pwalletMain = new CWallet("wallet.dat"); - pwalletMain->LoadWallet(fFirstRun); - RegisterValidationInterface(pwalletMain); -#endif - nScriptCheckThreads = 3; - for (int i=0; i < nScriptCheckThreads-1; i++) - threadGroup.create_thread(&ThreadScriptCheck); - RegisterNodeSignals(GetNodeSignals()); - } - ~TestingSetup() - { - threadGroup.interrupt_all(); - threadGroup.join_all(); - UnregisterNodeSignals(GetNodeSignals()); -#ifdef ENABLE_WALLET - delete pwalletMain; - pwalletMain = NULL; -#endif - delete pcoinsTip; - delete pcoinsdbview; - delete pblocktree; -#ifdef ENABLE_WALLET - bitdb.Flush(true); -#endif - boost::filesystem::remove_all(pathTemp); - } -}; - -BOOST_GLOBAL_FIXTURE(TestingSetup); - -void Shutdown(void* parg) -{ - exit(0); -} - -void StartShutdown() -{ - exit(0); -} - -bool ShutdownRequested() -{ - return false; -}