Initial -ac_txpow 0, 1, 2, 3 with validation, but no txcreation
This commit is contained in:
@@ -48,7 +48,7 @@ int COINBASE_MATURITY = _COINBASE_MATURITY;//100;
|
||||
int32_t KOMODO_MININGTHREADS = -1,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,KOMODO_CONNECTING = -1;
|
||||
int32_t KOMODO_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,KOMODO_CCACTIVATE,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,ASSETCHAINS_PRIVATE;
|
||||
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW;
|
||||
|
||||
char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN],ASSETCHAINS_USERPASS[4096];
|
||||
uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
|
||||
|
||||
@@ -1554,6 +1554,7 @@ void komodo_args(char *argv0)
|
||||
if ( name.c_str()[0] != 0 )
|
||||
{
|
||||
MAX_BLOCK_SIGOPS = 60000;
|
||||
ASSETCHAINS_TXPOW = GetArg("-ac_txpow",0) & 3;
|
||||
ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10);
|
||||
ASSETCHAINS_ENDSUBSIDY = GetArg("-ac_end",0);
|
||||
ASSETCHAINS_REWARD = GetArg("-ac_reward",0);
|
||||
@@ -1590,7 +1591,7 @@ void komodo_args(char *argv0)
|
||||
ASSETCHAINS_COMMISSION = 0;
|
||||
printf("ASSETCHAINS_COMMISSION needs an ASETCHAINS_OVERRIDE_PUBKEY and cant be more than 100000000 (100%%)\n");
|
||||
}
|
||||
if ( ASSETCHAINS_ENDSUBSIDY != 0 || ASSETCHAINS_REWARD != 0 || ASSETCHAINS_HALVING != 0 || ASSETCHAINS_DECAY != 0 || ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_PUBLIC != 0 || ASSETCHAINS_PRIVATE != 0 )
|
||||
if ( ASSETCHAINS_ENDSUBSIDY != 0 || ASSETCHAINS_REWARD != 0 || ASSETCHAINS_HALVING != 0 || ASSETCHAINS_DECAY != 0 || ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_PUBLIC != 0 || ASSETCHAINS_PRIVATE != 0 || ASSETCHAINS_TXPOW != 0 )
|
||||
{
|
||||
fprintf(stderr,"end.%llu blocks, reward %.8f halving.%llu blocks, decay.%llu perc %.4f%% ac_pub=[%02x...]\n",(long long)ASSETCHAINS_ENDSUBSIDY,dstr(ASSETCHAINS_REWARD),(long long)ASSETCHAINS_HALVING,(long long)ASSETCHAINS_DECAY,dstr(ASSETCHAINS_COMMISSION)*100,ASSETCHAINS_OVERRIDE_PUBKEY33[0]);
|
||||
extraptr = extrabuf;
|
||||
@@ -1599,7 +1600,7 @@ void komodo_args(char *argv0)
|
||||
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_REWARD),(void *)&ASSETCHAINS_REWARD);
|
||||
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_HALVING),(void *)&ASSETCHAINS_HALVING);
|
||||
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_DECAY),(void *)&ASSETCHAINS_DECAY);
|
||||
val = ASSETCHAINS_COMMISSION | (((uint64_t)ASSETCHAINS_STAKED & 0xff) << 32) | (((uint64_t)ASSETCHAINS_CC & 0xffff) << 40) | ((ASSETCHAINS_PUBLIC != 0) << 7) | ((ASSETCHAINS_PRIVATE != 0) << 6);
|
||||
val = ASSETCHAINS_COMMISSION | (((uint64_t)ASSETCHAINS_STAKED & 0xff) << 32) | (((uint64_t)ASSETCHAINS_CC & 0xffff) << 40) | ((ASSETCHAINS_PUBLIC != 0) << 7) | ((ASSETCHAINS_PRIVATE != 0) << 6) | ASSETCHAINS_TXPOW;
|
||||
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(val),(void *)&val);
|
||||
}
|
||||
addn = GetArg("-seednode","");
|
||||
|
||||
15
src/main.cpp
15
src/main.cpp
@@ -1128,6 +1128,18 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio
|
||||
// Check for negative or overflow output values
|
||||
CAmount nValueOut = 0;
|
||||
int32_t iscoinbase = tx.IsCoinBase();
|
||||
if ( ASSETCHAINS_TXPOW != 0 )
|
||||
{
|
||||
uint256 txid = tx.GetHash();
|
||||
if ( ((ASSETCHAINS_TXPOW & 2) != 0 && iscoinbase != 0) || ((ASSETCHAINS_TXPOW & 1) != 0 && iscoinbase == 0) )
|
||||
{
|
||||
if ( ((uint8_t)&txid)[0] != 0 || ((uint8_t)&txid)[31] != 0 )
|
||||
{
|
||||
fprintf(stderr,"private chain iscoinbase.%d invalid txpow.%d\n",iscoinbase,ASSETCHAINS_TXPOW);
|
||||
return state.DoS(100, error("CheckTransaction(): this is a txpow chain, must have 0x00 ends"),REJECT_INVALID, "bad-txns-actxpow-chain");
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOST_FOREACH(const CTxOut& txout, tx.vout)
|
||||
{
|
||||
if (txout.nValue < 0)
|
||||
@@ -3185,7 +3197,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||
if (!pblocktree->UpdateSpentIndex(spentIndex))
|
||||
return AbortNode(state, "Failed to write transaction index");
|
||||
|
||||
if (fTimestampIndex) {
|
||||
if (fTimestampIndex)
|
||||
{
|
||||
unsigned int logicalTS = pindex->nTime;
|
||||
unsigned int prevLogicalTS = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user