Merge branch 'FSM' into jl777

This commit is contained in:
jl777
2019-02-27 04:31:26 -11:00
15 changed files with 115 additions and 26 deletions

2
src/ac/iln Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=ILN $1 $2 $3 $4 $5 $6

2
src/ac/our Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=OUR $1 $2 $3 $4 $5 $6

View File

@@ -238,7 +238,13 @@
"addnode": [
"51.255.195.65",
"217.182.129.38",
"95.216.150.177"
]
}
"37.187.225.231"
]
},
{
"ac_name": "ILN",
"ac_supply": "10000000000",
"ac_cc": "2",
"addnode": ["51.75.122.83"]
}
]

View File

@@ -46,3 +46,5 @@ echo $pubkey
./komodod -pubkey=$pubkey -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 &
./komodod -pubkey=$pubkey -ac_name=ZEX -ac_cc=2 -ac_founders=1 -ac_halving=525600 -ac_reward=13000000000 -ac_pubkey=039d4a50cc70d1184e462a22edb3b66385da97cc8059196f8305c184a3e21440af -addnode=5.9.102.210 &
./komodod -pubkey=$pubkey -ac_name=KSB -ac_supply=1000000000 -ac_end=1 -ac_public=1 -addnode=37.187.225.231 &
./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 &
./komodod -pubkey=$pubkey -ac_name=ILN -ac_supply=10000000000 -ac_cc=2 -addnode=51.75.122.83 &

View File

@@ -146,6 +146,13 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
numvouts = tx.vout.size();
outputsDummy = inputs = 0;
preventCCvins = preventCCvouts = -1;
// add specific chains exceptions for old token support:
if (strcmp(ASSETCHAINS_SYMBOL, "SEC") == 0 && chainActive.Height() <= 144073)
return true;
if (strcmp(ASSETCHAINS_SYMBOL, "MGNX") == 0 && chainActive.Height() <= 210190)
return true;
// add specific chains exceptions for old token support:
if (strcmp(ASSETCHAINS_SYMBOL, "SEC") == 0 && chainActive.Height() <= 144073)

View File

@@ -956,7 +956,7 @@ std::string GatewaysBind(uint64_t txfee,std::string coin,uint256 tokenid,int64_t
prefix2 = p2;
wiftype = p3;
taddr = p4;
LogPrint("gatewayscc-1","set prefix %d, prefix2 %d, wiftype %d for %s\n",prefix,prefix2,wiftype,coin.c_str());
LogPrint("gatewayscc-1","set prefix %d, prefix2 %d, wiftype %d, taddr %d for %s\n",prefix,prefix2,wiftype,taddr,coin.c_str());
}
if ( N == 0 || N > 15 || M > N )
{

2
src/fiat/iln Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=ILN $1 $2 $3 $4 $5 $6

2
src/fiat/our Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=OUR $1 $2 $3 $4 $5 $6

View File

@@ -630,6 +630,9 @@ int32_t komodo_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notar
if ( matched != 0 )
validated = komodo_validate_chain(srchash,*notarizedheightp);
else validated = 1;
// Any notarization that is matched and has a decodable op_return is enough to pay notaries. Otherwise bugs!
if ( fJustCheck && matched != 0 )
return(-2);
if ( notarized != 0 && validated != 0 )
{
//sp->NOTARIZED_HEIGHT = *notarizedheightp;
@@ -697,10 +700,6 @@ int32_t komodo_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notar
else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
komodo_rwccdata((char *)"KMD",1,&ccdata,0);
// Because of reorgs its not possible to use notarizations that are in order. If its validated pay the notaries!
if ( fJustCheck )
return(-2);
if ( matched != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height )
{
sp->NOTARIZED_HEIGHT = *notarizedheightp;

View File

@@ -154,6 +154,7 @@ CScript Marmara_scriptPubKey(int32_t height,CPubKey pk);
CScript MarmaraCoinbaseOpret(uint8_t funcid,int32_t height,CPubKey pk);
uint64_t komodo_notarypay(CMutableTransaction &txNew, std::vector<int8_t> &NotarisationNotaries, uint32_t timestamp, int32_t height, uint8_t *script, int32_t len);
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
int32_t komodo_getnotarizedheight(uint32_t timestamp,int32_t height, uint8_t *script, int32_t len);
CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32_t gpucount, bool isStake)
{
@@ -403,11 +404,15 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
// Any attempted notarization needs to be in its own block!
continue;
}
// this is the first one we see, add it to the block as TX1
NotarisationNotaries = TMP_NotarisationNotaries;
dPriority = 1e16;
fNotarisationBlock = true;
fprintf(stderr, "Notarisation %s set to maximum priority\n",hash.ToString().c_str());
int32_t notarizedheight = komodo_getnotarizedheight(pblock->nTime, nHeight, script, scriptlen);
if ( notarizedheight != 0 )
{
// this is the first one we see, add it to the block as TX1
NotarisationNotaries = TMP_NotarisationNotaries;
dPriority = 1e16;
fNotarisationBlock = true;
fprintf(stderr, "Notarisation %s set to maximum priority\n",hash.ToString().c_str());
}
}
}
}

View File

@@ -6349,7 +6349,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp)
UniValue result(UniValue::VOBJ); uint256 tokenid,oracletxid; int32_t i; int64_t totalsupply; std::vector<CPubKey> pubkeys;
uint8_t M,N,p1,p2,p3,p4=0; std::string hex,coin; std::vector<unsigned char> pubkey;
if ( fHelp || params.size() < 9 )
if ( fHelp || params.size() < 10 )
throw runtime_error("gatewaysbind tokenid oracletxid coin tokensupply M N pubkey(s) pubtype p2shtype wiftype [taddr]\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
@@ -6363,10 +6363,10 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp)
N = atoi((char *)params[5].get_str().c_str());
if ( M > N || N == 0 || N > 15 || totalsupply < COIN/100 || tokenid == zeroid )
throw runtime_error("illegal M or N > 15 or tokensupply or invalid tokenid\n");
if ( params.size() < 6+N+3 )
throw runtime_error("not enough parameters for N pubkeys\n");
for (i=0; i<N; i++)
{
if ( params.size() < 6+i+1 )
throw runtime_error("not enough parameters for N pubkeys\n");
{
pubkey = ParseHex(params[6+i].get_str().c_str());
if (pubkey.size()!= 33)
throw runtime_error("invalid destination pubkey");
@@ -6375,7 +6375,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp)
p1 = atoi((char *)params[6+N].get_str().c_str());
p2 = atoi((char *)params[6+N+1].get_str().c_str());
p3 = atoi((char *)params[6+N+2].get_str().c_str());
if (params.size() == 9+N) p4 = atoi((char *)params[6+N+3].get_str().c_str());
if (params.size() == 9+N+1) p4 = atoi((char *)params[9+N].get_str().c_str());
hex = GatewaysBind(0,coin,tokenid,totalsupply,oracletxid,M,N,pubkeys,p1,p2,p3,p4);
RETURN_IF_ERROR(CCerror);
if ( hex.size() > 0 )