|
@ -839,7 +839,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref |
|
|
|
|
|
|
|
|
int32_t iguana_markedunspents_find(struct iguana_info *coin,int32_t *firstslotp,bits256 txid,int32_t vout) |
|
|
int32_t iguana_markedunspents_find(struct iguana_info *coin,int32_t *firstslotp,bits256 txid,int32_t vout) |
|
|
{ |
|
|
{ |
|
|
int32_t i; |
|
|
int32_t i; char str[65]; |
|
|
*firstslotp = -1; |
|
|
*firstslotp = -1; |
|
|
if ( bits256_nonz(txid) != 0 && vout >= 0 ) |
|
|
if ( bits256_nonz(txid) != 0 && vout >= 0 ) |
|
|
{ |
|
|
{ |
|
@ -849,9 +849,12 @@ int32_t iguana_markedunspents_find(struct iguana_info *coin,int32_t *firstslotp, |
|
|
if ( *firstslotp < 0 && bits256_nonz(coin->markedunspents[i]) == 0 ) |
|
|
if ( *firstslotp < 0 && bits256_nonz(coin->markedunspents[i]) == 0 ) |
|
|
*firstslotp = i; |
|
|
*firstslotp = i; |
|
|
if ( bits256_cmp(txid,coin->markedunspents[i]) == 0 ) |
|
|
if ( bits256_cmp(txid,coin->markedunspents[i]) == 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("%s.v%d marked in slot.[%d]\n",bits256_str(str,txid),vout,i); |
|
|
return(i); |
|
|
return(i); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
if ( *firstslotp < 0 ) |
|
|
if ( *firstslotp < 0 ) |
|
|
{ |
|
|
{ |
|
|
for (i=0; i<sizeof(coin->markedunspents)/sizeof(*coin->markedunspents); i++) |
|
|
for (i=0; i<sizeof(coin->markedunspents)/sizeof(*coin->markedunspents); i++) |
|
@ -861,6 +864,7 @@ int32_t iguana_markedunspents_find(struct iguana_info *coin,int32_t *firstslotp, |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
printf("%s.v%d not marked\n",bits256_str(str,txid),vout); |
|
|
if ( *firstslotp < 0 ) |
|
|
if ( *firstslotp < 0 ) |
|
|
*firstslotp = (rand() % (sizeof(coin->markedunspents)/sizeof(*coin->markedunspents))); |
|
|
*firstslotp = (rand() % (sizeof(coin->markedunspents)/sizeof(*coin->markedunspents))); |
|
|
return(-1); |
|
|
return(-1); |
|
@ -884,6 +888,7 @@ void iguana_unspents_mark(struct supernet_info *myinfo,struct iguana_info *coin, |
|
|
{ |
|
|
{ |
|
|
printf("slot.[%d] <- %s/v%d\n",firstslot,bits256_str(str,txid),vout); |
|
|
printf("slot.[%d] <- %s/v%d\n",firstslot,bits256_str(str,txid),vout); |
|
|
coin->markedunspents[firstslot] = txid; |
|
|
coin->markedunspents[firstslot] = txid; |
|
|
|
|
|
coin->markedunspents[firstslot].ushorts[0] = vout; |
|
|
} |
|
|
} |
|
|
} else printf("error firstslot.[%d] <- %s/v%d\n",firstslot,bits256_str(str,txid),vout); |
|
|
} else printf("error firstslot.[%d] <- %s/v%d\n",firstslot,bits256_str(str,txid),vout); |
|
|
} |
|
|
} |
|
|