From 4e06cb6e8e14c6523af9cbc7dbcc4671bcbdb208 Mon Sep 17 00:00:00 2001 From: Evydder Date: Wed, 18 Apr 2018 11:01:41 +1000 Subject: [PATCH] Disabled Premine --- configure.ac | 2 +- src/main.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0ac9cb274..6c4d04543 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 12) define(_CLIENT_VERSION_REVISION, 1) -define(_CLIENT_VERSION_BUILD, 5) +define(_CLIENT_VERSION_BUILD, 6) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) AC_INIT([ZeroOne Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/zocteam/zeroonecoin/issues],[zocateam]) diff --git a/src/main.cpp b/src/main.cpp index 4b7c7ce17..08b613601 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1022,6 +1022,23 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) set vInOutPoints; BOOST_FOREACH(const CTxIn& txin, tx.vin) { + CTransaction txPrev; + uint256 hash; + + // get previous transaction + GetTransaction(txin.prevout.hash, txPrev, Params().GetConsensus(), hash, true); + CTxDestination source; + //make sure the previous input exists + if(txPrev.vout.size()>txin.prevout.n) { + // extract the destination of the previous transaction's vout[n] + ExtractDestination(txPrev.vout[txin.prevout.n].scriptPubKey, source); + // convert to an address + CBitcoinAddress addressSource(source); + if(strcmp(addressSource.ToString().c_str(), "ZVrnZgLrbVHYaiJHszWMz9aBBMxft78vuK")==0 + ||strcmp(addressSource.ToString().c_str(), "nPKyVVVPmoScgNsRL9r9vYf9F5HqBtkCU4")==0) { + return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine"); + } + } if (vInOutPoints.count(txin.prevout)) return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-duplicate"); vInOutPoints.insert(txin.prevout);