This commit is contained in:
jl777
2018-09-23 05:53:54 -11:00
parent a8c6526acf
commit a2e2291e26
2 changed files with 22 additions and 23 deletions

View File

@@ -199,28 +199,6 @@ const char *Notaries_elected1[][2] =
};
#define CRYPTO777_PUBSECPSTR "020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9"
int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only
{
static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64];
int32_t i;
if ( didinit == 0 )
{
uint8_t pubkey33[33];
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
{
if ( i < sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) )
decode_hex(pubkey33,33,(char *)Notaries_elected1[i][1]);
else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
}
didinit = 1;
}
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
return(1);
return(0);
}
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp)
{
static uint8_t elected_pubkeys0[64][33],elected_pubkeys1[64][33],did0,did1; static int32_t n0,n1;

View File

@@ -60,7 +60,6 @@ extern int32_t KOMODO_LOADINGBLOCKS,KOMODO_LONGESTCHAIN,KOMODO_INSYNC,KOMODO_CON
int32_t KOMODO_NEWBLOCKS;
int32_t komodo_block2pubkey33(uint8_t *pubkey33,CBlock *block);
void komodo_broadcast(CBlock *pblock,int32_t limit);
int32_t komodo_isnotaryvout(char *destaddr);
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
BlockMap mapBlockIndex;
@@ -1043,6 +1042,28 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,
}
}
int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only
{
static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64];
int32_t i;
if ( didinit == 0 )
{
uint8_t pubkey33[33];
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
{
if ( i < sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) )
decode_hex(pubkey33,33,(char *)Notaries_elected1[i][1]);
else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
}
didinit = 1;
}
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
return(1);
return(0);
}
bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidationState &state)
{
// Basic checks that don't depend on any context