jl777 8 years ago
parent
commit
a02e3cabe3
  1. 2
      iguana/coins/basilisk
  2. 9
      iguana/iguana_sign.c
  3. 2
      iguana/iguana_unspents.c
  4. 2
      iguana/tests/decoderawtransaction

2
iguana/coins/basilisk

@ -2,3 +2,5 @@ curl --url "http://127.0.0.1:7778" --data "{\"poll\":100,\"active\":1,\"agent\":
#curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":8333}" #curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":8333}"
#curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":11,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9334,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}" #curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":11,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9334,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}"
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":18,\"endpend\":18,\"services\":129,\"maxpeers\":256,\"newcoin\":\"SYS\",\"name\":\"SYScoin\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"f9beb4d9\",\"p2p\":8369,\"rpc\":8370,\"pubval\":0,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"0000072d66e51ab87de265765cc8bdd2d229a4307c672a1b3d5af692519cf765\",\"genesis\":{\"version\":1,\"timestamp\":1450473723,\"nBits\":\"1e0ffff0\",\"nonce\":5258726,\"merkle_root\":\"5215c5a2af9b63f2550b635eb2b354bb13645fd8fa31275394eb161944303065\"},\"protover\":70012,\"auxpow\":1,\"fixit\":0}"

9
iguana/iguana_sign.c

@ -200,6 +200,11 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin
lastbyte = _decode_hex(&spendstr[strlen(spendstr)-2]); lastbyte = _decode_hex(&spendstr[strlen(spendstr)-2]);
if ( lastbyte == SCRIPT_OP_CHECKMULTISIG ) if ( lastbyte == SCRIPT_OP_CHECKMULTISIG )
need_op0 = 1; need_op0 = 1;
if ( V != 0 )
{
V->spendlen = (int32_t)strlen(spendstr) >> 1;
decode_hex(V->spendscript,V->spendlen,spendstr);
}
} }
} }
if ( (redeemstr= jstr(vinobj,"redeemScript")) == 0 || is_hexstr(redeemstr,(int32_t)strlen(redeemstr)) <= 0 ) if ( (redeemstr= jstr(vinobj,"redeemScript")) == 0 || is_hexstr(redeemstr,(int32_t)strlen(redeemstr)) <= 0 )
@ -268,7 +273,7 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin
{ {
if ( vin->vinscript == 0 ) if ( vin->vinscript == 0 )
{ {
printf("null vinscript case\n"); //printf("null vinscript case -> need to sign this tx\n");
vin->vinscript = serialized; vin->vinscript = serialized;
vin->vinscript[0] = 0; vin->vinscript[0] = 0;
vin->scriptlen = 1; vin->scriptlen = 1;
@ -344,7 +349,7 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin
} }
//printf("output sequence.[%d] <- %x\n",len,vin->sequence); //printf("output sequence.[%d] <- %x\n",len,vin->sequence);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(vin->sequence),&vin->sequence); len += iguana_rwnum(rwflag,&serialized[len],sizeof(vin->sequence),&vin->sequence);
if ( spendstr != 0 ) if ( 0 && spendstr != 0 )
{ {
//printf("serialized.%p len.%d\n",serialized,len); //printf("serialized.%p len.%d\n",serialized,len);
n = iguana_parsehexstr(&vin->spendscript,&vin->spendlen,V!=0?V->spendscript:0,V!=0?&V->spendlen:0,&serialized[len],spendstr); n = iguana_parsehexstr(&vin->spendscript,&vin->spendlen,V!=0?V->spendscript:0,V!=0?&V->spendlen:0,&serialized[len],spendstr);

2
iguana/iguana_unspents.c

@ -835,6 +835,8 @@ int32_t iguana_RTunspent_check(struct supernet_info *myinfo,struct iguana_info *
{ {
bits256 txid; int32_t vout,spentheight; bits256 txid; int32_t vout,spentheight;
memset(&txid,0,sizeof(txid)); memset(&txid,0,sizeof(txid));
//if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 )
// return(0);
if ( iguana_RTunspentind2txid(myinfo,coin,&spentheight,&txid,&vout,outpt) == 0 ) if ( iguana_RTunspentind2txid(myinfo,coin,&spentheight,&txid,&vout,outpt) == 0 )
{ {
//char str[65]; printf("verify %s/v%d is not already used\n",bits256_str(str,txid),vout); //char str[65]; printf("verify %s/v%d is not already used\n",bits256_str(str,txid),vout);

2
iguana/tests/decoderawtransaction

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000aeefda57019a2aba7f29b3b63732a547f199c7c89cb3b2a7bba23bdc1398772d971573d831010000006a4730440220192e93b9191af641070411ad1945144cf9a1193f9b4263f1b1bf51b558b0b8f202205df39d89e2aa4179d4771966ef38b34e1b570645036cd952c9e91e721b3d23f9012102743d2afdb88ede68fb5938e961b1f41c2b6267b3286516543eb4e4ab87ad0d0affffffff76a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac02c0d40100000000001976a9145da2ae69885741a6946e01ad8aa8b5312eed856088acf0d6e10b000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac\", 1]}" curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"SYS\",\"method\":\"decoderawtransaction\",\"params\":[\"0100000002006a9affa9b868cd4da9598f9a311bc8315dd0beafcdc4066f7eb4a55d19fae80100000000ffffffff00bcb83647bdcf661a4e71e96ee0ee84f77f09e278120a9479e19c709238963d0000000000ffffffff0210270000000000001976a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88acdc840100000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac00000000\", 1]}"

Loading…
Cancel
Save