Merge branch 'master' into blackjok3r

hope its fixed
This commit is contained in:
blackjok3r
2018-09-26 14:58:23 +08:00
7 changed files with 108 additions and 192 deletions

View File

@@ -1,149 +1,66 @@
[
{
"ac_name": "REVS",
"ac_supply": "1300000"
},
{
"ac_name": "SUPERNET",
"ac_supply": "816061"
},
{
"ac_name": "DEX",
"ac_supply": "999999"
},
{
"ac_name": "PANGEA",
"ac_supply": "999999"
},
{
"ac_name": "JUMBLR",
"ac_supply": "999999"
},
{
"ac_name": "BET",
"ac_supply": "999999"
},
{
"ac_name": "CRYPTO",
"ac_supply": "999999"
},
{
"ac_name": "HODL",
"ac_supply": "9999999"
},
{
"ac_name": "MSHARK",
"ac_supply": "1400000"
},
{
"ac_name": "BOTS",
"ac_supply": "999999"
},
{
"ac_name": "MGW",
"ac_supply": "999999"
},
{
"ac_name": "COQUI",
"ac_supply": "72000000",
"ac_ccactivate": "200000"
},
{
"ac_name": "WLC",
"ac_supply": "210000000"
},
{
"ac_name": "KV",
"ac_supply": "1000000"
},
{
"ac_name": "CEAL",
"ac_supply": "366666666"
},
{
"ac_name": "MESH",
"ac_supply": "1000007"
},
{
"ac_name": "MNZ",
"ac_supply": "257142858"
},
{
"ac_name": "AXO",
"ac_supply": "200000000"
},
{
"ac_name": "ETOMIC",
"ac_supply": "100000000"
},
{
"ac_name": "BTCH",
"ac_supply": "20998641"
},
{
"ac_name": "PIZZA",
"ac_supply": "100000000"
},
{
"ac_name": "BEER",
"ac_supply": "100000000"
},
{
"ac_name": "NINJA",
"ac_supply": "100000000"
},
{
"ac_name": "OOT",
"ac_supply": "216000000"
},
{
"ac_name": "BNTN",
"ac_supply": "500000000"
},
{
"ac_name": "CHAIN",
"ac_supply": "999999"
},
{
"ac_name": "PRLPAY",
"ac_supply": "500000000"
},
{
"ac_name": "DSEC",
"ac_supply": "7000000"
},
{
"ac_name": "GLXT",
"ac_supply": "10000000000"
},
{
"ac_name": "EQL",
"ac_supply": "500000000"
},
{
"ac_name": "ZILLA",
"ac_supply": "11000000"
},
{
"ac_name": "RFOX",
"ac_supply": "1000000000",
"ac_reward": "100000000"
},
{
"ac_name": "SEC",
"ac_supply": "1000000000",
"ac_cc": "333"
},
{
"ac_name": "CCL",
"ac_supply": "200000000",
"ac_end": "1",
"ac_cc": "2",
"addressindex": "1",
"spentindex": "1",
"ac_name": "STAKEDB1",
"ac_supply": "100000",
"ac_reward" : "1000000000",
"ac_cc": "667",
"addnode": [
"142.93.136.89",
"195.201.22.89"
"195.201.137.5",
"195.201.20.230"
]
}
},
{
"ac_name": "STAKEDW1",
"ac_supply": "100000",
"ac_reward" : "1000000000",
"ac_cc": "667",
"addnode": [
"195.201.137.5",
"195.201.20.230"
]
},
{
"ac_name": "STAKEDPERC",
"ac_supply": "1000000",
"ac_reward" : "1000000000",
"ac_cc": "667",
"ac_perc": "10000000",
"ac_pubkey": "03bd221868abc063b54a3fceafb9898b1931ed767298a17ac0c9923500a7c60e4b",
"addnode": [
"195.201.137.5",
"195.201.20.230"
]
},
{
"ac_name": "STAKEDS1",
"ac_supply": "1000000",
"ac_reward" : "1000000000",
"ac_cc": "667",
"ac_staked": "10",
"addnode": [
"195.201.137.5",
"195.201.20.230"
]
},
{
"ac_name": "STAKEDS9",
"ac_supply": "1000000",
"ac_reward" : "1000000000",
"ac_cc": "667",
"ac_staked": "90",
"addnode": [
"195.201.137.5",
"195.201.20.230"
]
},
{
"ac_name": "STAKEDED",
"ac_supply": "1072452",
"ac_reward" : "1000000000",
"ac_cc": "667",
"addnode": [
"195.201.137.5",
"195.201.20.230"
]
}
]

View File

@@ -13,8 +13,6 @@ typedef struct CrosschainAuthority {
size_t requiredSigs;
} CrosschainAuthority;
extern const CrosschainAuthority auth_STAKED;
int GetSymbolAuthority(const char* symbol);
bool CheckTxAuthority(const CTransaction &tx, CrosschainAuthority auth);

View File

