From d0f65e0703ada48f20c448523b82b07df25f7dda Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 9 Aug 2016 18:19:23 -0300 Subject: [PATCH] test --- iguana/confs/BTCD_hdrs.txt | 4 +--- iguana/iguana_payments.c | 6 +++++- iguana/iguana_sign.c | 3 +++ iguana/tests/decoderawtransaction | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/iguana/confs/BTCD_hdrs.txt b/iguana/confs/BTCD_hdrs.txt index 2d2c2cb04..ec34dfe67 100644 --- a/iguana/confs/BTCD_hdrs.txt +++ b/iguana/confs/BTCD_hdrs.txt @@ -2438,6 +2438,4 @@ 1218000 c62fb3c42177536ab92a97c2d8fc21f72ca1499aca8bc9b604d8265cd8630771 375f71108b5160a7a7990288ef3394cdcfcfcf77955f21f28368d101ba93eb66 b51ab010fef2ea591827977f896d80a4dd63cf94bded139805169c581849068f 1218500 a162e27d52028d27ace91149cd6526e41f6ac23e67378f81f51836f7326fed9d 28c6848464f675c93a357833cbd7af6fe0d1881723c9b1dfa731a7ee2c08536f 898dea8a454aa96a0931532a0eb7e181de7f83359f7433c520e4693b5fdf4948 1219000 fe267680bd06b3bf83536a78e7f41b7a389478c9b1e221deae145bf8a08d5b47 4466a5245e8e0c00d39be14b484771ebe4ac618cfaaae42c566a084ed3870da5 99adb8f4eb21b3a3b58279d7c08f50b18b854f9e52adb5c026bb50cd2c004818 -1219500 ad07e8ef4af3453d3d595897cd7d9283361f64307bc92456b2a1f9060332eb66 96b8bad5bd9a508c33ada23b6457636e9e957d0c1a59c718d421c0e782608c4b 3a38aa150c4c883cd5fec2ccc3020dc934f5eade8c9c10ad69a167343019cb43 -1220000 811168c51f99a36edb27c7d8a8d5a27a84afc5e7e0b4c62f7d62c2de71992f81 b52360cf74cf6f0afd8c3601dd3d460f1b86f69ad46fb1427c8dd7bf349535f5 05948b8b422a7a908e9e0bccc308395e705291d56d9692768932b249d33175e8 -1220500 ec2e7364b7d3725307b2626ccab20175924a8a2a72cdeda71f90514033fe8cb1 \ No newline at end of file +1219500 ad07e8ef4af3453d3d595897cd7d9283361f64307bc92456b2a1f9060332eb66 \ No newline at end of file diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 3c31e8c56..51310484b 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -973,7 +973,11 @@ STRING_AND_INT(bitcoinrpc,validaterawtransaction,rawtx,suppress) if ( remoteaddr != 0 ) return(clonestr("{\"error\":\"no remote\"}")); - cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"20fe936da3707c8c4cc7eb0352160ec3f50b9454d46425df6347b2fbc5b2ec87ea00\",\"txid\":\"ee12e50b629d5d45438570fff841d1a2ba7d27f356de4aa06900c9a5e38cf141\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a9145cc47cc123e3f9b7dce0230009b9d3013a9e0c9687\"},\"suppress\":1,\"redeemScript\":\"6304165daa57b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a9143805600256ed8498ca1ec426759212e5835e8dc2882103a7b696908f77d69ec89887f8c4a0423b9e80b5974dc43301bd7d8abad07e1211ac68\"}],\"vout\":[{\"satoshis\":\"21821\",\"scriptPubkey\":{\"hex\":\"76a9143ef4734c1141725c095342095f6e0e7748b6c16588ac\"}}]}"; + //cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"20fe936da3707c8c4cc7eb0352160ec3f50b9454d46425df6347b2fbc5b2ec87ea00\",\"txid\":\"ee12e50b629d5d45438570fff841d1a2ba7d27f356de4aa06900c9a5e38cf141\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a9145cc47cc123e3f9b7dce0230009b9d3013a9e0c9687\"},\"suppress\":1,\"redeemScript\":\"6304165daa57b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a9143805600256ed8498ca1ec426759212e5835e8dc2882103a7b696908f77d69ec89887f8c4a0423b9e80b5974dc43301bd7d8abad07e1211ac68\"}],\"vout\":[{\"satoshis\":\"21821\",\"scriptPubkey\":{\"hex\":\"76a9143ef4734c1141725c095342095f6e0e7748b6c16588ac\"}}]}"; + + cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"206efad760ee54b9b2e2a038a821ef9f950eb0e248545ac202c3e2074cd14f92cb00\",\"txid\":\"3f4759381a62154f2f0eefed1e4433342548ad7b269f912820383b715a39273c\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a91446dcccef39c1d8c6da2ccc35dce2bfa7ec0d168887\"},\"suppress\":1,\"redeemScript\":\"63041c60aa57b1752103175cf93574c31637b8c2d8acd5319e3cd23761b5e418d32c6bcb194972ba9273ac67a9142d75daf71325feaa593b8f30989e462892189914882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68\"}],\"vout\":[{\"satoshis\":\"18625\",\"scriptPubkey\":{\"hex\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\"}}]}"; + // 01000000013c27395a713b382028919f267bad48253433441eedef0e2f4f15621a3859473f00000000d147304402207ecd423b55c1aa45a994c4eb4337ff0891692fbb69954a9ba024745a99c5272d02207cea696425feb5388153ab7f2608d66a66e4c95cfda2d44e98bc56e25994d3f701206efad760ee54b9b2e2a038a821ef9f950eb0e248545ac202c3e2074cd14f92cb004c6763041c60aa57b1752103175cf93574c31637b8c2d8acd5319e3cd23761b5e418d32c6bcb194972ba9273ac67a9142d75daf71325feaa593b8f30989e462892189914882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68ffffffff01c1480000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000 + // 01000000013c27395a713b382028919f267bad48253433441eedef0e2f4f15621a3859473f00000000fd8b00206efad760ee54b9b2e2a038a821ef9f950eb0e248545ac202c3e2074cd14f92cb004c6763041c60aa57b1752103175cf93574c31637b8c2d8acd5319e3cd23761b5e418d32c6bcb194972ba9273ac67a9142d75daf71325feaa593b8f30989e462892189914882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68ffffffff01c1480000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000 //cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"20ae439d344513eab8e718d8214fe6ae8133b8b5b594afd64da21d0e40b9c37cdd00\",\"txid\":\"2c1320315f4fb519cbf2b4d7b67855013b9a09a85e515df43b41d407a0083b09\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a9142e7674400d04217f770f2222126dc7fee44b06b487\"},\"suppress\":1,\"redeemScript\":\"63041686a657b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a914ed74c61c27656abc6c20687c3a9212ffdc6f34cd88210398a4cb9f6ea7c52a4e27455028a95e2e4e397a110fb75f072c2c58a8bdcbf4baac68\"}],\"vout\":[{\"satoshis\":\"16733\",\"scriptPubkey\":{\"hex\":\"76a91454a752f0d71b89d7c014ed0be29ca231c9546f9f88ac\"}}]}"; extraspace = calloc(1,extralen); if ( (txobj= cJSON_Parse(teststr)) != 0 ) diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 2bfe8767d..26c109332 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -303,6 +303,9 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin len += n; } tmp = (len - starti); + for (i=0; i> 8) & 0xff); if ( spendstr != 0 ) diff --git a/iguana/tests/decoderawtransaction b/iguana/tests/decoderawtransaction index 02e4f7248..70f00e3b3 100755 --- a/iguana/tests/decoderawtransaction +++ b/iguana/tests/decoderawtransaction @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"decoderawtransaction\",\"params\":[\"010000000141f18ce3a5c90069a04ade56f3277dbaa2d141f8ff708543455d9d620be512ee00000000d147304402206b65cdd65f646bcc8ed3011e1d6bdb78d615c0f96f00b204d8561599ef77860c02202c5fca26317cc42ea037c1925530ac0e9ad22beda63717617da84107f833f3090120fe936da3707c8c4cc7eb0352160ec3f50b9454d46425df6347b2fbc5b2ec87ea004c676304165daa57b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a9143805600256ed8498ca1ec426759212e5835e8dc2882103a7b696908f77d69ec89887f8c4a0423b9e80b5974dc43301bd7d8abad07e1211ac68ffffffff013d550000000000001976a9143ef4734c1141725c095342095f6e0e7748b6c16588ac00000000\", 1]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000013c27395a713b382028919f267bad48253433441eedef0e2f4f15621a3859473f00000000d147304402207ecd423b55c1aa45a994c4eb4337ff0891692fbb69954a9ba024745a99c5272d02207cea696425feb5388153ab7f2608d66a66e4c95cfda2d44e98bc56e25994d3f701206efad760ee54b9b2e2a038a821ef9f950eb0e248545ac202c3e2074cd14f92cb004c6763041c60aa57b1752103175cf93574c31637b8c2d8acd5319e3cd23761b5e418d32c6bcb194972ba9273ac67a9142d75daf71325feaa593b8f30989e462892189914882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68ffffffff01c1480000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000\", 1]}"