Test
This commit is contained in:
@@ -137,12 +137,17 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height)
|
|||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (i=0; i<sizeof(Notaries_genesis)/sizeof(*Notaries_genesis); i++)
|
||||||
|
{
|
||||||
|
if ( strcmp(pubkeystr,(char *)Notaries_genesis[i][1]) == 0 )
|
||||||
|
{
|
||||||
|
//printf("i.%d -> elected %s\n",i,(char *)Notaries_elected[i][1]);
|
||||||
|
return(i+64);
|
||||||
|
}
|
||||||
|
}
|
||||||
decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974");
|
decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974");
|
||||||
if ( memcmp(pubkey33,legacy33,33) == 0 )
|
if ( memcmp(pubkey33,legacy33,33) == 0 )
|
||||||
return(64);
|
return(128);
|
||||||
decode_hex(legacy33,33,(char *)"03517fcac101fed480ae4f2caf775560065957930d8c1facc83e30077e45bdd199");
|
|
||||||
if ( memcmp(pubkey33,legacy33,33) == 0 )
|
|
||||||
return(65);
|
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ Value kvsearch(const Array& params, bool fHelp)
|
|||||||
|
|
||||||
Value minerids(const Array& params, bool fHelp)
|
Value minerids(const Array& params, bool fHelp)
|
||||||
{
|
{
|
||||||
Object ret; Array a; uint8_t minerids[2000],pubkeys[65][33]; int32_t i,j,n,numnotaries,tally[66];
|
Object ret; Array a; uint8_t minerids[2000],pubkeys[65][33]; int32_t i,j,n,numnotaries,tally[129];
|
||||||
if ( fHelp || params.size() != 1 )
|
if ( fHelp || params.size() != 1 )
|
||||||
throw runtime_error("minerids needs height\n");
|
throw runtime_error("minerids needs height\n");
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
@@ -463,7 +463,7 @@ Value minerids(const Array& params, bool fHelp)
|
|||||||
for (i=0; i<n; i++)
|
for (i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
if ( minerids[i] >= numnotaries )
|
if ( minerids[i] >= numnotaries )
|
||||||
tally[64]++;
|
tally[128]++;
|
||||||
else tally[minerids[i]]++;
|
else tally[minerids[i]]++;
|
||||||
}
|
}
|
||||||
for (i=0; i<64; i++)
|
for (i=0; i<64; i++)
|
||||||
@@ -488,7 +488,7 @@ Value minerids(const Array& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
Object item;
|
Object item;
|
||||||
item.push_back(Pair("pubkey", (char *)"external miners"));
|
item.push_back(Pair("pubkey", (char *)"external miners"));
|
||||||
item.push_back(Pair("blocks", tally[64]));
|
item.push_back(Pair("blocks", tally[128]));
|
||||||
a.push_back(item);
|
a.push_back(item);
|
||||||
}
|
}
|
||||||
ret.push_back(Pair("mined", a));
|
ret.push_back(Pair("mined", a));
|
||||||
|
|||||||
Reference in New Issue
Block a user