This commit is contained in:
blackjok3r
2018-10-29 15:40:02 +08:00
parent 4aea265846
commit 9f39af9cdd
2 changed files with 13 additions and 7 deletions

View File

@@ -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.
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
*/
bool SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const CScript scriptPubKey)
{
#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;
abovei = belowi = -1;
int loops = 0;
int numtxs = numunspents/2;
int startfrom = rand()%numtxs;
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 )
continue;
if ( atx_value == value )