Browse Source

Move dpow_recvmasks

pass-iguana-arg
jl777 7 years ago
parent
commit
421e139647
  1. 20
      iguana/dpow/dpow_network.c
  2. 21
      iguana/iguana_notary.c

20
iguana/dpow/dpow_network.c

@ -1831,26 +1831,6 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct
}
}
cJSON *dpow_recvmasks(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp)
{
int32_t i; cJSON *retjson,*item; char hexstr[64];
retjson = cJSON_CreateArray();
if ( dp == 0 || bp == 0 )
return(retjson);
for (i=0; i<bp->numnotaries; i++)
{
item = cJSON_CreateObject();
jaddstr(item,"notary",Notaries_elected[i][0]);
jaddnum(item,"bestk",bp->notaries[i].bestk);
sprintf(hexstr,"%16llx",(long long)bp->notaries[i].recvmask);
jaddstr(item,"recvmask",hexstr);
sprintf(hexstr,"%16llx",(long long)bp->notaries[i].bestmask);
jaddstr(item,"bestmask",hexstr);
jaddi(retjson,item);
}
return(retjson);
}
void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint8_t senderind,int8_t bestk,uint64_t bestmask,uint64_t recvmask,bits256 srcutxo,uint16_t srcvout,bits256 destutxo,uint16_t destvout,uint8_t siglens[2],uint8_t sigs[2][DPOW_MAXSIGLEN],uint32_t paxwdcrc)
{
bits256 srchash; uint32_t now; int32_t i,flag,bestmatches = 0,matches = 0,paxmatches = 0,paxbestmatches = 0;

21
iguana/iguana_notary.c

@ -860,7 +860,26 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks)
}
extern char *Notaries_elected[65][2];
cJSON *dpow_recvmasks(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp);
cJSON *dpow_recvmasks(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp)
{
int32_t i; cJSON *retjson,*item; char hexstr[64];
retjson = cJSON_CreateArray();
if ( dp == 0 || bp == 0 )
return(retjson);
for (i=0; i<bp->numnotaries; i++)
{
item = cJSON_CreateObject();
jaddstr(item,"notary",Notaries_elected[i][0]);
jaddnum(item,"bestk",bp->notaries[i].bestk);
sprintf(hexstr,"%16llx",(long long)bp->notaries[i].recvmask);
jaddstr(item,"recvmask",hexstr);
sprintf(hexstr,"%16llx",(long long)bp->notaries[i].bestmask);
jaddstr(item,"bestmask",hexstr);
jaddi(retjson,item);
}
return(retjson);
}
STRING_ARG(dpow,active,maskhex)
{

Loading…
Cancel
Save