From e67682d4d70a39bd469c3ff0ba0eccdb3f5163bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Sep 2016 12:48:13 -0300 Subject: [PATCH] test --- basilisk/basilisk_swap.c | 18 +++++++++++++----- iguana/tests/decoderawtransaction | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 544b85bc4..1da85f664 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -1282,12 +1282,20 @@ void basilisk_swaploop(void *_swap) printf(" <- bobdeposit.%d\n",i); if ( swap->iambob != 0 ) { - basilisk_rawtx_gen("deposit",myinfo,1,1,&swap->bobdeposit,swap->bobdeposit.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.spendlen,swap->bobdeposit.coin->chain->txfee,1); - basilisk_rawtx_gen("payment",myinfo,1,1,&swap->bobpayment,swap->bobpayment.locktime,swap->bobpayment.spendscript,swap->bobpayment.spendlen,swap->bobpayment.coin->chain->txfee,1); - if ( swap->bobdeposit.txbytes == 0 || swap->bobdeposit.spendlen == 0 || swap->bobpayment.txbytes == 0 || swap->bobpayment.spendlen == 0 ) + for (i=0; i<3; i++) { - printf("error bob generating deposit.%d or payment.%d\n",swap->bobdeposit.spendlen,swap->bobpayment.spendlen); - retval = -2; + basilisk_rawtx_gen("deposit",myinfo,1,1,&swap->bobdeposit,swap->bobdeposit.locktime,swap->bobdeposit.spendscript,swap->bobdeposit.spendlen,swap->bobdeposit.coin->chain->txfee,1); + basilisk_rawtx_gen("payment",myinfo,1,1,&swap->bobpayment,swap->bobpayment.locktime,swap->bobpayment.spendscript,swap->bobpayment.spendlen,swap->bobpayment.coin->chain->txfee,1); + if ( swap->bobdeposit.txbytes == 0 || swap->bobdeposit.spendlen == 0 || swap->bobpayment.txbytes == 0 || swap->bobpayment.spendlen == 0 ) + { + printf("error bob generating %p deposit.%d or %p payment.%d\n",swap->bobdeposit.txbytes,swap->bobdeposit.spendlen,swap->bobpayment.txbytes,swap->bobpayment.spendlen); + retval = -2; + } + else + { + retval = 0; + break; + } } /*if ( basilisk_bobpayment_reclaim(myinfo,swap) < 0 || basilisk_bobdeposit_refund(myinfo,swap) < 0 ) { diff --git a/iguana/tests/decoderawtransaction b/iguana/tests/decoderawtransaction index 2ff5c203a..468c2338a 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\":[\"010000000185631df219cbeda9f01d81d5b7726c11d07b2dd407dac1477954735200cbe39f00000000d147304402202d78b403de6fb436f101e71318d2936483a4d7ced347d8bf3e8e0b532595a77602203afdc33a494bffb9a0ed59c3620bc685103fcac870e22b769c1f29f637da56d70120030bd21a1c1b778d0b853ec0d6f66c42493ac70993c38ef4ebf7f1fddce3af4c004c67630462fde757b175210326af93b75917b4903d7acdf8e2a560357ce18b7615cc7de02ade4f62861a57dfac67a9144c73b3118e8f55b635d865ed6c3adc21640921a2882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68ffffffff014f7c0000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000\", 1]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"decoderawtransaction\",\"params\":[\"010000000169c8bb9e30e3bfc57056198f74ebc2caed7381cba1055e21317ffe28e0c784b40100000069463043022078b5d3634221c1df0ef1f1e5f3eada08e0a16a75aaddfab58a1055debfe9b82f021f644253c88cdabb52c4cf926689828687c2773064491be6565b40a7fd02d72b012103b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828ffffffff028da300000000000017a914d9289297b235c7171c9f56d9d3f1d83c6c73619c87e36d0000000000001976a9148ee61a3161993f4f7b7081259bf5f3322d65d3f888ac5907e857\", 1]}"