diff --git a/src/komodo_globals.h b/src/komodo_globals.h index b4f886e4b..c46486430 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -48,7 +48,7 @@ int COINBASE_MATURITY = _COINBASE_MATURITY;//100; int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND; int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE = 1; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONATION_PUBKEY; -uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_PUBLIC; +uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE; char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN],ASSETCHAINS_USERPASS[4096]; uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index c8c2e35b1..c6ffe4cdd 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1541,6 +1541,7 @@ void komodo_args(char *argv0) } ASSETCHAINS_CC = GetArg("-ac_cc",0); ASSETCHAINS_PUBLIC = GetArg("-ac_public",0); + ASSETCHAINS_PRIVATE = GetArg("-ac_private",0); if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 ) { printf("KOMODO_REWIND %d\n",KOMODO_REWIND); diff --git a/src/main.cpp b/src/main.cpp index a7565e0ab..13a3121c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1090,6 +1090,7 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio // Check for negative or overflow output values CAmount nValueOut = 0; + int32_t iscoinbase = tx.IsCoinBase(); BOOST_FOREACH(const CTxOut& txout, tx.vout) { if (txout.nValue < 0) @@ -1100,6 +1101,10 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio fprintf(stderr,"%.8f > max %.8f\n",(double)txout.nValue/COIN,(double)MAX_MONEY/COIN); return state.DoS(100, error("CheckTransaction(): txout.nValue too high"),REJECT_INVALID, "bad-txns-vout-toolarge"); } + if ( txout.nValue > 0 && ASSETCHAINS_PRIVATE != 0 && iscoinbase == 0 ) + { + return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain"); + } nValueOut += txout.nValue; if (!MoneyRange(nValueOut)) return state.DoS(100, error("CheckTransaction(): txout total out of range"), @@ -1742,7 +1747,7 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex,bool checkPOW) extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; extern uint32_t ASSETCHAINS_MAGIC; extern uint64_t ASSETCHAINS_STAKED,ASSETCHAINS_ENDSUBSIDY,ASSETCHAINS_REWARD,ASSETCHAINS_HALVING,ASSETCHAINS_LINEAR,ASSETCHAINS_COMMISSION,ASSETCHAINS_SUPPLY; -extern uint8_t ASSETCHAINS_PUBLIC; +extern uint8_t ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE; CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) {