Browse Source

test

etomic
jl777 8 years ago
parent
commit
2cc623b69d
  1. 16
      iguana/dpow/dpow_network.c

16
iguana/dpow/dpow_network.c

@ -727,13 +727,17 @@ void dpow_bestconsensus(struct dpow_block *bp)
void dpow_nanoutxoset(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_nanoutxo *np,struct dpow_block *bp,int32_t isratify)
{
int32_t i,err,vout; cJSON *ujson; char coinaddr[64];
int32_t i,err,vout; cJSON *ujson; char coinaddr[64],str[65];
if ( bp->myind < 0 )
return;
if ( isratify != 0 )
{
np->srcutxo = bp->notaries[bp->myind].ratifysrcutxo;
np->srcvout = bp->notaries[bp->myind].ratifysrcvout;
np->destutxo = bp->notaries[bp->myind].ratifydestutxo;
np->destvout = bp->notaries[bp->myind].ratifydestvout;
if ( bp->myind != 0 )
{
err = 0;
if ( (ujson= dpow_gettxout(myinfo,bp->srccoin,np->srcutxo,np->srcvout)) != 0 )
{
@ -746,15 +750,12 @@ void dpow_nanoutxoset(struct supernet_info *myinfo,struct dpow_info *dp,struct d
bitcoin_address(coinaddr,bp->srccoin->chain->pubtype,dp->minerkey33,33);
if ( dpow_haveutxo(myinfo,bp->srccoin,&bp->notaries[bp->myind].ratifysrcutxo,&vout,coinaddr) > 0 )
{
printf("Replace UTXO.%s\n",bp->srccoin->symbol);
bp->notaries[bp->myind].ratifysrcvout = vout;
np->srcutxo = bp->notaries[bp->myind].ratifysrcutxo;
np->srcvout = bp->notaries[bp->myind].ratifysrcvout;
printf("Replace UTXO.%s < %s/v%d\n",bp->srccoin->symbol,bits256_str(str,np->srcutxo),vout);
} else printf("cant find utxo.%s\n",bp->srccoin->symbol);
}
else printf("cant find utxo.%s\n",bp->srccoin->symbol);
}
np->destutxo = bp->notaries[bp->myind].ratifydestutxo;
np->destvout = bp->notaries[bp->myind].ratifydestvout;
err = 0;
if ( (ujson= dpow_gettxout(myinfo,bp->destcoin,np->destutxo,np->destvout)) != 0 )
{
@ -767,12 +768,13 @@ void dpow_nanoutxoset(struct supernet_info *myinfo,struct dpow_info *dp,struct d
bitcoin_address(coinaddr,bp->destcoin->chain->pubtype,dp->minerkey33,33);
if ( dpow_haveutxo(myinfo,bp->destcoin,&bp->notaries[bp->myind].ratifydestutxo,&vout,coinaddr) > 0 )
{
printf("Replace UTXO.%s\n",bp->destcoin->symbol);
bp->notaries[bp->myind].ratifydestvout = vout;
np->destutxo = bp->notaries[bp->myind].ratifydestutxo;
np->destvout = bp->notaries[bp->myind].ratifydestvout;
printf("Replace UTXO.%s < %s/v%d\n",bp->destcoin->symbol,bits256_str(str,np->destutxo),vout);
} else printf("cant find utxo.%s\n",bp->destcoin->symbol);
}
}
np->bestmask = bp->ratifybestmask;
np->recvmask = bp->ratifyrecvmask;
//printf("send ratify best.(%d %llx) siglens.(%d %d)\n", bp->ratifybestk,(long long)bp->ratifybestmask,bp->ratifysiglens[0],bp->ratifysiglens[1]);

Loading…
Cancel
Save