jl777 8 years ago
parent
commit
fd3e066425
  1. 2
      iguana/dPoW.h
  2. 3
      iguana/dpow/dpow_fsm.c
  3. 24
      iguana/iguana_notary.c

2
iguana/dPoW.h

@ -105,7 +105,7 @@ struct dpow_block
struct dpow_info struct dpow_info
{ {
char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask;
struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE];
struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE];
bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX];

3
iguana/dpow/dpow_fsm.c

@ -516,6 +516,7 @@ void dpow_statemachinestart(void *ptr)
break; break;
} }
} }
printf("state machine ht.%d completed state.%x %s.%s %s.%s\n",bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid)); printf("state machine ht.%d completed state.%x %s.%s %s.%s recvmask.%llx\n",bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid),(long long)bp->recvmask);
myinfo->DPOW.lastrecvmask = bp->recvmask;
free(ptr); free(ptr);
} }

24
iguana/iguana_notary.c

@ -15,11 +15,9 @@
// Todo list: // Todo list:
// a) update list of current notaries
// b) use HDD storage of data
// c) award 5% APR for utxo older than a week when they are spent // a) award 5% APR for utxo older than a week when they are spent
// d) round robin mining difficulty // b) round robin mining difficulty
// q) investigate if rebroadcast reorged local chain notary tx and scanning mempool is needed // q) investigate if rebroadcast reorged local chain notary tx and scanning mempool is needed
@ -272,9 +270,23 @@ STRING_ARG(iguana,addnotary,ipaddr)
STRING_ARG(dpow,active,maskhex) STRING_ARG(dpow,active,maskhex)
{ {
uint8_t data[8],revdata[8]; int32_t i,len; uint64_t mask; cJSON *array = cJSON_CreateArray(); uint8_t data[8],revdata[8]; int32_t i,len; uint64_t mask; cJSON *retjson,*array = cJSON_CreateArray();
if ( maskhex == 0 || maskhex[0] == 0 ) if ( maskhex == 0 || maskhex[0] == 0 )
return(clonestr("{\"error\":\"no maskhex\"}")); {
mask = myinfo->DPOW.lastrecvmask;
for (i=0; i<64; i++)
{
if ( ((1LL << i) & mask) != 0 )
{
printf("(%d %llx %s) ",i,(long long)(1LL << i),Notaries[i][0]);
jaddistr(array,Notaries[i][0]);
}
}
retjson = cJSON_CreateObject();
jadd64bits(retjson,"recvmask",mask);
jadd(retjson,"notaries",array);
return(jprint(retjson,1));
}
printf("dpow active (%s)\n",maskhex); printf("dpow active (%s)\n",maskhex);
if ( (len= (int32_t)strlen(maskhex)) <= 16 ) if ( (len= (int32_t)strlen(maskhex)) <= 16 )
{ {

Loading…
Cancel
Save