Browse Source

test

acspeed
jl777 8 years ago
parent
commit
3c1ba6e868
  1. 2
      iguana/dPoW.h
  2. 9
      iguana/dpow/dpow_tx.c

2
iguana/dPoW.h

@ -19,7 +19,7 @@
#define DPOW_FIRSTRATIFY 1000
#define DPOW_CHECKPOINTFREQ 10
#define DPOW_MINSIGS 17 //((height < 90000) ? 7 : 11)
#define DPOW_MINSIGS 2 //((height < 90000) ? 7 : 11)
//#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1)
#define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries)
#define DPOW_VERSION 0x0769

9
iguana/dpow/dpow_tx.c

@ -387,7 +387,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin
void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct iguana_info *coin,struct dpow_block *bp,char *rawtx,cJSON *vins,int8_t bestk,uint64_t bestmask,int32_t myind,int32_t src_or_dest)
{
int32_t j,m=0,retval=-1; char *jsonstr,*signedtx,*rawtx2,*sigstr,*pubstr; cJSON *signobj,*sobj,*txobj2,*item,*vin; uint8_t pubkey33[33]; bits256 srchash; struct dpow_entry *ep; struct dpow_coinentry *cp;
int32_t j,m=0,retval=-1; char *jsonstr,*signedtx,*rawtx2,*sigstr,*pubstr; cJSON *signobj,*vinitem,*sobj,*txobj2,*item,*vin; uint8_t pubkey33[33]; bits256 srchash; struct dpow_entry *ep; struct dpow_coinentry *cp;
if ( bestk < 0 )
return;
for (j=0; j<sizeof(srchash); j++)
@ -408,9 +408,10 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
for (j=0; j<m; j++)
{
item = jitem(vin,j);
vinitem = jitem(vins,j);
if ( (sobj= jobj(item,"scriptSig")) != 0 && (sigstr= jstr(sobj,"hex")) != 0 && strlen(sigstr) > 32 )
{
if ( (pubstr= jstr(item,"scriptPubkey")) != 0 && is_hexstr(pubstr,0) == 66 )
if ( (pubstr= jstr(vinitem,"scriptPubkey")) != 0 && is_hexstr(pubstr,0) == 66 )
{
decode_hex(pubkey33,33,&pubstr[1]);
if ( memcmp(pubkey33,dp->minerkey33,33) == 0 )
@ -426,8 +427,8 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
dpow_sigsend(myinfo,dp,bp,myind,bestk,bestmask,srchash,src_or_dest != 0 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL);
retval = 0;
break;
} else printf("sig didnt match pubkey? (%s)\n",jprint(item,0));
} else printf("no scriptPubkey.(%s)\n",jprint(item,0));
} else printf("sig didnt match pubkey? (%s)\n",jprint(vinitem,0));
} else printf("no scriptPubkey.(%s)\n",jprint(vinitem,0));
} // else printf("notmine.(%s)\n",jprint(item,0));
}
} else printf("no vin[] (%s)\n",jprint(txobj2,0));

Loading…
Cancel
Save