jl777 8 years ago
parent
commit
c255b84134
  1. 6
      iguana/iguana_notary.c
  2. 2
      iguana/notaries.h

6
iguana/iguana_notary.c

@ -497,6 +497,7 @@ bits256 dpow_notarytx(char *signedtx,int32_t isPoS,uint32_t timestamp,int32_t he
if ( siglen > 0 ) if ( siglen > 0 )
memcpy(&serialized[len],notaries[i].sig,siglen), len += siglen; memcpy(&serialized[len],notaries[i].sig,siglen), len += siglen;
len += iguana_rwnum(1,&serialized[len],sizeof(sequenceid),&sequenceid); len += iguana_rwnum(1,&serialized[len],sizeof(sequenceid),&sequenceid);
printf("VINI.%d <- i.%d\n",m,i);
m++; m++;
if ( m == numnotaries/2+1 && i == k ) if ( m == numnotaries/2+1 && i == k )
break; break;
@ -563,6 +564,7 @@ cJSON *dpow_createtx(struct iguana_info *coin,cJSON **vinsp,struct dpow_entry no
} }
jaddi(vins,item); jaddi(vins,item);
bitcoin_txinput(coin,txobj,notaries[i].prev_hash,notaries[i].prev_vout,0xffffffff,script,sizeof(script),0,0,0,0,sig,siglen); bitcoin_txinput(coin,txobj,notaries[i].prev_hash,notaries[i].prev_vout,0xffffffff,script,sizeof(script),0,0,0,0,sig,siglen);
printf("VINI.%d <- i.%d\n",m,i);
m++; m++;
if ( m == numnotaries/2+1 && i == lastk ) if ( m == numnotaries/2+1 && i == lastk )
break; break;
@ -598,11 +600,11 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc
{ {
if ( (jsonstr= dpow_signrawtransaction(myinfo,coin,rawtx,vins)) != 0 ) if ( (jsonstr= dpow_signrawtransaction(myinfo,coin,rawtx,vins)) != 0 )
{ {
printf("dpowsign.(%s)\n",jsonstr);
if ( (signobj= cJSON_Parse(jsonstr)) != 0 ) if ( (signobj= cJSON_Parse(jsonstr)) != 0 )
{ {
if ( ((signedtx= jstr(signobj,"hex")) != 0 || (signedtx= jstr(signobj,"result")) != 0) && (rawtx2= dpow_decoderawtransaction(myinfo,coin,signedtx)) != 0 ) if ( ((signedtx= jstr(signobj,"hex")) != 0 || (signedtx= jstr(signobj,"result")) != 0) && (rawtx2= dpow_decoderawtransaction(myinfo,coin,signedtx)) != 0 )
{ {
//printf("dpowsign.(%s)\n",rawtx2);
if ( (txobj2= cJSON_Parse(rawtx2)) != 0 ) if ( (txobj2= cJSON_Parse(rawtx2)) != 0 )
{ {
if ( (vin= jarray(&m,txobj2,"vin")) != 0 ) if ( (vin= jarray(&m,txobj2,"vin")) != 0 )
@ -824,7 +826,7 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
case 3: // create rawtx, sign, send rawtx + sig to all other nodes case 3: // create rawtx, sign, send rawtx + sig to all other nodes
dpow_txidupdate(myinfo,dp,coin,recvmaskp,channel,heightmsg,notaries,numnotaries,myind,hashmsg); dpow_txidupdate(myinfo,dp,coin,recvmaskp,channel,heightmsg,notaries,numnotaries,myind,hashmsg);
k = 0; k = 0;
printf("STATE3: RECVMASK.%llx\n",(long long)*recvmaskp); printf("STATE3: BTC.%d RECVMASK.%llx\n",bits256_nonz(btctxid),(long long)*recvmaskp);
if ( bitweight(*recvmaskp) > numnotaries/2+1 ) if ( bitweight(*recvmaskp) > numnotaries/2+1 )
{ {
printf("too many entries, prune to %d\n",numnotaries/2+1); printf("too many entries, prune to %d\n",numnotaries/2+1);

2
iguana/notaries.h

@ -31,7 +31,7 @@ char *Notaries[][2] =
{ "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" }, { "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" },
{ "nxtswe_EU", "03e54828c23b3eba5ad9324160e75698b1298851c77c88dc094ba23105f69c2415" }, { "nxtswe_EU", "03e54828c23b3eba5ad9324160e75698b1298851c77c88dc094ba23105f69c2415" },
{ "crackers_EU", "024612bc1b43cf67692f243b5acbeb90e1f5704cd2f19c0741207ccc5fb218251e" }, { "crackers_EU", "024612bc1b43cf67692f243b5acbeb90e1f5704cd2f19c0741207ccc5fb218251e" },
{ "traderbill_EU", "03267254424fb00792b9d5cac7124849b70520e125dc0107946c44aecb9aab50fa" }, { "traderbill_EU", "03196e8de3e2e5d872f31d79d6a859c8704a2198baf0af9c7b21e29656a7eb455f" },
{ "vanbreuk_EU", "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" }, { "vanbreuk_EU", "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" },
{ "titomane_EU", "020c909e72415d1abf151b5cbb521c2a1e14a92fb262cdd3237557da804334e1da" }, { "titomane_EU", "020c909e72415d1abf151b5cbb521c2a1e14a92fb262cdd3237557da804334e1da" },
{ "supernet_AE", "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" }, { "supernet_AE", "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" },

Loading…
Cancel
Save