Skip to content

Commit

Permalink
Disabled Premine
Browse files Browse the repository at this point in the history
  • Loading branch information
Evydder committed Apr 18, 2018
1 parent ac719d5 commit 4e06cb6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
17 changes: 17 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,23 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
set<COutPoint> 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);
Expand Down

0 comments on commit 4e06cb6

Please sign in to comment.