jl777 8 years ago
parent
commit
b643a1437f
  1. 4
      iguana/dpow/dpow_rpc.c
  2. 9
      iguana/dpow/dpow_tx.c

4
iguana/dpow/dpow_rpc.c

@ -192,7 +192,7 @@ cJSON *dpow_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,ch
char *dpow_signrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *rawtx,cJSON *vins)
{
cJSON *array,*privkeys,*item; char *wifstr,*str,*paramstr,*retstr; uint8_t script[256]; int32_t i,n,len,hashtype; struct vin_info V; struct iguana_waddress *waddr; struct iguana_waccount *wacct;
if ( 0 && coin->FULLNODE < 0 )
if ( coin->FULLNODE < 0 )
{
array = cJSON_CreateArray();
jaddistr(array,rawtx);
@ -205,7 +205,7 @@ char *dpow_signrawtransaction(struct supernet_info *myinfo,struct iguana_info *c
usleep(10000);
return(retstr);
}
else if ( 1 ) //coin->FULLNODE > 0 || coin->VALIDATENODE > 0 )
else if ( coin->FULLNODE > 0 || coin->VALIDATENODE > 0 )
{
privkeys = cJSON_CreateArray();
if ( (n= cJSON_GetArraySize(vins)) > 0 )

9
iguana/dpow/dpow_tx.c

@ -80,9 +80,7 @@ uint64_t dpow_ratifybest(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp)
int32_t m,j,k; uint64_t bestmask,mask = bp->require0;
bestmask = 0;
*lastkp = -1;
if ( (m= bp->require0) != 0 )
mask = 1;
for (j=0; j<bp->numnotaries; j++)
for (m=j=0; j<bp->numnotaries; j++)
{
k = (j + ((uint32_t)time(NULL) / 100)) % bp->numnotaries;//DPOW_MODIND(bp,j);
if ( bp->require0 != 0 && k == 0 )
@ -90,10 +88,11 @@ uint64_t dpow_ratifybest(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp)
if ( bits256_nonz(bp->notaries[k].ratifysrcutxo) != 0 && bits256_nonz(bp->notaries[k].ratifydestutxo) != 0 )
{
mask |= (1LL << k);
if ( ++m == bp->minsigs )
if ( ++m == bp->minsigs-bp->require0 )
{
*lastkp = k;
bestmask = mask;
bestmask = mask | bp->require0;
printf("m.%d == minsigs.%d (%d %llx)\n",m,bp->minsigs,k,(long long)bestmask);
}
}
}

Loading…
Cancel
Save