Browse Source

only lock and unlock KMD utxos.

blackjok3r
blackjok3r 6 years ago
parent
commit
34d7b057fe
  1. 26
      iguana/dpow/dpow_fsm.c

26
iguana/dpow/dpow_fsm.c

@ -620,17 +620,23 @@ void dpow_statemachinestart(void *ptr)
dp->lastrecvmask = bp->recvmask; dp->lastrecvmask = bp->recvmask;
dp->ratifying -= bp->isratify; dp->ratifying -= bp->isratify;
// unlock the dest utxo regardless if it was locked or not it does not matter. // unlock the dest utxo on KMD.
destunlockunspent = dpow_unlockunspent(myinfo,bp->destcoin,destaddr,bits256_str(str2,ep->dest.prev_hash),ep->dest.prev_vout); if (strcmp("KMD",dest->symbol) == 0 )
if (strncmp(destunlockunspent,"true", 4) == 0 ) {
printf(">>>>UNLOCKED %s UTXO.(%s) vout.(%d)\n",dest->symbol,bits256_str(str2,ep->dest.prev_hash),ep->dest.prev_vout); destunlockunspent = dpow_unlockunspent(myinfo,bp->destcoin,destaddr,bits256_str(str2,ep->dest.prev_hash),ep->dest.prev_vout);
free(destunlockunspent); if (strncmp(destunlockunspent,"true", 4) == 0 )
printf(">>>>UNLOCKED %s UTXO.(%s) vout.(%d)\n",dest->symbol,bits256_str(str2,ep->dest.prev_hash),ep->dest.prev_vout);
free(destunlockunspent);
}
// unlock the src selected utxo, if it was locked or not it does not matter. // unlock the src selected utxo on KMD, as those are the only ones we LOCK, and CHIPS does not like the lockunspent call.
srcunlockunspent = dpow_unlockunspent(myinfo,bp->srccoin,srcaddr,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout); if ( strcmp("BTC",dest->symbol) == 0 )
if (strncmp(srcunlockunspent,"true", 4) == 0 ) {
printf(">>>>UNLOCKED %s UTXO.(%s) vout.(%d)\n",src->symbol,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout); srcunlockunspent = dpow_unlockunspent(myinfo,bp->srccoin,srcaddr,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout);
free(srcunlockunspent); if (strncmp(srcunlockunspent,"true", 4) == 0 )
printf(">>>>UNLOCKED %s UTXO.(%s) vout.(%d)\n",src->symbol,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout);
free(srcunlockunspent);
}
// dp->blocks[bp->height] = 0; // dp->blocks[bp->height] = 0;
bp->state = 0xffffffff; bp->state = 0xffffffff;

Loading…
Cancel
Save