Skip to content

Commit

Permalink
Merge pull request #6 from DeFiCh/pos-integration
Browse files Browse the repository at this point in the history
PoS integration
  • Loading branch information
uzyn authored Dec 21, 2019
2 parents 28bb509 + 5ebda27 commit 4e1e50a
Show file tree
Hide file tree
Showing 113 changed files with 5,120 additions and 2,461 deletions.
7 changes: 7 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ BITCOIN_CORE_H = \
dbwrapper.h \
limitedmap.h \
logging.h \
masternodes/masternodes.h \
masternodes/mn_checks.h \
masternodes/mn_txdb.h \
memusage.h \
merkleblock.h \
miner.h \
Expand Down Expand Up @@ -276,6 +279,10 @@ libbitcoin_server_a_SOURCES = \
interfaces/node.cpp \
init.cpp \
dbwrapper.cpp \
masternodes/masternodes.cpp \
masternodes/mn_checks.cpp \
masternodes/mn_txdb.cpp \
masternodes/mn_rpc.cpp \
miner.cpp \
net.cpp \
net_processing.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES)
bench_bench_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/
bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bench_bench_bitcoin_LDADD = \
$(LIBBITCOIN_MN) \
$(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_SERVER) \
Expand Down
68 changes: 34 additions & 34 deletions src/bench/bench_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,40 @@ static void SetupBenchArgs()

int main(int argc, char** argv)
{
SetupBenchArgs();
std::string error;
if (!gArgs.ParseParameters(argc, argv, error)) {
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str());
return EXIT_FAILURE;
}

if (HelpRequested(gArgs)) {
std::cout << gArgs.GetHelpMessage();

return EXIT_SUCCESS;
}

int64_t evaluations = gArgs.GetArg("-evals", DEFAULT_BENCH_EVALUATIONS);
std::string regex_filter = gArgs.GetArg("-filter", DEFAULT_BENCH_FILTER);
std::string scaling_str = gArgs.GetArg("-scaling", DEFAULT_BENCH_SCALING);
bool is_list_only = gArgs.GetBoolArg("-list", false);

double scaling_factor;
if (!ParseDouble(scaling_str, &scaling_factor)) {
tfm::format(std::cerr, "Error parsing scaling factor as double: %s\n", scaling_str.c_str());
return EXIT_FAILURE;
}

std::unique_ptr<benchmark::Printer> printer = MakeUnique<benchmark::ConsolePrinter>();
std::string printer_arg = gArgs.GetArg("-printer", DEFAULT_BENCH_PRINTER);
if ("plot" == printer_arg) {
printer.reset(new benchmark::PlotlyPrinter(
gArgs.GetArg("-plot-plotlyurl", DEFAULT_PLOT_PLOTLYURL),
gArgs.GetArg("-plot-width", DEFAULT_PLOT_WIDTH),
gArgs.GetArg("-plot-height", DEFAULT_PLOT_HEIGHT)));
}

benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only);
// SetupBenchArgs(); // TODO: (temp) disable benches
// std::string error;
// if (!gArgs.ParseParameters(argc, argv, error)) {
// tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str());
// return EXIT_FAILURE;
// }
//
// if (HelpRequested(gArgs)) {
// std::cout << gArgs.GetHelpMessage();
//
// return EXIT_SUCCESS;
// }
//
// int64_t evaluations = gArgs.GetArg("-evals", DEFAULT_BENCH_EVALUATIONS);
// std::string regex_filter = gArgs.GetArg("-filter", DEFAULT_BENCH_FILTER);
// std::string scaling_str = gArgs.GetArg("-scaling", DEFAULT_BENCH_SCALING);
// bool is_list_only = gArgs.GetBoolArg("-list", false);
//
// double scaling_factor;
// if (!ParseDouble(scaling_str, &scaling_factor)) {
// tfm::format(std::cerr, "Error parsing scaling factor as double: %s\n", scaling_str.c_str());
// return EXIT_FAILURE;
// }
//
// std::unique_ptr<benchmark::Printer> printer = MakeUnique<benchmark::ConsolePrinter>();
// std::string printer_arg = gArgs.GetArg("-printer", DEFAULT_BENCH_PRINTER);
// if ("plot" == printer_arg) {
// printer.reset(new benchmark::PlotlyPrinter(
// gArgs.GetArg("-plot-plotlyurl", DEFAULT_PLOT_PLOTLYURL),
// gArgs.GetArg("-plot-width", DEFAULT_PLOT_WIDTH),
// gArgs.GetArg("-plot-height", DEFAULT_PLOT_HEIGHT)));
// }
//
// benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only);

return EXIT_SUCCESS;
}
2 changes: 2 additions & 0 deletions src/bench/duplicate_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <consensus/merkle.h>
#include <consensus/validation.h>
#include <pos.h>
#include <masternodes/masternodes.h>

#include <txmempool.h>
#include <validation.h>

Expand Down
2 changes: 1 addition & 1 deletion src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#include <config/bitcoin-config.h>
#endif

#include <chainparams.h>
#include <clientversion.h>
#include <coins.h>
#include <consensus/consensus.h>
#include <core_io.h>
#include <key_io.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/transaction.h>
Expand Down
2 changes: 2 additions & 0 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class CBlockIndex
height = 0;
mintedBlocks = 0;
sig = {};
minter = CKeyID();
}

CBlockIndex()
Expand All @@ -239,6 +240,7 @@ class CBlockIndex
mintedBlocks = block.mintedBlocks;
stakeModifier = block.stakeModifier;
sig = block.sig;
block.ExtractMinterKey(minter);
}

FlatFilePos GetBlockPos() const {
Expand Down
Loading

0 comments on commit 4e1e50a

Please sign in to comment.