From fc630009a349dcaf42da3eab16dfae9e6356e006 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Apr 2017 19:27:15 +0300 Subject: [PATCH] Test --- .gitignore | 10 ++++++++++ basilisk/basilisk_swap.c | 9 ++++++--- iguana/DB/SWAPS/3210648667-2626363704 | 1 - iguana/DB/SWAPS/415703857-2769362858 | 1 - 4 files changed, 16 insertions(+), 5 deletions(-) delete mode 100644 iguana/DB/SWAPS/3210648667-2626363704 delete mode 100644 iguana/DB/SWAPS/415703857-2769362858 diff --git a/.gitignore b/.gitignore index 3c50d4146..1295737f8 100755 --- a/.gitignore +++ b/.gitignore @@ -380,3 +380,13 @@ iguana/DB/SWAPS/467080987-1442519493 iguana/DB/SWAPS/1504818827-1454232932 iguana/DB/SWAPS/4093850898-2949785771 + +iguana/DB/SWAPS.old/1247864366-3828803132 + +iguana/DB/SWAPS.old/.tmpmarker + +iguana/DB/SWAPS/2723832060-1788071166 + +iguana/DB/SWAPS/3210648667-2626363704 + +iguana/DB/SWAPS/415703857-2769362858 diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 0143aa77c..71e979bec 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -2927,7 +2927,7 @@ int32_t basilisk_swap_getsigscript(struct supernet_info *myinfo,char *symbol,uin { scriptlen >>= 1; decode_hex(script,scriptlen,hexstr); - char str[65]; printf("%s/v%d sigscript.(%s)\n",bits256_str(str,txid),vini,hexstr); + //char str[65]; printf("%s/v%d sigscript.(%s)\n",bits256_str(str,txid),vini,hexstr); } } free_json(retjson); @@ -2963,7 +2963,7 @@ bits256 dex_swap_spendtxid(struct supernet_info *myinfo,char *symbol,char *desta { spendtxid = jbits256(item,"hash"); strcpy(destaddr,addr); - printf("set spend addr.(%s) <- %s\n",addr,jprint(item,0)); + //printf("set spend addr.(%s) <- %s\n",addr,jprint(item,0)); break; } } @@ -3359,6 +3359,8 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag { if ( sentflags[BASILISK_ALICERECLAIM] != 0 || sentflags[BASILISK_ALICESPEND] != 0 ) return(1); + else if ( sentflags[BASILISK_BOBSPEND] != 0 ) // without ALICECLAIM this is loss due to inactivity + return(1); } } return(0); @@ -3381,6 +3383,7 @@ cJSON *basilisk_remember(struct supernet_info *myinfo,int64_t *KMDtotals,int64_t plocktime = dlocktime = 0; src[0] = dest[0] = bobcoin[0] = alicecoin[0] = 0; sprintf(fname,"%s/SWAPS/%u-%u",GLOBAL_DBDIR,requestid,quoteid), OS_compatible_path(fname); + printf("%s\n",fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) { if ( (item= cJSON_Parse(fstr)) != 0 ) @@ -3883,7 +3886,7 @@ char *basilisk_swaplist(struct supernet_info *myinfo) if ( (item= basilisk_remember(myinfo,KMDtotals,BTCtotals,requestid,quoteid)) != 0 ) { jaddi(array,item); - if ( (status= jstr(item,"status")) != 0 && strcmp(status,"pending") == 0 ) + if ( 1 && (status= jstr(item,"status")) != 0 && strcmp(status,"pending") == 0 ) break; } } diff --git a/iguana/DB/SWAPS/3210648667-2626363704 b/iguana/DB/SWAPS/3210648667-2626363704 deleted file mode 100644 index 890120802..000000000 --- a/iguana/DB/SWAPS/3210648667-2626363704 +++ /dev/null @@ -1 +0,0 @@ -{"src":"KMD","srcamount":99.65000000,"dest":"BTC","destamount":0.01279725,"requestid":3210648667,"quoteid":2626363704,"iambob":0,"state":63,"otherstate":191,"expiration":1492382391,"dlocktime":0,"plocktime":0,"secretAm":"41d77f89b7df4e6b4e037271af7171e5700ff78e","secretAm256":"2430481e893a8eb5dfebd803bad5e5db5dbfd7c4229e89c3412599688faaf6f4","secretBn":"58e3ed498bca71df2a09e4e083e1bfceaf37f17c","secretBn256":"4cbf23818c8ba08fc84634f2a4673f87b4ddb7b770910c83618c23478a16aed0","myprivs0":"e2f1c99ade4b40d6044db7fcc1c8440d754d984a32c29ef46fc70dc403cc5d6e","myprivs1":"7d252f9dd6ed55d4f2ac51672488c93c242bf96daab6fd9598eeced20150e8e9","privAm":"81956df0209ade7820e3642b0f1380a602670b96902f2622a4f6a454f571bbb2","pubA0":"46f8aa71581ffd70dfa22fc6fa7a1a287ba917e7eef4f28806b111fb5f2e6da3","pubB0":"2da1f98d4a628a5da9a0959db46b970dbfb41762c024123877cc7539149587ed","pubB1":"a5f17406afbcc29c0ffe103a672dd2457f833b6316439d81ee5d48afa3ae4070","myfee":"3415b8ed8853d86f986e4a932bb7d8f1b241a87b4b61e8597383f4c7dec90c2c","dest33":"025dddc7a1581b13535114dd4e6332f37420da35598b98d27ca319870abb9de7af"} diff --git a/iguana/DB/SWAPS/415703857-2769362858 b/iguana/DB/SWAPS/415703857-2769362858 deleted file mode 100644 index a06d1729b..000000000 --- a/iguana/DB/SWAPS/415703857-2769362858 +++ /dev/null @@ -1 +0,0 @@ -{"src":"BTC","srcamount":0.01577619,"dest":"KMD","destamount":118.45892649,"requestid":415703857,"quoteid":2769362858,"iambob":0,"state":1791,"otherstate":447,"expiration":1492383936,"dlocktime":1492383941,"plocktime":0,"secretAm":"218ec768f2df38385a08d3f3e0fd71c540243c69","secretAm256":"40cf46bc360cc79d8f29f2d3adb8cfd5d982b457a61b674dc3b3e9217c3e4496","secretBn":"86fe3a6d10f99d7396827c44767ef314d64a56d6","secretBn256":"bdf4fae7a167f185710269f3622bca4a254bf071751d2e1d7952be8a4a7c8208","myprivs0":"76605da8755998f3a8ede4920832754b6908a8ca01f3a68158a7e6b2da0711f4","myprivs1":"e4b2399987c4aff65cf73005361f182170e0de5a81e9ce6ed5cd74ad99554bf0","privAm":"baeb51e6ee3c4738482fbb352b3f097c23fb3e7e39b0836a6cbd115948e1f31d","pubA0":"7772d4a1471ada1ee192ff955c7115727ddff3383636949725c0307dfebc9eae","pubB0":"286f4c28533f12e50f328f481b73dd66fd4af3f18b6a65818ed1ff897e834e39","pubB1":"e0c4109251f7da8301e027d85b5d0dad95291362b835e003aa686dad326b5fe0","Bdeposit":"771c758300c47f6c63531e1f2cc50e57c96aaf014ef10004c0afcce64899bfdb","Apayment":"6f5ef3b1e7cd72a778abd167cc5c3a72224c1910c5d03167ee043bb003132b3e","myfee":"6f477936082053496fe46cd3a50d58a88c489e81e09db8b5781c279c4224eb6b","dest33":"0231a71ac00aed93b79f5b751d6b498cb1151314a18607328d5e79aec71deac205"}