try
This commit is contained in:
@@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
FinalizeCCTx is a very useful function that will properly sign both CC and normal inputs, adds normal change and the opreturn.
|
FinalizeCCTx is a very useful function that will properly sign both CC and normal inputs, adds normal change and the opreturn.
|
||||||
|
|
||||||
This allows the contract transaction functions to create the appropriate vins and vouts and have FinalizeCCTx create a properly signed transaction.
|
This allows the contract transaction functions to create the appropriate vins and vouts and have FinalizeCCTx create a properly signed transaction.
|
||||||
|
|
||||||
By using -addressindex=1, it allows tracking of all the CC addresses
|
By using -addressindex=1, it allows tracking of all the CC addresses
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const CScript scriptPubKey)
|
bool SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const CScript scriptPubKey)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
@@ -274,8 +274,18 @@ int32_t CC_vinselect(int32_t *aboveip,int64_t *abovep,int32_t *belowip,int64_t *
|
|||||||
{
|
{
|
||||||
int32_t i,abovei,belowi; int64_t above,below,gap,atx_value;
|
int32_t i,abovei,belowi; int64_t above,below,gap,atx_value;
|
||||||
abovei = belowi = -1;
|
abovei = belowi = -1;
|
||||||
|
int loops = 0;
|
||||||
|
int numtxs = numunspents/2;
|
||||||
|
int startfrom = rand()%numtxs;
|
||||||
for (above=below=i=0; i<numunspents; i++)
|
for (above=below=i=0; i<numunspents; i++)
|
||||||
{
|
{
|
||||||
|
loops++;
|
||||||
|
if ( numunspents > 300 ) {
|
||||||
|
if ( loops < startfrom )
|
||||||
|
continue;
|
||||||
|
if ( (rand() % 100) < 75 )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ( (atx_value= utxos[i].nValue) <= 0 )
|
if ( (atx_value= utxos[i].nValue) <= 0 )
|
||||||
continue;
|
continue;
|
||||||
if ( atx_value == value )
|
if ( atx_value == value )
|
||||||
|
|||||||
@@ -686,7 +686,6 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit
|
|||||||
int loops = 0;
|
int loops = 0;
|
||||||
int numtxs = unspentOutputs.size()/2;
|
int numtxs = unspentOutputs.size()/2;
|
||||||
int startfrom = rand()%numtxs;
|
int startfrom = rand()%numtxs;
|
||||||
fprintf(stderr, "start from loop: %d\n",startfrom);
|
|
||||||
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
{
|
{
|
||||||
loops++;
|
loops++;
|
||||||
@@ -983,11 +982,8 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet
|
|||||||
return("");
|
return("");
|
||||||
}
|
}
|
||||||
int32_t entropytxs=0,emptyvar=0;
|
int32_t entropytxs=0,emptyvar=0;
|
||||||
char str[65];
|
|
||||||
funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,entropytxs,false);
|
funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,entropytxs,false);
|
||||||
printf("first entropy tx found: %s\n",uint256_str(str,entropytxid));
|
|
||||||
DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,emptyvar,true);
|
DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,emptyvar,true);
|
||||||
printf("second entropy tx found: %s\n",uint256_str(str,entropytxid));
|
|
||||||
if ( ( funding >= 2*bet*odds+txfee && entropyval != 0 ) )
|
if ( ( funding >= 2*bet*odds+txfee && entropyval != 0 ) )
|
||||||
{
|
{
|
||||||
if ( entropytxs < 100 ) {
|
if ( entropytxs < 100 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user