Browse Source

Merge pull request #128 from jl777/acspeed

Acspeed
dPoW
jl777 8 years ago
committed by GitHub
parent
commit
0c6339f74e
  1. 4
      iguana/dPoW.h
  2. 18
      iguana/dpow/dpow_tx.c
  3. 2
      iguana/iguana_rpc.c
  4. 8
      iguana/m_notary

4
iguana/dPoW.h

@ -19,10 +19,10 @@
#define DPOW_FIRSTRATIFY 1000 #define DPOW_FIRSTRATIFY 1000
#define DPOW_CHECKPOINTFREQ 10 #define DPOW_CHECKPOINTFREQ 10
#define DPOW_MINSIGS 19 //((height < 90000) ? 7 : 11) #define DPOW_MINSIGS 13 //((height < 90000) ? 7 : 11)
//#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) //#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_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries)
#define DPOW_VERSION 0x0769 #define DPOW_VERSION 0x0770
#define DPOW_UTXOSIZE 10000 #define DPOW_UTXOSIZE 10000
#define DPOW_MINOUTPUT 6000 #define DPOW_MINOUTPUT 6000
#define DPOW_DURATION 300 #define DPOW_DURATION 300

18
iguana/dpow/dpow_tx.c

@ -411,14 +411,24 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
vinitem = jitem(vins,j); vinitem = jitem(vins,j);
if ( (sobj= jobj(item,"scriptSig")) != 0 && (sigstr= jstr(sobj,"hex")) != 0 && strlen(sigstr) > 32 ) if ( (sobj= jobj(item,"scriptSig")) != 0 && (sigstr= jstr(sobj,"hex")) != 0 && strlen(sigstr) > 32 )
{ {
valid = 0;
if ( dp->ratifying != 0 && j == 0 )
valid = 1; valid = 1;
else if ( (pubstr= jstr(vinitem,"scriptPubKey")) != 0 && is_hexstr(pubstr,0) == 66 ) if ( dp->ratifying != 0 && j == 0 && bp->myind == 0 )
valid = 1;
else if ( (pubstr= jstr(vinitem,"scriptPubKey")) != 0 && is_hexstr(pubstr,0) == 70 )
{ {
decode_hex(pubkey33,33,&pubstr[2]); decode_hex(pubkey33,33,&pubstr[2]);
if ( memcmp(pubkey33,dp->minerkey33,33) == 0 ) if ( memcmp(pubkey33,dp->minerkey33,33) == 0 )
valid = 1; valid = 1;
else
{
int32_t z;
for (z=0; z<33; z++)
printf("%02x",dp->minerkey33[z]);
printf(" minerkey33 doesnt match\n");
for (z=0; z<33; z++)
printf("%02x",pubkey33[z]);
printf(" scriptPubKey\n");
}
} }
if ( valid != 0 ) if ( valid != 0 )
{ {
@ -433,7 +443,7 @@ 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); dpow_sigsend(myinfo,dp,bp,myind,bestk,bestmask,srchash,src_or_dest != 0 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL);
retval = 0; retval = 0;
break; break;
} else printf("sig didnt match pubkey? (%s)\n",jprint(vinitem,0)); } else printf("sig.%d of %d didnt match pubkey? (%s)\n",j,m,jprint(vinitem,0));
} // else printf("notmine.(%s)\n",jprint(item,0)); } // else printf("notmine.(%s)\n",jprint(item,0));
} }
} else printf("no vin[] (%s)\n",jprint(txobj2,0)); } else printf("no vin[] (%s)\n",jprint(txobj2,0));

2
iguana/iguana_rpc.c

@ -857,6 +857,8 @@ char *SuperNET_rpcparse(struct supernet_info *myinfo,char *retbuf,int32_t bufsiz
originstr = &urlstr[i + strlen(fieldstr)]; originstr = &urlstr[i + strlen(fieldstr)];
if ( strncmp(originstr,"http://127.0.0.",strlen("http://127.0.0.")) == 0 ) if ( strncmp(originstr,"http://127.0.0.",strlen("http://127.0.0.")) == 0 )
originstr = "http://127.0.0.1:"; originstr = "http://127.0.0.1:";
if ( strncmp(originstr,"file://127.0.0.",strlen("file://127.0.0.")) == 0 )
originstr = "http://127.0.0.1:";
if ( strncmp("null",originstr,strlen("null")) != 0 && strncmp("http://localhost:",originstr,strlen("http://localhost:")) != 0 && strncmp("http://127.0.0.1:",originstr,strlen("http://127.0.0.1:")) != 0 && strncmp("http://easydex.supernet.org",originstr,strlen("http://easydex.supernet.org")) != 0 ) if ( strncmp("null",originstr,strlen("null")) != 0 && strncmp("http://localhost:",originstr,strlen("http://localhost:")) != 0 && strncmp("http://127.0.0.1:",originstr,strlen("http://127.0.0.1:")) != 0 && strncmp("http://easydex.supernet.org",originstr,strlen("http://easydex.supernet.org")) != 0 )
{ {
printf("remote %s REJECT.(%s)\n",fieldstr,urlstr); printf("remote %s REJECT.(%s)\n",fieldstr,urlstr);

8
iguana/m_notary

@ -19,6 +19,8 @@ sleep 3
tests/addnotarys_7776 tests/addnotarys_7776
coins/btc_7776 coins/btc_7776
coins/kmd_7776 coins/kmd_7776
./wp_7776
coins/revs_7776 coins/revs_7776
coins/supernet_7776 coins/supernet_7776
coins/dex_7776 coins/dex_7776
@ -31,9 +33,7 @@ coins/crypto_7776
coins/pangea_7776 coins/pangea_7776
coins/mgw_7776 coins/mgw_7776
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}"
sleep 7 sleep 17
./wp_7776
sleep 3

Loading…
Cancel
Save