Browse Source

Test

etomic
jl777 7 years ago
parent
commit
39c1fe0ef7
  1. 2
      iguana/exchanges/LP_nativeDEX.c
  2. 14
      iguana/exchanges/LP_transaction.c

2
iguana/exchanges/LP_nativeDEX.c

@ -703,7 +703,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
printf("%s ",activecoins[i]); printf("%s ",activecoins[i]);
LP_coinfind(activecoins[i]); LP_coinfind(activecoins[i]);
LP_priceinfoadd(activecoins[i]); LP_priceinfoadd(activecoins[i]);
//test_validate("02000000010e62f95ff5881de8853ce1a5ddbaad731a62879d719367f539103600f1895477010000006b483045022100c684a0871689519bd97f2e61275752124f0f1498360750c87cf99a8acf06fd8c022047e7e62a7bfd481599130e6f40c95833f6ed6f44aa8b6ead7b0ec86a738b98a041210361857e1ba609aadff520a2ca9886fe7548c7154fab2cbe108c3b0e1e7635eb1ffeffffff02a0860100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac1e6f0700000000001976a9147f4b7113f9e26d84b150f2cc6d219baaf27f884488ace6b00700"); // valid BCH test_validate("02000000010e62f95ff5881de8853ce1a5ddbaad731a62879d719367f539103600f1895477010000006b483045022100c684a0871689519bd97f2e61275752124f0f1498360750c87cf99a8acf06fd8c022047e7e62a7bfd481599130e6f40c95833f6ed6f44aa8b6ead7b0ec86a738b98a041210361857e1ba609aadff520a2ca9886fe7548c7154fab2cbe108c3b0e1e7635eb1ffeffffff02a0860100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac1e6f0700000000001976a9147f4b7113f9e26d84b150f2cc6d219baaf27f884488ace6b00700"); // valid BCH
//test_validate("01000000011434b89cc4d41bcbbda87db58b5167bce50ea025d5fba3f4d7bbd9ec1b620d98000000006a47304402205aba01fa2b895df6069dc7458fcc7aac6da1ffbc2811eb43382a5a342a342c6202207da60859f45893785322fede2f82b1f7c76cd9882b6a8ed6d25037f4184b60514121029d1e15b82fc3e11b51b61eb65545b0c93baebb17de5118979f261a086575bcd6ffffffff0210270000000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac80380100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac00000000"); // valid BTC //test_validate("01000000011434b89cc4d41bcbbda87db58b5167bce50ea025d5fba3f4d7bbd9ec1b620d98000000006a47304402205aba01fa2b895df6069dc7458fcc7aac6da1ffbc2811eb43382a5a342a342c6202207da60859f45893785322fede2f82b1f7c76cd9882b6a8ed6d25037f4184b60514121029d1e15b82fc3e11b51b61eb65545b0c93baebb17de5118979f261a086575bcd6ffffffff0210270000000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac80380100000000001976a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac00000000"); // valid BTC
//getchar(); //getchar();
if ( (coin= LP_coinfind(activecoins[i])) != 0 ) if ( (coin= LP_coinfind(activecoins[i])) != 0 )

14
iguana/exchanges/LP_transaction.c

@ -679,20 +679,26 @@ char *iguana_validaterawtx(void *ctx,struct iguana_info *coin,struct iguana_msgt
jadd(item,"scriptPubKey",sobj); jadd(item,"scriptPubKey",sobj);
printf("match special txid A\n"); printf("match special txid A\n");
} }
else if ( strcmp(jstr(item,"txid"),"980d621becd9bbd7f4a3fbd525a00ee5bc67518bb57da8bdcb1bd4c49cb83414") == 0 && jint(item,"vout") == 0 ) else if ( strcmp(jstr(item,"txid"),"b19ce2c564f7dc57b3f95593e2b287c72d388e86de12dc562d9f8a6bea65b310") == 0 && jint(item,"vout") == 1 )
{ {
V[i].spendlen = 25; V[i].spendlen = 25;
decode_hex(V[i].spendscript,V[i].spendlen,"76a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac"); decode_hex(V[i].spendscript,V[i].spendlen,"76a91459fdba29ea85c65ad90f6d38f7a6646476b26b1688ac");
msgtx->lock_time = 0; msgtx->lock_time = 0;
V[i].amount = SATOSHIDEN * 0.001; V[i].amount = SATOSHIDEN * 0.001;
strcpy(V[i].coinaddr,"1AwDWu5rZKyGMUu16gf9Kow8ohnKmc7tGH"); strcpy(V[i].coinaddr,"19Cq6MBaD8LY7trqs99ypqKAms3GcLs6J9");
V[i].suppress_pubkeys = 0; V[i].suppress_pubkeys = 0;
msgtx->vins[i].sequence = 0xffffffff; msgtx->vins[i].sequence = 0xffffffff;
sobj = cJSON_CreateObject(); sobj = cJSON_CreateObject();
jaddstr(sobj,"hex","76a9146cfa0a987f4c8f2ffee7e9944ef0c86fcda9671d88ac"); jaddstr(sobj,"hex","76a91459fdba29ea85c65ad90f6d38f7a6646476b26b1688ac");
jadd(item,"scriptPubKey",sobj); jadd(item,"scriptPubKey",sobj);
printf("match special txid B\n"); printf("match special txid B\n");
} }
/*hashprev 997c1040c67ee2f9ab21abf7457f7aec4503970e974e532b6578f326c270b7eb, hashseq.445066705e799022b7095f7ceca255149f43acfc47e7f59e551f7bce2930b13b hashout.a919fd9f636c08f4989be95c999230408dbc0f602c3f000bcedba9d5bbe98914
sighash.fc55acc3666c43b8f75908ca06ea2d343cd09eb846f14c5d7d0748a11e081a9d
{
"hex": "010000000110b365ea6b8a9f2d56dc12de868e382dc787b2e29355f9b357dcf764c5e29cb1010000006b483045022100c605b993f1db5f31046ebb9065bea0a047f478342bbad8fcfc6af81d05236bd502206e9993a737a8814b935b5e522e750c915e7d37e3bd8367f087d4510f66acac47412102ebc786cb83de8dc3922ab83c21f3f8a2f3216940c3bf9da43ce39e2a3a882c92ffffffff014bc22900000000001976a91459fdba29ea85c65ad90f6d38f7a6646476b26b1688ac00000000",
"complete": true
}*/
msgtx->vins[i].spendscript = V[i].spendscript; msgtx->vins[i].spendscript = V[i].spendscript;
msgtx->vins[i].spendlen = V[i].spendlen; msgtx->vins[i].spendlen = V[i].spendlen;
if ( (sobj= jobj(item,"scriptSig")) != 0 ) if ( (sobj= jobj(item,"scriptSig")) != 0 )

Loading…
Cancel
Save