From 46a955409e6a5b651770187a3ce33ca8de676936 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Nov 2016 13:55:15 -0300 Subject: [PATCH] test --- iguana/dpow/dpow_fsm.c | 16 +++++++++++++--- iguana/dpow/dpow_rpc.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 69fd96d76..09e8db9af 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -152,12 +152,22 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,struc int32_t dpow_checkutxo(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr) { - int32_t haveutxo,completed; bits256 signedtxid; cJSON *addresses; char *rawtx,*sendtx; - if ( (haveutxo= dpow_haveutxo(myinfo,coin,txidp,voutp,coinaddr)) <= 9 && time(NULL) > dp->lastsplit+bp->duration ) + int32_t haveutxo,completed,minutxo,n; bits256 signedtxid; cJSON *addresses; char *rawtx,*sendtx; + if ( strcmp("BTC",coin->symbol) == 0 ) + { + minutxo = 9; + n = 50; + } + else + { + minutxo = 49; + n = 10; + } + if ( (haveutxo= dpow_haveutxo(myinfo,coin,txidp,voutp,coinaddr)) <= minutxo && time(NULL) > dp->lastsplit+bp->duration ) { addresses = cJSON_CreateArray(); jaddistr(addresses,coinaddr); - if ( (rawtx= iguana_utxoduplicates(myinfo,coin,dp->minerkey33,DPOW_UTXOSIZE,strcmp(coin->symbol,"BTC") == 0 ? 50 : 10,&completed,&signedtxid,0,addresses)) != 0 ) + if ( (rawtx= iguana_utxoduplicates(myinfo,coin,dp->minerkey33,DPOW_UTXOSIZE,n,&completed,&signedtxid,0,addresses)) != 0 ) { if ( (sendtx= dpow_sendrawtransaction(myinfo,coin,rawtx)) != 0 ) { diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 25b303225..f886dab2b 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -321,7 +321,7 @@ int32_t dpow_vini_ismine(struct supernet_info *myinfo,struct dpow_info *dp,cJSON int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr) { - int32_t i,n,vout,haveutxo = 0; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35]; + int32_t i,j,n,vout,haveutxo = 0; uint32_t r; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35]; memset(txidp,0,sizeof(*txidp)); *voutp = -1; if ( (unspents= dpow_listunspent(myinfo,coin,coinaddr)) != 0 ) @@ -337,8 +337,12 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits "confirmations" : 4282, "spendable" : true },*/ - for (i=0; isymbol,3); + r = calc_crc32(0,(void *)&r,sizeof(r)); + for (j=0; j