Merge remote-tracking branch 'james/dev' into cryptoconditions
This commit is contained in:
@@ -41,14 +41,14 @@ is deemed necessary and appropriate to the circumstances. Maintainers are
|
|||||||
obligated to maintain confidentiality with regard to the reporter of an
|
obligated to maintain confidentiality with regard to the reporter of an
|
||||||
incident.
|
incident.
|
||||||
|
|
||||||
You may send reports to [our Conduct email](mailto:conduct@z.cash).
|
You may send reports to [our Conduct email](mailto:developer@komodoplatform.com).
|
||||||
|
|
||||||
If you wish to contact specific maintainers directly, the following have made
|
If you wish to contact specific maintainers directly, the following have made
|
||||||
themselves available for conduct issues:
|
themselves available for conduct issues:
|
||||||
|
|
||||||
- Daira Hopwood (daira at z.cash)
|
- Benny Fairbank (benny at komodoplatform.com)
|
||||||
- Sean Bowe (sean at z.cash)
|
- Support Team (support at komodoplatform.com)
|
||||||
|
- ca333 (ca333 at komodoplatform.com)
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
version 1.3.0, available at
|
version 1.3.0, available at
|
||||||
|
|||||||
@@ -52,3 +52,4 @@ komodo_asset PIZZA 100000000
|
|||||||
komodo_asset BEER 100000000
|
komodo_asset BEER 100000000
|
||||||
komodo_asset NINJA 100000000
|
komodo_asset NINJA 100000000
|
||||||
komodo_asset OOT 216000000
|
komodo_asset OOT 216000000
|
||||||
|
komodo_asset BNTN 500000000
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ echo $pubkey
|
|||||||
./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=78.47.196.146 &
|
./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||||
./komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=78.47.196.146 &
|
./komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||||
./komodod -pubkey=$pubkey -ac_name=OOT -ac_supply=216000000 -addnode=174.138.107.226 &
|
./komodod -pubkey=$pubkey -ac_name=OOT -ac_supply=216000000 -addnode=174.138.107.226 &
|
||||||
|
./komodod -pubkey=$pubkey -ac_name=BNTN -ac_supply=500000000 -addnode=94.130.169.205 &
|
||||||
#sleep $delay
|
#sleep $delay
|
||||||
|
|
||||||
#./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 &
|
#./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 &
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dp
|
|||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VOTE2018\",\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VOTE2018\",\"pubkey\":\"$pubkey\"}"
|
||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NINJA\",\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NINJA\",\"pubkey\":\"$pubkey\"}"
|
||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"OOT\",\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"OOT\",\"pubkey\":\"$pubkey\"}"
|
||||||
|
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BNTN\",\"pubkey\":\"$pubkey\"}"
|
||||||
|
|
||||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
|
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
|
||||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}"
|
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}"
|
||||||
|
|||||||
@@ -25,3 +25,4 @@ echo beer; fiat/beer $1 $2 $3 $4
|
|||||||
echo vote2018; fiat/vote2018 $1 $2 $3 $4
|
echo vote2018; fiat/vote2018 $1 $2 $3 $4
|
||||||
echo ninja; fiat/ninja $1 $2 $3 $4
|
echo ninja; fiat/ninja $1 $2 $3 $4
|
||||||
echo oot; fiat/oot $1 $2 $3 $4
|
echo oot; fiat/oot $1 $2 $3 $4
|
||||||
|
echo bntn: fiat/bntn $1 $2 $3 $4
|
||||||
|
|||||||
2
src/fiat/bntn
Normal file
2
src/fiat/bntn
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
./komodo-cli -ac_name=BNTN $1 $2 $3 $4 $5 $6
|
||||||
11
src/komodo.h
11
src/komodo.h
@@ -573,7 +573,12 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
|
|||||||
{
|
{
|
||||||
notarized = 1;
|
notarized = 1;
|
||||||
}
|
}
|
||||||
if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height && (height < sp->CURRENT_HEIGHT-64 || komodo_verifynotarization(ASSETCHAINS_SYMBOL[0]==0?(char *)"KMD":ASSETCHAINS_SYMBOL,(char *)(ASSETCHAINS_SYMBOL[0] == 0 ? "BTC" : "KMD"),height,*notarizedheightp,kmdtxid,desttxid) == 0) )
|
int32_t validated = 1;
|
||||||
|
/*if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
|
validated = 1;
|
||||||
|
else if ( height < sp->CURRENT_HEIGHT-64 || komodo_verifynotarization((char *)"KMD",(char *)"BTC",height,*notarizedheightp,kmdtxid,desttxid) == 0 )
|
||||||
|
validated = 1;*/
|
||||||
|
if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height && validated != 0 )
|
||||||
{
|
{
|
||||||
int32_t nameoffset = (int32_t)strlen(ASSETCHAINS_SYMBOL) + 1;
|
int32_t nameoffset = (int32_t)strlen(ASSETCHAINS_SYMBOL) + 1;
|
||||||
sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
||||||
@@ -623,8 +628,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
|
|||||||
komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen-len+4+3+(scriptbuf[1] == 0x4d),j,zero,0);
|
komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen-len+4+3+(scriptbuf[1] == 0x4d),j,zero,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ( height >= sp->CURRENT_HEIGHT-64 )//KOMODO_MAINNET_START )
|
} else //if ( height >= sp->CURRENT_HEIGHT-64 )//KOMODO_MAINNET_START )
|
||||||
printf("notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s (%s) len.%d opretlen.%d\n",notarized,(long long)signedmask,height,*notarizedheightp,sp->NOTARIZED_HEIGHT,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,kmdtxid.ToString().c_str(),desttxid.ToString().c_str(),(char *)&scriptbuf[len],len,opretlen);
|
printf("validated.%d notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s (%s) len.%d opretlen.%d\n",validated,notarized,(long long)signedmask,height,*notarizedheightp,sp->NOTARIZED_HEIGHT,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,kmdtxid.ToString().c_str(),desttxid.ToString().c_str(),(char *)&scriptbuf[len],len,opretlen);
|
||||||
}
|
}
|
||||||
else if ( i == 0 && j == 1 && opretlen == 149 )
|
else if ( i == 0 && j == 1 && opretlen == 149 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -902,8 +902,8 @@ int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 has
|
|||||||
}
|
}
|
||||||
} else fprintf(stderr,"[%s] unexpected error notary_hash %s ht.%d at ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,notary->nHeight);
|
} else fprintf(stderr,"[%s] unexpected error notary_hash %s ht.%d at ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,notary->nHeight);
|
||||||
}
|
}
|
||||||
else if ( notarized_height > 0 && notarized_height != 73880 && notarized_height >= 170000 )
|
//else if ( notarized_height > 0 && notarized_height != 73880 && notarized_height >= 170000 )
|
||||||
fprintf(stderr,"[%s] couldnt find notarized.(%s %d) ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,pindex->nHeight);
|
// fprintf(stderr,"[%s] couldnt find notarized.(%s %d) ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,pindex->nHeight);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -684,7 +684,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
}
|
}
|
||||||
n = block.vtx[0].vout.size();
|
n = block.vtx[0].vout.size();
|
||||||
script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data();
|
script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data();
|
||||||
if ( n <= 2 || script[0] != 0x6a )
|
//if ( n <= 2 || script[0] != 0x6a )
|
||||||
{
|
{
|
||||||
int64_t val,prevtotal = 0; int32_t overflow = 0;
|
int64_t val,prevtotal = 0; int32_t overflow = 0;
|
||||||
total = 0;
|
total = 0;
|
||||||
@@ -711,6 +711,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
if ( height >= activation )
|
if ( height >= activation )
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
else if ( block.nBits == KOMODO_MINDIFF_NBITS && total > 0 ) // to deal with fee stealing
|
||||||
|
{
|
||||||
|
fprintf(stderr,"notary mined ht.%d with extra %.8f\n",height,dstr(total));
|
||||||
|
if ( height > KOMODO_NOTARIES_HEIGHT1 )
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -719,7 +725,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_COMMISSION != 0 )
|
/*if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_COMMISSION != 0 )
|
||||||
{
|
{
|
||||||
script = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data();
|
script = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data();
|
||||||
if ( script[0] != 33 || script[34] != OP_CHECKSIG || memcmp(script+1,ASSETCHAINS_OVERRIDE_PUBKEY33,33) != 0 )
|
if ( script[0] != 33 || script[34] != OP_CHECKSIG || memcmp(script+1,ASSETCHAINS_OVERRIDE_PUBKEY33,33) != 0 )
|
||||||
@@ -1007,16 +1013,16 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
}
|
}
|
||||||
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||||
{
|
{
|
||||||
/*if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num )
|
//if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num )
|
||||||
{
|
//{
|
||||||
printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht));
|
// printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht));
|
||||||
// can easily happen depending on order of loading
|
// can easily happen depending on order of loading
|
||||||
if ( height > 200000 )
|
//if ( height > 200000 )
|
||||||
{
|
//{
|
||||||
printf("REJECT: ht.%d (%c) matched.%d vs num.%d\n",height,opcode,matched,num);
|
// printf("REJECT: ht.%d (%c) matched.%d vs num.%d\n",height,opcode,matched,num);
|
||||||
return(-1);
|
// return(-1);
|
||||||
}
|
//}
|
||||||
}*/ // disabled 'X' path
|
//} // disabled 'X' path
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1045,7 +1051,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
printf("not proper vout with opreturn format %s ht.%d cmp.%d %d\n",ASSETCHAINS_SYMBOL,height,script[offset] == opcode,(int32_t)block.vtx[0].vout[n-1].scriptPubKey.size());
|
printf("not proper vout with opreturn format %s ht.%d cmp.%d %d\n",ASSETCHAINS_SYMBOL,height,script[offset] == opcode,(int32_t)block.vtx[0].vout[n-1].scriptPubKey.size());
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int32_t opretlen,uint256 txid,uint16_t vout,char *source)
|
const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int32_t opretlen,uint256 txid,uint16_t vout,char *source)
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
|||||||
memcpy(ptr->key,key,keylen);
|
memcpy(ptr->key,key,keylen);
|
||||||
newflag = 1;
|
newflag = 1;
|
||||||
HASH_ADD_KEYPTR(hh,KOMODO_KV,ptr->key,ptr->keylen,ptr);
|
HASH_ADD_KEYPTR(hh,KOMODO_KV,ptr->key,ptr->keylen,ptr);
|
||||||
//printf("KV add.(%s) (%s)\n",ptr->key,valueptr);
|
printf("KV add.(%s) (%s)\n",ptr->key,valueptr);
|
||||||
}
|
}
|
||||||
if ( newflag != 0 || (ptr->flags & KOMODO_KVPROTECTED) == 0 )
|
if ( newflag != 0 || (ptr->flags & KOMODO_KVPROTECTED) == 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ const char *Notaries_elected0[][2] =
|
|||||||
|
|
||||||
const char *Notaries_elected1[][2] =
|
const char *Notaries_elected1[][2] =
|
||||||
{
|
{
|
||||||
{ "0_jl777_testB", "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" },
|
|
||||||
{ "0_jl777_testA", "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" },
|
{ "0_jl777_testA", "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" },
|
||||||
|
{ "0_jl777_testB", "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" },
|
||||||
{ "0_kolo_testA", "0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" },
|
{ "0_kolo_testA", "0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" },
|
||||||
{ "artik_AR", "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" },
|
{ "artik_AR", "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" },
|
||||||
{ "artik_EU", "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" },
|
{ "artik_EU", "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" },
|
||||||
@@ -205,7 +205,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam
|
|||||||
timestamp = komodo_heightstamp(height);
|
timestamp = komodo_heightstamp(height);
|
||||||
if ( height >= KOMODO_NOTARIES_HARDCODED || ASSETCHAINS_SYMBOL[0] != 0 )
|
if ( height >= KOMODO_NOTARIES_HARDCODED || ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
{
|
{
|
||||||
if ( (timestamp != 0 && timestamp <= KOMODO_NOTARIES_TIMESTAMP1) || height <= KOMODO_NOTARIES_HEIGHT1 )
|
if ( (timestamp != 0 && timestamp <= KOMODO_NOTARIES_TIMESTAMP1) || (ASSETCHAINS_SYMBOL[0] == 0 && height <= KOMODO_NOTARIES_HEIGHT1) )
|
||||||
{
|
{
|
||||||
if ( did0 == 0 )
|
if ( did0 == 0 )
|
||||||
{
|
{
|
||||||
@@ -239,7 +239,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam
|
|||||||
if ( Pubkeys == 0 )
|
if ( Pubkeys == 0 )
|
||||||
{
|
{
|
||||||
komodo_init(height);
|
komodo_init(height);
|
||||||
printf("Pubkeys.%p htind.%d vs max.%d\n",Pubkeys,htind,KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP);
|
//printf("Pubkeys.%p htind.%d vs max.%d\n",Pubkeys,htind,KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP);
|
||||||
}
|
}
|
||||||
pthread_mutex_lock(&komodo_mutex);
|
pthread_mutex_lock(&komodo_mutex);
|
||||||
n = Pubkeys[htind].numnotaries;
|
n = Pubkeys[htind].numnotaries;
|
||||||
@@ -378,29 +378,6 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33,
|
|||||||
return(modval);
|
return(modval);
|
||||||
}
|
}
|
||||||
|
|
||||||
void komodo_notarized_update(struct komodo_state *sp,int32_t nHeight,int32_t notarized_height,uint256 notarized_hash,uint256 notarized_desttxid,uint256 MoM,int32_t MoMdepth)
|
|
||||||
{
|
|
||||||
struct notarized_checkpoint *np;
|
|
||||||
if ( notarized_height > nHeight )
|
|
||||||
{
|
|
||||||
printf("komodo_notarized_update REJECT notarized_height %d > %d nHeight\n",notarized_height,nHeight);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
|
|
||||||
printf("[%s] komodo_notarized_update nHeight.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,nHeight,notarized_height);
|
|
||||||
portable_mutex_lock(&komodo_mutex);
|
|
||||||
sp->NPOINTS = (struct notarized_checkpoint *)realloc(sp->NPOINTS,(sp->NUM_NPOINTS+1) * sizeof(*sp->NPOINTS));
|
|
||||||
np = &sp->NPOINTS[sp->NUM_NPOINTS++];
|
|
||||||
memset(np,0,sizeof(*np));
|
|
||||||
np->nHeight = nHeight;
|
|
||||||
sp->NOTARIZED_HEIGHT = np->notarized_height = notarized_height;
|
|
||||||
sp->NOTARIZED_HASH = np->notarized_hash = notarized_hash;
|
|
||||||
sp->NOTARIZED_DESTTXID = np->notarized_desttxid = notarized_desttxid;
|
|
||||||
sp->MoM = np->MoM = MoM;
|
|
||||||
sp->MoMdepth = np->MoMdepth = MoMdepth;
|
|
||||||
portable_mutex_unlock(&komodo_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
//struct komodo_state *komodo_stateptr(char *symbol,char *dest);
|
//struct komodo_state *komodo_stateptr(char *symbol,char *dest);
|
||||||
int32_t komodo_notarized_height(uint256 *hashp,uint256 *txidp)
|
int32_t komodo_notarized_height(uint256 *hashp,uint256 *txidp)
|
||||||
{
|
{
|
||||||
@@ -500,6 +477,29 @@ int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *n
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void komodo_notarized_update(struct komodo_state *sp,int32_t nHeight,int32_t notarized_height,uint256 notarized_hash,uint256 notarized_desttxid,uint256 MoM,int32_t MoMdepth)
|
||||||
|
{
|
||||||
|
struct notarized_checkpoint *np;
|
||||||
|
if ( notarized_height >= nHeight )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"komodo_notarized_update REJECT notarized_height %d > %d nHeight\n",notarized_height,nHeight);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
|
fprintf(stderr,"[%s] komodo_notarized_update nHeight.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,nHeight,notarized_height);
|
||||||
|
portable_mutex_lock(&komodo_mutex);
|
||||||
|
sp->NPOINTS = (struct notarized_checkpoint *)realloc(sp->NPOINTS,(sp->NUM_NPOINTS+1) * sizeof(*sp->NPOINTS));
|
||||||
|
np = &sp->NPOINTS[sp->NUM_NPOINTS++];
|
||||||
|
memset(np,0,sizeof(*np));
|
||||||
|
np->nHeight = nHeight;
|
||||||
|
sp->NOTARIZED_HEIGHT = np->notarized_height = notarized_height;
|
||||||
|
sp->NOTARIZED_HASH = np->notarized_hash = notarized_hash;
|
||||||
|
sp->NOTARIZED_DESTTXID = np->notarized_desttxid = notarized_desttxid;
|
||||||
|
sp->MoM = np->MoM = MoM;
|
||||||
|
sp->MoMdepth = np->MoMdepth = MoMdepth;
|
||||||
|
portable_mutex_unlock(&komodo_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
void komodo_init(int32_t height)
|
void komodo_init(int32_t height)
|
||||||
{
|
{
|
||||||
static int didinit; uint256 zero; int32_t k,n; uint8_t pubkeys[64][33];
|
static int didinit; uint256 zero; int32_t k,n; uint8_t pubkeys[64][33];
|
||||||
|
|||||||
@@ -1365,7 +1365,7 @@ void komodo_configfile(char *symbol,uint16_t port)
|
|||||||
#ifndef FROM_CLI
|
#ifndef FROM_CLI
|
||||||
if ( (fp= fopen(fname,"wb")) != 0 )
|
if ( (fp= fopen(fname,"wb")) != 0 )
|
||||||
{
|
{
|
||||||
fprintf(fp,"rpcuser=user%u\nrpcpassword=pass%s\nrpcport=%u\nserver=1\ntxindex=1\nrpcworkqueue=64\n",crc,password,port);
|
fprintf(fp,"rpcuser=user%u\nrpcpassword=pass%s\nrpcport=%u\nserver=1\ntxindex=1\nrpcworkqueue=64\nrpcallowip=127.0.0.1\n",crc,password,port);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
printf("Created (%s)\n",fname);
|
printf("Created (%s)\n",fname);
|
||||||
} else printf("Couldnt create (%s)\n",fname);
|
} else printf("Couldnt create (%s)\n",fname);
|
||||||
|
|||||||
14
src/main.cpp
14
src/main.cpp
@@ -2584,14 +2584,18 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
int64_t nTime1 = GetTimeMicros(); nTimeConnect += nTime1 - nTimeStart;
|
int64_t nTime1 = GetTimeMicros(); nTimeConnect += nTime1 - nTimeStart;
|
||||||
LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime1 - nTimeStart), 0.001 * (nTime1 - nTimeStart) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime1 - nTimeStart) / (nInputs-1), nTimeConnect * 0.000001);
|
LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime1 - nTimeStart), 0.001 * (nTime1 - nTimeStart) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime1 - nTimeStart) / (nInputs-1), nTimeConnect * 0.000001);
|
||||||
|
|
||||||
CAmount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, chainparams.GetConsensus());
|
CAmount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, chainparams.GetConsensus()) + sum;
|
||||||
if (block.vtx[0].vout[0].nValue > blockReward)
|
if ( block.vtx[0].GetValueOut() > blockReward+1 )
|
||||||
//if (block.vtx[0].GetValueOut() > blockReward)
|
{
|
||||||
return state.DoS(100,
|
if ( pindex->nHeight >= KOMODO_NOTARIES_HEIGHT1 || block.vtx[0].vout[0].nValue > blockReward )
|
||||||
|
{
|
||||||
|
return state.DoS(100,
|
||||||
error("ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)",
|
error("ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)",
|
||||||
block.vtx[0].GetValueOut(), blockReward),
|
block.vtx[0].GetValueOut(), blockReward),
|
||||||
REJECT_INVALID, "bad-cb-amount");
|
REJECT_INVALID, "bad-cb-amount");
|
||||||
|
} else if ( NOTARY_PUBKEY33[0] != 0 )
|
||||||
|
fprintf(stderr,"allow nHeight.%d coinbase %.8f vs %.8f interest %.8f\n",(int32_t)pindex->nHeight,dstr(block.vtx[0].GetValueOut()),dstr(blockReward),dstr(sum));
|
||||||
|
}
|
||||||
if (!control.Wait())
|
if (!control.Wait())
|
||||||
return state.DoS(100, false);
|
return state.DoS(100, false);
|
||||||
int64_t nTime2 = GetTimeMicros(); nTimeVerify += nTime2 - nTimeStart;
|
int64_t nTime2 = GetTimeMicros(); nTimeVerify += nTime2 - nTimeStart;
|
||||||
|
|||||||
Reference in New Issue
Block a user