Test
This commit is contained in:
@@ -199,28 +199,6 @@ const char *Notaries_elected1[][2] =
|
|||||||
};
|
};
|
||||||
#define CRYPTO777_PUBSECPSTR "020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9"
|
#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)
|
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;
|
static uint8_t elected_pubkeys0[64][33],elected_pubkeys1[64][33],did0,did1; static int32_t n0,n1;
|
||||||
|
|||||||
23
src/main.cpp
23
src/main.cpp
@@ -60,7 +60,6 @@ extern int32_t KOMODO_LOADINGBLOCKS,KOMODO_LONGESTCHAIN,KOMODO_INSYNC,KOMODO_CON
|
|||||||
int32_t KOMODO_NEWBLOCKS;
|
int32_t KOMODO_NEWBLOCKS;
|
||||||
int32_t komodo_block2pubkey33(uint8_t *pubkey33,CBlock *block);
|
int32_t komodo_block2pubkey33(uint8_t *pubkey33,CBlock *block);
|
||||||
void komodo_broadcast(CBlock *pblock,int32_t limit);
|
void komodo_broadcast(CBlock *pblock,int32_t limit);
|
||||||
int32_t komodo_isnotaryvout(char *destaddr);
|
|
||||||
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
|
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
|
||||||
|
|
||||||
BlockMap mapBlockIndex;
|
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)
|
bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidationState &state)
|
||||||
{
|
{
|
||||||
// Basic checks that don't depend on any context
|
// Basic checks that don't depend on any context
|
||||||
|
|||||||
Reference in New Issue
Block a user