@@ -8,10 +8,10 @@ int GetSymbolAuthority(const char* symbol)
if (strncmp(symbol, "TXSCL", 5) == 0)
return CROSSCHAIN_TXSCL;
if (is_STAKED(symbol) != 0) {
printf("RETURNED CROSSCHAIN STAKED AS TRUE\n");
//printf("RETURNED CROSSCHAIN STAKED AS TRUE\n");
return CROSSCHAIN_STAKED;
}
printf("RETURNED CROSSCHAIN KOMODO AS TRUE\n");
//printf("RETURNED CROSSCHAIN KOMODO AS TRUE\n");
return CROSSCHAIN_KOMODO;
}
@@ -53,6 +53,7 @@ bool CheckTxAuthority(const CTransaction &tx, CrosschainAuthority auth)
return true;
}
/*
const CrosschainAuthority auth_STAKED = [&](){
CrosschainAuthority auth;

View File

@@ -859,9 +859,9 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
} else printf("cant get scriptPubKey for ht.%d txi.%d vin.%d\n",height,i,j);
}
numvalid = bitweight(signedmask);
if (((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) ||
if ( ((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) ||
(numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) ||
numvalid > (numnotaries/5))
numvalid > (numnotaries/5) )
{
if ( ASSETCHAINS_SYMBOL[0] != 0)
{

View File

@@ -1,5 +1,6 @@
#include "notaries_staked.h"
#include "crosschain.h"
#include <cstring>
// Era 1 set of pubkeys
@@ -118,6 +119,35 @@ int STAKED_era(int timestamp)
era = 4;
else
era = 0;
// if we are in a gap, return era 0, so any notarizations submitted are invalid.
// if we are in a gap, return era 0, this allows to invalidate notarizations when in GAP.
return(era);
}
};
CrosschainAuthority Choose_auth_STAKED(int chosen_era) {
CrosschainAuthority auth;
switch (chosen_era) {
case 1:
auth = auth_STAKED_chosen(notaries_STAKED1,num_notaries_STAKED1);
break;
case 2:
auth = auth_STAKED_chosen(notaries_STAKED2,num_notaries_STAKED2);
break;
case 3:
auth = auth_STAKED_chosen(notaries_STAKED3,num_notaries_STAKED3);
break;
case 4:
auth = auth_STAKED_chosen(notaries_STAKED4,num_notaries_STAKED4);
break;
}
return(auth);
};
CrosschainAuthority auth_STAKED_chosen(const char *notaries_chosen[][2],int num_notaries) {
CrosschainAuthority auth;
auth.requiredSigs = (num_notaries / 5);
auth.size = num_notaries;
for (int n=0; n<auth.size; n++)
for (size_t i=0; i<33; i++)
sscanf(notaries_chosen[n][1]+(i*2), "%2hhx", auth.notaries[n]+i);
return auth;
};

View File

@@ -6,10 +6,10 @@
static const int STAKED_ERA_GAP = 777;
static const int STAKED_NOTARIES_TIMESTAMP1 = 1537871673;
static const int STAKED_NOTARIES_TIMESTAMP2 = 1537875273;
static const int STAKED_NOTARIES_TIMESTAMP3 = 1537878873;
static const int STAKED_NOTARIES_TIMESTAMP4 = 1537895873;
static const int STAKED_NOTARIES_TIMESTAMP1 = 1537876325;
static const int STAKED_NOTARIES_TIMESTAMP2 = 1537983525;
static const int STAKED_NOTARIES_TIMESTAMP3 = 1538083525;
static const int STAKED_NOTARIES_TIMESTAMP4 = 1548083525;
extern const char *notaries_STAKED1[][2];
extern int num_notaries_STAKED1;

View File

@@ -31,54 +31,24 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
if (strlen(data.symbol) == 0)
continue;
printf("Checked notarisation data for %s \n",data.symbol);
//printf("Checked notarisation data for %s \n",data.symbol);
int authority = GetSymbolAuthority(data.symbol);
if (authority == CROSSCHAIN_KOMODO) {
if (!eval->CheckNotaryInputs(tx, nHeight, block.nTime))
continue;
printf("Authorised notarisation data for %s \n",data.symbol);
//printf("Authorised notarisation data for %s \n",data.symbol);
} else if (authority == CROSSCHAIN_STAKED) {
// We need to create auth_STAKED dynamically here based on timestamp
int staked_era = STAKED_era(timestamp);
printf("ERA.(%d) \n",staked_era);
if (staked_era == 0)
{
if (staked_era == 0) {
// this is an ERA GAP, so we will ignore this notarization
printf("Notarization for %s occured inside an ERA GAP, we will ignore it! \n",data.symbol);
continue;
} else if (staked_era == 1)
{
// era 1
auth_STAKED.requiredSigs = (num_notaries_STAKED1 / 5);
auth_STAKED.size = num_notaries_STAKED1;
for (int n=0; n<auth_STAKED.size; n++)
for (size_t i=0; i<33; i++)
sscanf(notaries_STAKED1[n][1]+(i*2), "%2hhx", auth_STAKED.notaries[n]+i);
} else if (staked_era == 2)
{
// era 2
auth_STAKED.requiredSigs = (num_notaries_STAKED2 / 5);
auth_STAKED.size = num_notaries_STAKED2;
for (int n=0; n<auth_STAKED.size; n++)
for (size_t i=0; i<33; i++)
sscanf(notaries_STAKED2[n][1]+(i*2), "%2hhx", auth_STAKED.notaries[n]+i);
} else if (staked_era == 3)
{
// era 3
auth_STAKED.requiredSigs = (num_notaries_STAKED3 / 5);
auth_STAKED.size = num_notaries_STAKED3;
for (int n=0; n<auth_STAKED.size; n++)
for (size_t i=0; i<33; i++)
sscanf(notaries_STAKED3[n][1]+(i*2), "%2hhx", auth_STAKED.notaries[n]+i);
} else if (staked_era == 4)
{
// era 4
auth_STAKED.requiredSigs = (num_notaries_STAKED4 / 5);
auth_STAKED.size = num_notaries_STAKED4;
for (int n=0; n<auth_STAKED.size; n++)
for (size_t i=0; i<33; i++)
sscanf(notaries_STAKED4[n][1]+(i*2), "%2hhx", auth_STAKED.notaries[n]+i);
} else {
// pass era slection off to notaries_staked.cpp file
auth_STAKED = Choose_auth_STAKED(staked_era);
}
if (!CheckTxAuthority(tx, auth_STAKED))
continue;