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

Updating activation pre-testing on testnet network #4

Open
wants to merge 7 commits into
base: omni
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh "$(abs_top_builddir)/src/obj/build.h" \
"$(abs_top_srcdir)"
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
omnicore/libbitcoin_server_a-version.$(OBJEXT): obj/build.h # build info

# server: shared between bitcoind and bitcoin-qt
libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
Expand Down
94 changes: 45 additions & 49 deletions src/omnicore/activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "omnicore/activation.h"
#include "omnicore/log.h"
#include "omnicore/utilsbitcoin.h"
#include "omnicore/version.h"

#include "validation.h" //NOTE: after-> main.h
Expand Down Expand Up @@ -88,12 +89,9 @@ void CheckLiveActivations(int blockHeight)
if (OMNICORE_VERSION < liveActivation.minClientVersion) {
std::string msgText = strprintf("Shutting down due to unsupported feature activation (%d: %s)", liveActivation.featureId, liveActivation.featureName);
PrintToLog(msgText);
PrintToConsole(msgText);
// if (!GetBoolArg("-overrideforcedshutdown", false)) {
// boost::filesystem::path persistPath = GetDataDir() / "MP_persist";
// if (boost::filesystem::exists(persistPath)) boost::filesystem::remove_all(persistPath); // prevent the node being restarted without a reparse after forced shutdown
// AbortNode(msgText, msgText);
// }
if (!gArgs.GetBoolArg("-overrideforcedshutdown", false)) {
//AbortNode(msgText, msgText); TODO FIX AbortNode
}
}
PendingActivationCompleted(liveActivation);
}
Expand Down Expand Up @@ -154,33 +152,31 @@ bool CheckActivationAuthorization(const std::string& sender)
"16oDZYCspsczfgKXVj3xyvsxH21NpEj94F" // Adam Chamely - [email protected] - Project maintainer, developer
],
*/
whitelisted.insert("3Fc5gWzEQh1YGeqVXH6E4GDEGgbZJREJQ3");
// @Blackbox and @Santos multisig 2 to 2
whitelisted.insert("2N9doCzp1z2vDe9Go3sxeVTZ4YsNTBEzed3");

// Testnet / Regtest
// Regtest
// use -omniactivationallowsender for testing

// Add manually whitelisted sources
// if (mapArgs.count("-omniactivationallowsender")) {
// const std::vector<std::string>& sources = mapMultiArgs["-omniactivationallowsender"];
//
// for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
// whitelisted.insert(*it);
// }
// }
if (gArgs.IsArgSet("-omniactivationallowsender") && RegTest()) {
const std::vector<std::string>& sources = gArgs.GetArgs("-omniactivationallowsender");

for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
whitelisted.insert(*it);
}
}

// Remove manually ignored sources
// if (mapArgs.count("-omniactivationignoresender")) {
// const std::vector<std::string>& sources = mapMultiArgs["-omniactivationignoresender"];
//
// for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
// whitelisted.erase(*it);
// }
// }

bool fAuthorized = (whitelisted.count(sender) ||
whitelisted.count("any"));

return fAuthorized;
if (gArgs.IsArgSet("-omniactivationignoresender") && RegTest()) {
const std::vector<std::string>& sources = gArgs.GetArgs("-omniactivationignoresender");

for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
whitelisted.erase(*it);
}
}

return (whitelisted.count(sender) || whitelisted.count("any"));
}

/**
Expand All @@ -205,33 +201,33 @@ bool CheckDeactivationAuthorization(const std::string& sender)
"16oDZYCspsczfgKXVj3xyvsxH21NpEj94F" // Adam Chamely - [email protected] - Project maintainer, developer
],
*/
whitelisted.insert("34kwkVRSvFVEoUwcQSgpQ4ZUasuZ54DJLD");

// Testnet / Regtest
// @Blackbox and @Santos multisig 2 to 2
whitelisted.insert("2N9doCzp1z2vDe9Go3sxeVTZ4YsNTBEzed3");

// Regtest
// use -omniactivationallowsender for testing

// Add manually whitelisted sources - custom sources affect both activation and deactivation
// if (mapArgs.count("-omniactivationallowsender")) {
// const std::vector<std::string>& sources = mapMultiArgs["-omniactivationallowsender"];
//
// for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
// whitelisted.insert(*it);
// }
// }
//Add manually whitelisted sources - custom sources affect both activation and deactivation
if (gArgs.IsArgSet("-omniactivationallowsender") && RegTest()) {
const std::vector<std::string>& sources = gArgs.GetArgs("-omniactivationallowsender");

for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
whitelisted.insert(*it);
}
}

// Remove manually ignored sources - custom sources affect both activation and deactivation
// if (mapArgs.count("-omniactivationignoresender")) {
// const std::vector<std::string>& sources = mapMultiArgs["-omniactivationignoresender"];
//
// for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
// whitelisted.erase(*it);
// }
// }

bool fAuthorized = (whitelisted.count(sender) ||
whitelisted.count("any"));

return fAuthorized;
if (gArgs.IsArgSet("-omniactivationignoresender") && RegTest()) {
const std::vector<std::string>& sources = gArgs.GetArgs("-omniactivationignoresender");

for (std::vector<std::string>::const_iterator it = sources.begin(); it != sources.end(); ++it) {
whitelisted.erase(*it);
}
}

return (whitelisted.count(sender) || whitelisted.count("any"));

}

} // namespace mastercore
Loading