From e9e83b6158ec9ab22944f54d9d94bf00b8076e54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 2 Feb 2018 14:46:39 +0200 Subject: [PATCH 1/5] airdropH --- iguana/exchanges/beertest | 3 +++ iguana/exchanges/mm.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 iguana/exchanges/beertest diff --git a/iguana/exchanges/beertest b/iguana/exchanges/beertest new file mode 100755 index 000000000..f0b08a985 --- /dev/null +++ b/iguana/exchanges/beertest @@ -0,0 +1,3 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BEER\",\"rel\":\"KMD\",\"fixed\":0.777,\"margin\":0.00001}" + diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index db8bc57b7..9d401a453 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -190,6 +190,32 @@ int main(int argc, const char * argv[]) printf("done vanitygen.(%s) done %u elapsed %d\n",argv[2],(uint32_t)time(NULL),(uint32_t)time(NULL) - timestamp); exit(0); } + else if ( argv[1] != 0 && strcmp(argv[1],"airdropH") == 0 && argv[2] != 0 ) + { + FILE *fp; uint8_t addrtype,rmd160[20]; char buf[256],coinaddr[64]; int32_t n,i; char *flag; + if ( (fp= fopen(argv[2],"rb")) != 0 ) + { + while ( fgets(buf,sizeof(buf),fp) > 0 ) + { + if ( (n= (int32_t)strlen(buf)) > 0 ) + buf[--n] = 0; + flag = 0; + for (i=0; i Date: Fri, 2 Feb 2018 14:54:28 +0200 Subject: [PATCH 2/5] Test --- iguana/exchanges/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 9d401a453..ee0e4433f 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -213,7 +213,7 @@ int main(int argc, const char * argv[]) printf("(%s) (%s) <- %s\n",buf,coinaddr,flag); } fclose(fp); - } + } else printf("couldnt open (%s)\n",argv[2]); exit(0); } sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); From d807d02659a373a096ba86f9caad75d0d98459b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 2 Feb 2018 14:57:43 +0200 Subject: [PATCH 3/5] Test --- iguana/exchanges/mm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index ee0e4433f..b0cb50465 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -206,12 +206,17 @@ int main(int argc, const char * argv[]) { buf[i] = 0; flag = &buf[i+1]; + break; } } - bitcoin_addr2rmd160("HUSH",28,&addrtype,rmd160,buf); - bitcoin_address("KMD",coinaddr,0,60,rmd160,20); - printf("(%s) (%s) <- %s\n",buf,coinaddr,flag); + if ( flag != 0 ) + { + bitcoin_addr2rmd160("HUSH",28,&addrtype,rmd160,buf); + bitcoin_address("KMD",coinaddr,0,60,rmd160,20); + printf("(%s) (%s) <- %s\n",buf,coinaddr,flag); + } else printf("parse error for (%s)\n",buf); } + printf("close (%s)\n",argv[2]); fclose(fp); } else printf("couldnt open (%s)\n",argv[2]); exit(0); From cb9f6322359c1c840da8ecc194eaba0fc70d4b3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 2 Feb 2018 15:01:18 +0200 Subject: [PATCH 4/5] Test --- iguana/exchanges/LP_etomic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_etomic.c b/iguana/exchanges/LP_etomic.c index f9ae0fb7b..a23cfff72 100644 --- a/iguana/exchanges/LP_etomic.c +++ b/iguana/exchanges/LP_etomic.c @@ -174,11 +174,12 @@ char *LP_etomicalice_start(struct basilisk_swap *swap) if ( strcmp(swap->I.alicestr,"ETH") == 0 ) { memset(&input,0,sizeof(input)); - return(aliceInitsEthDeal(input,txData)); + //return(aliceInitsEthDeal(input,txData)); } else { memset(&input20,0,sizeof(input20)); - return(aliceInitsErc20Deal(input20,txData)); + //return(aliceInitsErc20Deal(input20,txData)); } + return(0); } From 8e882efbefd714255b07098b92c743ea04d9479e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 2 Feb 2018 15:05:38 +0200 Subject: [PATCH 5/5] Test --- iguana/exchanges/mm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index b0cb50465..91ed65141 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -192,7 +192,7 @@ int main(int argc, const char * argv[]) } else if ( argv[1] != 0 && strcmp(argv[1],"airdropH") == 0 && argv[2] != 0 ) { - FILE *fp; uint8_t addrtype,rmd160[20]; char buf[256],coinaddr[64]; int32_t n,i; char *flag; + FILE *fp; double val,total = 0.; uint8_t addrtype,rmd160[20]; char buf[256],coinaddr[64]; int32_t n,i; char *flag; if ( (fp= fopen(argv[2],"rb")) != 0 ) { while ( fgets(buf,sizeof(buf),fp) > 0 ) @@ -213,7 +213,9 @@ int main(int argc, const char * argv[]) { bitcoin_addr2rmd160("HUSH",28,&addrtype,rmd160,buf); bitcoin_address("KMD",coinaddr,0,60,rmd160,20); - printf("(%s) (%s) <- %s\n",buf,coinaddr,flag); + val = atof(flag); + total += val; + printf("(%s) (%s) <- %.8f total %.8f\n",buf,coinaddr,val,total); } else printf("parse error for (%s)\n",buf); } printf("close (%s)\n",argv[2]);