jl777 8 years ago
parent
commit
a230743ccc
  1. 11
      iguana/dpow/dpow_network.c
  2. 26
      iguana/dpow/dpow_rpc.c

11
iguana/dpow/dpow_network.c

@ -272,6 +272,17 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct
memset(&bp->notaries[i].ratifydestutxo,0,sizeof(bp->notaries[i].ratifydestutxo));
bp->notaries[i].ratifybestmask = bp->notaries[i].ratifyrecvmask = 0;
}
else
{
if ( dpow_checkutxo(myinfo,dp,bp,bp->destcoin,&bp->notaries[i].dest.prev_hash,&bp->notaries[i].dest.prev_vout,destaddr) < 0 )
{
printf("dont have %s %s utxo, please send funds\n",dp->dest,destaddr);
}
if ( dpow_checkutxo(myinfo,dp,bp,bp->srccoin,&bp->notaries[i].src.prev_hash,&bp->notaries[i].src.prev_vout,srcaddr) < 0 )
{
printf("dont have %s %s utxo, please send funds\n",dp->symbol,srcaddr);
}
}
}
}
}

26
iguana/dpow/dpow_rpc.c

@ -112,6 +112,32 @@ cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits2
return(json);
}
cJSON *dpow_gettxout(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout)
{
char buf[128],str[65],*retstr=0; cJSON *json = 0;
sprintf(buf,"\"%s\", %d",bits256_str(str,txid),vout);
if ( coin->FULLNODE < 0 )
{
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"gettxout",buf);
usleep(10000);
}
else if ( coin->FULLNODE > 0 || coin->VALIDATENODE > 0 )
{
printf("need to test following call\n");
retstr = bitcoinrpc_gettxout(myinfo,coin,0,buf,txid,1,0); // untested
}
else
{
return(0);
}
if ( retstr != 0 )
{
json = cJSON_Parse(retstr);
free(retstr);
}
return(json);
}
char *dpow_decoderawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *rawtx)
{
char *retstr,*paramstr; cJSON *array;

Loading…
Cancel
Save