Fix compile error and remove some cryptocondition dingleberries
This commit is contained in:
@@ -14,8 +14,6 @@ You can run a single test by calling `qa/pull-tester/rpc-tests.sh <testname>`.
|
|||||||
|
|
||||||
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
|
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
|
||||||
|
|
||||||
Also it's possible to run CryptoConditions tests only by `qa/pull-tester/cc-tests.sh --noshutdown --tracerpc`
|
|
||||||
|
|
||||||
Possible options:
|
Possible options:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ CC = gcc
|
|||||||
CC_DARWIN = g++-8
|
CC_DARWIN = g++-8
|
||||||
CC_WIN = x86_64-w64-mingw32-gcc-posix
|
CC_WIN = x86_64-w64-mingw32-gcc-posix
|
||||||
CC_AARCH64 = aarch64-linux-gnu-g++
|
CC_AARCH64 = aarch64-linux-gnu-g++
|
||||||
CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I../leveldb/include -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib
|
CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib
|
||||||
CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I../leveldb/include -I.. -I. -fPIC -shared
|
CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared
|
||||||
CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I../leveldb/include -I.. -I. -fPIC -shared
|
CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared
|
||||||
DEBUGFLAGS = -O0 -D _DEBUG
|
DEBUGFLAGS = -O0 -D _DEBUG
|
||||||
RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program
|
RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program
|
||||||
$(info $(OS))
|
$(info $(OS))
|
||||||
@@ -15,7 +15,6 @@ TARGET = customcc.so
|
|||||||
TARGET_DARWIN = customcc.dylib
|
TARGET_DARWIN = customcc.dylib
|
||||||
TARGET_WIN = customcc.dll
|
TARGET_WIN = customcc.dll
|
||||||
SOURCES = cclib.cpp
|
SOURCES = cclib.cpp
|
||||||
#HEADERS = $(shell echo ../cryptoconditions/include/*.h) -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/
|
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
## CCLIB
|
|
||||||
|
|
||||||
Please follow the below instructions to build the cryptoconditions library
|
|
||||||
|
|
||||||
```
|
|
||||||
make clean
|
|
||||||
make
|
|
||||||
```
|
|
||||||
@@ -601,12 +601,8 @@ std::string HelpMessage(HelpMessageMode mode)
|
|||||||
strUsage += HelpMessageGroup(_("Hush Arrakis Chain options:"));
|
strUsage += HelpMessageGroup(_("Hush Arrakis Chain options:"));
|
||||||
strUsage += HelpMessageOpt("-ac_algo", _("Choose PoW mining algorithm, either 'equihash' or 'randomx'. default is Equihash (200,9)"));
|
strUsage += HelpMessageOpt("-ac_algo", _("Choose PoW mining algorithm, either 'equihash' or 'randomx'. default is Equihash (200,9)"));
|
||||||
strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60"));
|
strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60"));
|
||||||
strUsage += HelpMessageOpt("-ac_cc", _("Cryptoconditions, default 0"));
|
|
||||||
strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration"));
|
strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration"));
|
||||||
strUsage += HelpMessageOpt("-ac_coda", _("CODA integration"));
|
strUsage += HelpMessageOpt("-ac_coda", _("CODA integration"));
|
||||||
strUsage += HelpMessageOpt("-ac_cclib", _("Cryptoconditions dynamicly loadable library"));
|
|
||||||
strUsage += HelpMessageOpt("-ac_ccenable", _("Cryptoconditions to enable"));
|
|
||||||
strUsage += HelpMessageOpt("-ac_ccactivate", _("Block height to enable Cryptoconditions"));
|
|
||||||
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
|
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
|
||||||
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));
|
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));
|
||||||
strUsage += HelpMessageOpt("-ac_eras", _("Block reward eras"));
|
strUsage += HelpMessageOpt("-ac_eras", _("Block reward eras"));
|
||||||
|
|||||||
33
src/main.cpp
33
src/main.cpp
@@ -1224,6 +1224,7 @@ bool ContextualCheckTransaction(int32_t slowflag,const CBlock *block, CBlockInde
|
|||||||
const bool saplingActive = nHeight >=1 ? true : false; //NetworkUpgradeActive(nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
const bool saplingActive = nHeight >=1 ? true : false; //NetworkUpgradeActive(nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
||||||
const bool isSprout = false; //!overwinterActive;
|
const bool isSprout = false; //!overwinterActive;
|
||||||
|
|
||||||
|
/*
|
||||||
// If Sprout rules apply, reject transactions which are intended for Overwinter and beyond
|
// If Sprout rules apply, reject transactions which are intended for Overwinter and beyond
|
||||||
if (isSprout && tx.fOverwintered) {
|
if (isSprout && tx.fOverwintered) {
|
||||||
int32_t ht = Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight;
|
int32_t ht = Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight;
|
||||||
@@ -3074,13 +3075,7 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
|
|||||||
// However, this is only reliable if the last block was on or after
|
// However, this is only reliable if the last block was on or after
|
||||||
// the Sapling activation height. Otherwise, the last anchor was the
|
// the Sapling activation height. Otherwise, the last anchor was the
|
||||||
// empty root.
|
// empty root.
|
||||||
<<<<<<< HEAD
|
|
||||||
const bool sapling = pindex->pprev->GetHeight() >= 1 ? true : false; // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
const bool sapling = pindex->pprev->GetHeight() >= 1 ? true : false; // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
||||||
||||||| merged common ancestors
|
|
||||||
const bool sapling = true; // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
|
||||||
=======
|
|
||||||
const bool sapling = pindex->GetHeight() >= 2 ? true : false; // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
|
|
||||||
>>>>>>> duke
|
|
||||||
if (sapling) {
|
if (sapling) {
|
||||||
view.PopAnchor(pindex->pprev->hashFinalSaplingRoot, SAPLING);
|
view.PopAnchor(pindex->pprev->hashFinalSaplingRoot, SAPLING);
|
||||||
} else {
|
} else {
|
||||||
@@ -3493,13 +3488,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
|
|
||||||
// If Sapling is active, block.hashFinalSaplingRoot must be the
|
// If Sapling is active, block.hashFinalSaplingRoot must be the
|
||||||
// same as the root of the Sapling tree
|
// same as the root of the Sapling tree
|
||||||
<<<<<<< HEAD
|
|
||||||
const bool sapling = pindex->GetHeight()>=1 ? true : false; //NetworkUpgradeActive(pindex->GetHeight(), chainparams.GetConsensus(), Consensus::UPGRADE_SAPLING);
|
const bool sapling = pindex->GetHeight()>=1 ? true : false; //NetworkUpgradeActive(pindex->GetHeight(), chainparams.GetConsensus(), Consensus::UPGRADE_SAPLING);
|
||||||
||||||| merged common ancestors
|
|
||||||
const bool sapling = true; //NetworkUpgradeActive(pindex->GetHeight(), chainparams.GetConsensus(), Consensus::UPGRADE_SAPLING);
|
|
||||||
=======
|
|
||||||
const bool sapling = pindex->GetHeight() >= 1 ? true : false; //NetworkUpgradeActive(pindex->GetHeight(), chainparams.GetConsensus(), Consensus::UPGRADE_SAPLING);
|
|
||||||
>>>>>>> duke
|
|
||||||
if (sapling) {
|
if (sapling) {
|
||||||
if (block.hashFinalSaplingRoot != sapling_tree.root()) {
|
if (block.hashFinalSaplingRoot != sapling_tree.root()) {
|
||||||
return state.DoS(100,
|
return state.DoS(100,
|
||||||
@@ -5225,16 +5214,8 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
|||||||
bool ContextualCheckBlock(int32_t slowflag,const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev)
|
bool ContextualCheckBlock(int32_t slowflag,const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev)
|
||||||
{
|
{
|
||||||
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->GetHeight() + 1;
|
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->GetHeight() + 1;
|
||||||
<<<<<<< HEAD
|
|
||||||
const Consensus::Params& consensusParams = Params().GetConsensus();
|
|
||||||
// bool sapling = nHeight>=1 ? true : false; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING);
|
|
||||||
||||||| merged common ancestors
|
|
||||||
const Consensus::Params& consensusParams = Params().GetConsensus();
|
|
||||||
bool sapling = true; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING);
|
|
||||||
=======
|
|
||||||
//const Consensus::Params& consensusParams = Params().GetConsensus();
|
//const Consensus::Params& consensusParams = Params().GetConsensus();
|
||||||
//bool sapling = true; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING);
|
//bool sapling = true; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING);
|
||||||
>>>>>>> duke
|
|
||||||
|
|
||||||
// Check that all transactions are finalized
|
// Check that all transactions are finalized
|
||||||
for (uint32_t i = 0; i < block.vtx.size(); i++) {
|
for (uint32_t i = 0; i < block.vtx.size(); i++) {
|
||||||
@@ -8229,24 +8210,12 @@ CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Para
|
|||||||
mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
|
mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
|
||||||
mtx.nVersion = SAPLING_TX_VERSION;
|
mtx.nVersion = SAPLING_TX_VERSION;
|
||||||
} else {
|
} else {
|
||||||
<<<<<<< HEAD
|
|
||||||
const bool isOverwintered = nHeight>=1 ? true : false; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_OVERWINTER);
|
const bool isOverwintered = nHeight>=1 ? true : false; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_OVERWINTER);
|
||||||
||||||| merged common ancestors
|
|
||||||
bool isOverwintered = true; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_OVERWINTER);
|
|
||||||
=======
|
|
||||||
const bool isOverwintered = nHeight >=1 ? true : false; //NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_OVERWINTER);
|
|
||||||
>>>>>>> duke
|
|
||||||
if (isOverwintered)
|
if (isOverwintered)
|
||||||
{
|
{
|
||||||
mtx.fOverwintered = true;
|
mtx.fOverwintered = true;
|
||||||
mtx.nExpiryHeight = nHeight + expiryDelta;
|
mtx.nExpiryHeight = nHeight + expiryDelta;
|
||||||
<<<<<<< HEAD
|
|
||||||
const bool sapling = nHeight>=1 ? true : false;
|
|
||||||
||||||| merged common ancestors
|
|
||||||
const bool sapling = true;
|
|
||||||
=======
|
|
||||||
const bool sapling = nHeight >=1 ? true : false;
|
const bool sapling = nHeight >=1 ? true : false;
|
||||||
>>>>>>> duke
|
|
||||||
if (sapling) // NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING))
|
if (sapling) // NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING))
|
||||||
{
|
{
|
||||||
mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
|
mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
|
||||||
|
|||||||
Reference in New Issue
Block a user