From 41008d7385f9b12a5215bbc4a50e5534018d91a2 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 27 Jan 2017 01:22:56 +0100 Subject: [PATCH 001/682] OSX release build instructions --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 02e8c4218..5d987b574 100755 --- a/README.md +++ b/README.md @@ -222,3 +222,33 @@ sudo service ntp start Now things should be ready. To update and run notary node: pkill iguana; ./m_LP; tests/notaryinit + +##Building for OSX distribution## +Get OSX SDK 10.6 from https://github.com/ca333/MacOSX-SDKs/releases/tag/10.6 + +Unpack & move the .sdk folder to Xcodes SDK folder: + +```cd DownloadDirectory``` + +```mv MacOSX10.6.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/.``` + +If you are using Xcode > 7.3 add the new SDK to XCode by changing MinimumSDKVersion in your Info.plist: + +```vi /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist``` + +Change the value to: + +``` +MinimumSDKVersion +10.6 +``` +Build crypto777 library and agents with OSX release makefile: + +```./m_onetime m_osx_release``` + +Execute the OSX deploy script: + +``` +./osx_deploy.sh +``` +The iguana binary and its linked libraries are in ```/tmp/iguana```. From 32f7758570344251fda8d7e3bd8a9465e2e937d6 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 27 Jan 2017 01:28:59 +0100 Subject: [PATCH 002/682] OSX release build instructions update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d987b574..e0b8c4163 100755 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ Now things should be ready. To update and run notary node: pkill iguana; ./m_LP; tests/notaryinit -##Building for OSX distribution## +##Build for OSX distribution## Get OSX SDK 10.6 from https://github.com/ca333/MacOSX-SDKs/releases/tag/10.6 Unpack & move the .sdk folder to Xcodes SDK folder: From df485aca3ae9fc2d36f6ffa84b635d720726667a Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 27 Jan 2017 02:19:55 +0100 Subject: [PATCH 003/682] updated iguana deploy path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0b8c4163..3aa7e99dd 100755 --- a/README.md +++ b/README.md @@ -251,4 +251,4 @@ Execute the OSX deploy script: ``` ./osx_deploy.sh ``` -The iguana binary and its linked libraries are in ```/tmp/iguana```. +The iguana binary and its linked libraries are in ```$HOME/tmp/iguana```. From f3f20f107a9ef18d7a8b1dcf1950cdda951bbb7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 29 Mar 2017 18:48:50 +0300 Subject: [PATCH 004/682] Remove single unused/skipped function --- .gitignore | 2 + iguana/iguana_secp.c | 89 -------------------------------------------- 2 files changed, 2 insertions(+), 89 deletions(-) diff --git a/.gitignore b/.gitignore index 1d70ba0e5..e689f7231 100755 --- a/.gitignore +++ b/.gitignore @@ -216,3 +216,5 @@ iguana/autoAPI.md iguana/confs/5228bcea7ae2515a29c3844673de6ee2acba53bf45724744a00ff4306f192912 iguana/confs/630929d976025fafde221c7358eb5805f4359bad3c6b8bd50ad3f6e0a9b5ce78 + +iguana/confs/5f3283a017c31e52443d61cb43944e2157f7c03eb12d701ebf4a35a695688e1f diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index 614f970e4..c53170908 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -451,95 +451,6 @@ int32_t bitcoin_rangeproof(void *ctx,uint8_t *proof,uint8_t *commit,bits256 blin return(retval); } -/* - * The intended procedure for creating a multiparty signature is: - * - Each signer S[i] with private key x[i] and public key Q[i] runs - * secp256k1_schnorr_generate_nonce_pair to produce a pair (k[i],R[i]) of private/public nonces. - * - All signers communicate their public nonces to each other (revealing your - * private nonce can lead to discovery of your private key, so it should be considered secret). - * - All signers combine all the public nonces they received (excluding their - * own) using secp256k1_ec_pubkey_combine to obtain an Rall[i] = sum(R[0..i-1,i+1..n]). - * - All signers produce a partial signature using - * secp256k1_schnorr_partial_sign, passing in their own private key x[i], - * their own private nonce k[i], and the sum of the others' public nonces Rall[i]. - * - All signers communicate their partial signatures to each other. - * - Someone combines all partial signatures using secp256k1_schnorr_partial_combine, to obtain a full signature. - * - The resulting signature is validatable using secp256k1_schnorr_verify, with - * public key equal to the result of secp256k1_ec_pubkey_combine of the signers' public keys (sum(Q[0..n])). - * - * Note that secp256k1_schnorr_partial_combine and secp256k1_ec_pubkey_combine - * function take their arguments in any order, and it is possible to - * pre-combine several inputs already with one call, and add more inputs later - * by calling the function again (they are commutative and associative). - */ - -#ifdef test_schnorr -#include "secp256k1/src/util.h" -#include "secp256k1/src/hash_impl.h" -#include "secp256k1/src/testrand_impl.h" - -void test_schnorr_threshold(void *ctx) { - unsigned char msg[32]; - unsigned char sec[5][32]; - secp256k1_pubkey pub[5]; - unsigned char nonce[5][32]; - secp256k1_pubkey pubnonce[5]; - unsigned char sig[5][64]; - const unsigned char* sigs[5]; - unsigned char allsig[64]; - const secp256k1_pubkey* pubs[5]; - secp256k1_pubkey allpub; - int n, i; - int damage; - int ret = 0; - - damage = secp256k1_rand_bits(1) ? (1 + secp256k1_rand_int(4)) : 0; - secp256k1_rand256_test(msg); - n = 2 + secp256k1_rand_int(4); - for (i = 0; i < n; i++) { - do { - secp256k1_rand256_test(sec[i]); - } while (!secp256k1_ec_seckey_verify(ctx, sec[i])); - CHECK(secp256k1_ec_pubkey_create(ctx, &pub[i], sec[i])); - CHECK(secp256k1_schnorr_generate_nonce_pair(ctx, &pubnonce[i], nonce[i], msg, sec[i], NULL, NULL)); - pubs[i] = &pub[i]; - } - if (damage == 1) { - nonce[secp256k1_rand_int(n)][secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } else if (damage == 2) { - sec[secp256k1_rand_int(n)][secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } - for (i = 0; i < n; i++) { - secp256k1_pubkey allpubnonce; - const secp256k1_pubkey *pubnonces[4]; - int j; - for (j = 0; j < i; j++) { - pubnonces[j] = &pubnonce[j]; - } - for (j = i + 1; j < n; j++) { - pubnonces[j - 1] = &pubnonce[j]; - } - CHECK(secp256k1_ec_pubkey_combine(ctx, &allpubnonce, pubnonces, n - 1)); - ret |= (secp256k1_schnorr_partial_sign(ctx, sig[i], msg, sec[i], &allpubnonce, nonce[i]) != 1) * 1; - sigs[i] = sig[i]; - } - if (damage == 3) { - sig[secp256k1_rand_int(n)][secp256k1_rand_bits(6)] ^= 1 + secp256k1_rand_int(255); - } - ret |= (secp256k1_ec_pubkey_combine(ctx, &allpub, pubs, n) != 1) * 2; - if ((ret & 1) == 0) { - ret |= (secp256k1_schnorr_partial_combine(ctx, allsig, sigs, n) != 1) * 4; - } - if (damage == 4) { - allsig[secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } - if ((ret & 7) == 0) { - ret |= (secp256k1_schnorr_verify(ctx, allsig, msg, &allpub) != 1) * 8; - } - CHECK((ret == 0) == (damage == 0)); -} -#endif - int32_t iguana_pederson_test(void *ctx) { uint8_t commits[100][33],*commitptrs[100],proofs[100][5138]; uint16_t vouts[100]; int64_t min_value,values[100],totalpos,totalneg; bits256 txids[100],nonces[100],blinds[100],*blindptrs[100],blindsum; int32_t prooflens[100],i,r,pos,neg,numpos,exponent,min_bits,n,N = 100; From 304f05a02ad39b9374cc39227f39510746099117 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 29 Mar 2017 18:56:18 +0300 Subject: [PATCH 005/682] Remove single unused function out of 24 --- .gitignore | 10 +++++ .vscode/launch.json | 22 +++++++++++ README.md | 49 +++++------------------- iguana/iguana_secp.c | 89 -------------------------------------------- 4 files changed, 42 insertions(+), 128 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index d7f6bfab7..1ae724886 100755 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,13 @@ iguana/confs/BTC_hdrs.txt deprecated/.DS_Store .DS_Store + +iguana/help/.tmpmarker + +iguana/genesis/.tmpmarker + +iguana/help.json + +iguana/autoAPI.md + +iguana/basilisk.o-2ad8cb38 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..20c9e805a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C++ Launch (Windows)", + "type": "cppvsdbg", + "request": "launch", + "program": "enter program name, for example ${workspaceRoot}/a.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceRoot}", + "environment": [], + "externalConsole": false + }, + { + "name": "C++ Attach (Windows)", + "type": "cppvsdbg", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 3aa7e99dd..2d49a0b55 100755 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ iguana: most efficient bitcoin core implementation that can simultaneously be fu komodo: this is the top secret project I cant talk about publicly yet > #TL;DR# -> -> ```sudo apt-get update; sudo apt-get install git libcurl4-openssl-dev build-essential; git clone https://github.com/jl777/SuperNET; cd SuperNET; ./m_onetime m_unix;``` -> -> The above one line gets SuperNET installed, built and launched for unix. -> +> +> ```sudo apt-get update; sudo apt-get install git libcurl4-openssl-dev build-essential libnanomsg-dev; git clone https://github.com/jl777/SuperNET; cd SuperNET; ./m_onetime m_unix;``` +> +> The above one line gets SuperNET installed, built and launched for unix. +> > After that ```./m_unix``` updates to latest. > *Continue below at "Running".* @@ -44,6 +44,8 @@ The above two definitions need to be changed to match the mingw install on your You need to make sure the nacl sdk is properly installed and you are able to build the examples. Now you will need to get the external libs, which can be built from scratch using naclports or there use the reference builds of libcurl.a and libz.a in the SuperNET/crypto777/pnacl_libs. You can just copy those over into $(NACL_SDK_ROOT)//lib/pnacl. +##For android## +You have to build a native libnanomsg for android. This section is work in progress. Contact ca333@protonmail.ch for assistance on building latest iguana for android. #ONETIME# Now you are ready to build. @@ -103,14 +105,14 @@ Internally, all paths convert the request into a standard SuperNET JSON request. Another approach is to use the bitcoin RPC syntax via: curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"getinfo\",\"params\":[]}" the params:[] array is where the standard bitcoin parameters go, the only change that is needed is to specify the coin -alternatively {"agent":"SuperNET","method":"bitcoinrpc","coin":"BTCD"} will set the coin +alternatively {"agent":"SuperNET","method":"bitcoinrpc","coin":"BTCD"} will set the coin to use for bitcoin RPC calls. this will suffice in single coin environments curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana",\"method\":\"test\"}" curl --url "http://127.0.0.1:7778/iguana/test" -> html page with results curl --url "http://127.0.0.1:7778/api/iguana/test" -> just json text http://127.0.0.1:7778 -> superugly GUI -http://127.0.0.1:7778/iguana/test +http://127.0.0.1:7778/iguana/test http://127.0.0.1:7778/api/iguana/test postCall('{"agent":"iguana","method":"test"}'} iguana_JSON("{\"agent\":\"iguana",\"method\":\"test\"}"); -> direct C function call @@ -124,7 +126,7 @@ iguana can be invoked with a command line argument. if it is a name of a file, i "exchanges" -> { "name":"", ... } "apikey", "apisecret", "userid", "tradepassword" these are as expected "pollgap" -> gap between each access to exchange for getting prices - + on OSX mksquashfs is not native, you will need to install fuse: https://osxfuse.github.io/ and a squashfs for mac: https://github.com/vasi/squashfuse ********** @@ -221,34 +223,3 @@ sudo service ntp start Now things should be ready. To update and run notary node: pkill iguana; ./m_LP; tests/notaryinit - - -##Build for OSX distribution## -Get OSX SDK 10.6 from https://github.com/ca333/MacOSX-SDKs/releases/tag/10.6 - -Unpack & move the .sdk folder to Xcodes SDK folder: - -```cd DownloadDirectory``` - -```mv MacOSX10.6.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/.``` - -If you are using Xcode > 7.3 add the new SDK to XCode by changing MinimumSDKVersion in your Info.plist: - -```vi /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist``` - -Change the value to: - -``` -MinimumSDKVersion -10.6 -``` -Build crypto777 library and agents with OSX release makefile: - -```./m_onetime m_osx_release``` - -Execute the OSX deploy script: - -``` -./osx_deploy.sh -``` -The iguana binary and its linked libraries are in ```$HOME/tmp/iguana```. diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index f7a51164a..acc345d17 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -451,95 +451,6 @@ int32_t bitcoin_rangeproof(void *ctx,uint8_t *proof,uint8_t *commit,bits256 blin return(retval); } -/* - * The intended procedure for creating a multiparty signature is: - * - Each signer S[i] with private key x[i] and public key Q[i] runs - * secp256k1_schnorr_generate_nonce_pair to produce a pair (k[i],R[i]) of private/public nonces. - * - All signers communicate their public nonces to each other (revealing your - * private nonce can lead to discovery of your private key, so it should be considered secret). - * - All signers combine all the public nonces they received (excluding their - * own) using secp256k1_ec_pubkey_combine to obtain an Rall[i] = sum(R[0..i-1,i+1..n]). - * - All signers produce a partial signature using - * secp256k1_schnorr_partial_sign, passing in their own private key x[i], - * their own private nonce k[i], and the sum of the others' public nonces Rall[i]. - * - All signers communicate their partial signatures to each other. - * - Someone combines all partial signatures using secp256k1_schnorr_partial_combine, to obtain a full signature. - * - The resulting signature is validatable using secp256k1_schnorr_verify, with - * public key equal to the result of secp256k1_ec_pubkey_combine of the signers' public keys (sum(Q[0..n])). - * - * Note that secp256k1_schnorr_partial_combine and secp256k1_ec_pubkey_combine - * function take their arguments in any order, and it is possible to - * pre-combine several inputs already with one call, and add more inputs later - * by calling the function again (they are commutative and associative). - */ - -#ifdef test_schnorr -#include "secp256k1/src/util.h" -#include "secp256k1/src/hash_impl.h" -#include "secp256k1/src/testrand_impl.h" - -void test_schnorr_threshold(void *ctx) { - unsigned char msg[32]; - unsigned char sec[5][32]; - secp256k1_pubkey pub[5]; - unsigned char nonce[5][32]; - secp256k1_pubkey pubnonce[5]; - unsigned char sig[5][64]; - const unsigned char* sigs[5]; - unsigned char allsig[64]; - const secp256k1_pubkey* pubs[5]; - secp256k1_pubkey allpub; - int n, i; - int damage; - int ret = 0; - - damage = secp256k1_rand_bits(1) ? (1 + secp256k1_rand_int(4)) : 0; - secp256k1_rand256_test(msg); - n = 2 + secp256k1_rand_int(4); - for (i = 0; i < n; i++) { - do { - secp256k1_rand256_test(sec[i]); - } while (!secp256k1_ec_seckey_verify(ctx, sec[i])); - CHECK(secp256k1_ec_pubkey_create(ctx, &pub[i], sec[i])); - CHECK(secp256k1_schnorr_generate_nonce_pair(ctx, &pubnonce[i], nonce[i], msg, sec[i], NULL, NULL)); - pubs[i] = &pub[i]; - } - if (damage == 1) { - nonce[secp256k1_rand_int(n)][secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } else if (damage == 2) { - sec[secp256k1_rand_int(n)][secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } - for (i = 0; i < n; i++) { - secp256k1_pubkey allpubnonce; - const secp256k1_pubkey *pubnonces[4]; - int j; - for (j = 0; j < i; j++) { - pubnonces[j] = &pubnonce[j]; - } - for (j = i + 1; j < n; j++) { - pubnonces[j - 1] = &pubnonce[j]; - } - CHECK(secp256k1_ec_pubkey_combine(ctx, &allpubnonce, pubnonces, n - 1)); - ret |= (secp256k1_schnorr_partial_sign(ctx, sig[i], msg, sec[i], &allpubnonce, nonce[i]) != 1) * 1; - sigs[i] = sig[i]; - } - if (damage == 3) { - sig[secp256k1_rand_int(n)][secp256k1_rand_bits(6)] ^= 1 + secp256k1_rand_int(255); - } - ret |= (secp256k1_ec_pubkey_combine(ctx, &allpub, pubs, n) != 1) * 2; - if ((ret & 1) == 0) { - ret |= (secp256k1_schnorr_partial_combine(ctx, allsig, sigs, n) != 1) * 4; - } - if (damage == 4) { - allsig[secp256k1_rand_int(32)] ^= 1 + secp256k1_rand_int(255); - } - if ((ret & 7) == 0) { - ret |= (secp256k1_schnorr_verify(ctx, allsig, msg, &allpub) != 1) * 8; - } - CHECK((ret == 0) == (damage == 0)); -} -#endif - int32_t iguana_pederson_test(void *ctx) { uint8_t commits[100][33],*commitptrs[100],proofs[100][5138]; uint16_t vouts[100]; int64_t min_value,values[100],totalpos,totalneg; bits256 txids[100],nonces[100],blinds[100],*blindptrs[100],blindsum; int32_t prooflens[100],i,r,pos,neg,numpos,exponent,min_bits,n,N = 100; From 9b3029e69105831c0ba6fef3e6fea664e98cda76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 08:57:09 +0300 Subject: [PATCH 006/682] Test --- iguana/exchanges/LP_rpc.c | 11 ++--------- iguana/exchanges/LP_transaction.c | 11 +++++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 026100d56..746aa08f7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -73,15 +73,11 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t //return(retstr); } -change to nanomsg write only, enforce fee, comms api char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers,int32_t numutxos) { char url[512],*retstr; if ( (retstr= LP_isitme(destip,destport)) != 0 ) - { - free(retstr); - return(0); - } + return(retstr); sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&profit=%.6f&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,profitmargin,numpeers,numutxos); return(LP_issue_curl("notify",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); @@ -91,10 +87,7 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx { char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2; if ( (retstr= LP_isitme(destip,destport)) != 0 ) - { - free(retstr); - return(0); - } + return(retstr); if ( utxo->iambob == 0 ) { printf("issue_LP_notifyutxo trying to send Alice %s/v%d\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index ea9aaae24..b2d868576 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1329,10 +1329,13 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t datalen) { - // add verification and broadcast - memcpy(swap->otherfee.txbytes,data,datalen); - swap->otherfee.I.datalen = datalen; - swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen); + if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) + { + printf("amount %.8f -> %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr); + //memcpy(swap->otherfee.txbytes,data,datalen); + //swap->otherfee.I.datalen = datalen; + //swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen); + } return(0); } From 6dfa26c271389f138f798c5a3bbfae26a9fac9c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 09:29:21 +0300 Subject: [PATCH 007/682] Test --- iguana/exchanges/LP_forwarding.c | 63 +++++++++++++++++++------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index aac93163a..6e33c8e38 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -177,7 +177,7 @@ int32_t LP_forwarding_register(bits256 pubkey,char *publicaddr,uint16_t publicpo { if ( LP_send(peer->pushsock,argstr,arglen,0) != arglen ) printf("error sending command to %s:%u\n",peer->ipaddr,peer->port); - else printf("sent register to %s:%u\n",peer->ipaddr,peer->port); + //else printf("sent register to %s:%u\n",peer->ipaddr,peer->port); n++; } //printf("register.(%s) %s %u with (%s)\n",publicaddr,ipaddr,publicport,peer->ipaddr); @@ -296,9 +296,10 @@ char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,bits256 pubkey,char *jsonstr,int32_t freeflag) { - struct LP_forwardinfo *ptr; struct LP_peerinfo *peer,*tmp; char *msg,*hexstr,*retstr; int32_t len,retval = -1; cJSON *retjson,*reqjson,*argjson; + struct LP_forwardinfo *ptr; struct LP_peerinfo *peer,*tmp; char *msg,*hexstr,*retstr; int32_t len,n=0,mlen; cJSON *retjson,*reqjson,*argjson; if ( jsonstr == 0 || jsonstr[0] == 0 ) return(-1); + len = (int32_t)strlen(jsonstr) + 1; if ( bits256_nonz(pubkey) != 0 ) { if ( bits256_cmp(pubkey,LP_mypubkey) == 0 ) @@ -310,18 +311,36 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free(retstr); free_json(argjson); } + if ( freeflag != 0 ) + free(jsonstr); return(1); } - else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 && ptr->lasttime > time(NULL)-LP_KEEPALIVE ) + else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 )//&& ptr->lasttime > time(NULL)-LP_KEEPALIVE ) { printf("GOT FORWARDED.(%s) -> pushsock.%d\n",jsonstr,ptr->pushsock); - len = (int32_t)strlen(jsonstr); - if ( LP_send(ptr->pushsock,jsonstr,(int32_t)strlen(jsonstr)+1,0) == len+1 ) + if ( LP_send(ptr->pushsock,jsonstr,len,0) == len ) + { + if ( freeflag != 0 ) + free(jsonstr); return(1); + } } } + hexstr = malloc(len*2 + 1); + init_hexbytes_noT(hexstr,(uint8_t *)jsonstr,len); + if ( freeflag != 0 ) + free(jsonstr); + reqjson = cJSON_CreateObject(); + jaddstr(reqjson,"method","forwardhex"); + jaddstr(reqjson,"hex",hexstr); + jaddbits256(reqjson,"pubkey",pubkey); + free(hexstr); + msg = jprint(reqjson,1); + mlen = (int32_t)strlen(msg) + 1; HASH_ITER(hh,LP_peerinfos,peer,tmp) { + if ( bits256_cmp(pubkey,LP_mypubkey) == 0 ) + continue; if ( bits256_nonz(pubkey) != 0 ) { if ( (retstr= issue_LP_lookup(peer->ipaddr,peer->port,pubkey)) != 0 ) @@ -329,32 +348,24 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( jint(retjson,"forwarding") != 0 && peer->pushsock >= 0 ) - retval = 0; + { + printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,jsonstr); + if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) + n++; + } free_json(retjson); } free(retstr); } - } else retval = 0; - if ( retval >= 0 && peer->pushsock >= 0 ) - { - printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,jsonstr); - len = (int32_t)strlen(jsonstr) + 1; - hexstr = malloc(len*2 + 1); - init_hexbytes_noT(hexstr,(uint8_t *)jsonstr,len); - if ( freeflag != 0 ) - free(jsonstr); - reqjson = cJSON_CreateObject(); - jaddstr(reqjson,"method","forwardhex"); - jaddstr(reqjson,"hex",hexstr); - jaddbits256(reqjson,"pubkey",pubkey); - free(hexstr); - msg = jprint(reqjson,1); - return(LP_send(peer->pushsock,msg,(int32_t)strlen(msg)+1,1)); - } else retval = -1; + } + if ( n >= sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + break; } - if ( freeflag != 0 ) - free(jsonstr); - return(-1); + if ( msg != 0 ) + free(msg); + if ( n == 0 ) + return(-1); + else return(n-1); } From 643e96e33750ccf53a05640e9d16abee88a62492 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 09:41:28 +0300 Subject: [PATCH 008/682] Test --- iguana/exchanges/LP_swap.c | 2 +- iguana/exchanges/LP_transaction.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 6f0c8aa34..5a3c23266 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -556,7 +556,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba { decode_hex(rawtx->spendscript,hexlen,hexstr); rawtx->I.spendlen = hexlen; - bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); + bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx == &swap->otherfee ? rawtx->coin->pubtype : rawtx->coin->p2shtype,rawtx->spendscript,hexlen); //if ( swap != 0 ) // basilisk_txlog(swap->myinfoptr,swap,rawtx,-1); // bobdeposit, bobpayment or alicepayment retval = 0; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b2d868576..81743e794 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1331,10 +1331,12 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data { if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 ) { - printf("amount %.8f -> %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr); - //memcpy(swap->otherfee.txbytes,data,datalen); - //swap->otherfee.I.datalen = datalen; - //swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen); + printf("otherfee amount %.8f -> %s vs %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr); + if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 ) + { + printf("dexfee verified\n"); + return(0); + } } return(0); } From 84b22b046c3acd9c5bb400bd46e2f16cab93098f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 09:53:57 +0300 Subject: [PATCH 009/682] Test --- iguana/exchanges/LP_swap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 5a3c23266..3ae4b853a 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -545,7 +545,6 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( (txobj= bitcoin_data2json(rawtx->coin->taddr,rawtx->coin->pubtype,rawtx->coin->p2shtype,rawtx->coin->isPoS,height,&rawtx->I.signedtxid,&rawtx->msgtx,rawtx->extraspace,sizeof(rawtx->extraspace),data,datalen,0,suppress_pubkeys)) != 0 ) { rawtx->I.actualtxid = rawtx->I.signedtxid; - //char str[65]; printf("got %s txid.%s (%s)\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0)); rawtx->I.locktime = rawtx->msgtx.lock_time; if ( (vouts= jarray(&n,txobj,"vout")) != 0 && v < n ) { @@ -556,10 +555,16 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba { decode_hex(rawtx->spendscript,hexlen,hexstr); rawtx->I.spendlen = hexlen; - bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx == &swap->otherfee ? rawtx->coin->pubtype : rawtx->coin->p2shtype,rawtx->spendscript,hexlen); //if ( swap != 0 ) // basilisk_txlog(swap->myinfoptr,swap,rawtx,-1); // bobdeposit, bobpayment or alicepayment retval = 0; + if ( rawtx == &swap->otherfee ) + { + char str[65]; + LP_swap_coinaddr(swap,rawtx->coin,rawtx->p2shaddr,data,datalen); + + printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); + } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } } else printf("%s ERROR.(%s)\n",rawtx->name,jprint(txobj,0)); } From 89f378706a16d7f7f838f1c9a4cc2d367e3e823e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 10:21:57 +0300 Subject: [PATCH 010/682] Test --- iguana/exchanges/LP_forwarding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 6e33c8e38..e107765b5 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -349,7 +349,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, { if ( jint(retjson,"forwarding") != 0 && peer->pushsock >= 0 ) { - printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,jsonstr); + printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) n++; } @@ -358,7 +358,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free(retstr); } } - if ( n >= sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + if ( n >= 0 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } if ( msg != 0 ) From 056cf46638b0442a46e109a55ac0e481e49c36d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 10:51:48 +0300 Subject: [PATCH 011/682] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_ordermatch.c | 6 ++--- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_utxos.c | 45 +++++++++++++++++++++++++++----- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 7e44380f8..2d34b0c98 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -258,7 +258,7 @@ int32_t LP_isavailable(struct LP_utxoinfo *utxo); struct LP_peerinfo *LP_peerfind(uint32_t ipbits,uint16_t port); char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin); void LP_availableset(struct LP_utxoinfo *utxo); -int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2,bits256 pubkey); +int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d0e10ae02..b54557ea4 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -236,12 +236,12 @@ double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop { double qprice; uint64_t srcvalue,srcvalue2,destvalue,destvalue2; *autxop = *butxop = 0; - if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2,qp->srchash) == 0 ) + if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { printf("bob not eligible\n"); return(-2); } - if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout,qp->desthash) == 0 ) + if ( LP_iseligible(&destvalue,&destvalue2,0,qp->destcoin,qp->desttxid,qp->destvout,qp->destsatoshis,qp->feetxid,qp->feevout) == 0 ) { char str[65]; printf("alice not eligible (%.8f %.8f) %s/v%d\n",dstr(destvalue),dstr(destvalue2),bits256_str(str,qp->feetxid),qp->feevout); return(-3); @@ -673,10 +673,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,st char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); return(clonestr("{\"error\":\"cant find alice utxopair\"}")); } - printf("aliceutxo.%p\n",aliceutxo); if ( (bobutxo= LP_utxopairfind(1,qp->txid,qp->vout,qp->txid2,qp->vout2)) == 0 ) return(clonestr("{\"error\":\"cant find bob utxopair\"}")); - printf("bobutxo.%p\n",bobutxo); bobutxo->T.bestflag = (uint32_t)time(NULL); if ( (retstr= LP_registerall(0)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 746aa08f7..3771498b6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -94,7 +94,7 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx return(0); } u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout,utxo->pubkey) > 0 ) + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) > 0 ) { sprintf(url,"http://%s:%u/api/stats/notified?iambob=%d&pubkey=%s&profit=%.6f&coin=%s&txid=%s&vout=%d&value=%llu&txid2=%s&vout2=%d&value2=%llu&script=%s&address=%s×tamp=%u&gui=%s",destip,destport,utxo->iambob,bits256_str(str3,utxo->pubkey),utxo->S.profitmargin,utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,(long long)utxo->payment.value,bits256_str(str2,utxo->deposit.txid),utxo->deposit.vout,(long long)utxo->deposit.value,utxo->spendscript,utxo->coinaddr,(uint32_t)time(NULL),utxo->gui); if ( strlen(url) > 1024 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c05bfee6a..a47f6958e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -278,9 +278,9 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) return(item); } -int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2,bits256 pubkey) +int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,threshold; char destaddr[64],destaddr2[64]; + uint64_t val,val2=0,threshold; int32_t iter; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; destaddr[0] = destaddr2[0] = 0; if ( (val= LP_txvalue(destaddr,symbol,txid,vout)) >= satoshis ) { @@ -298,7 +298,34 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol return(1); } } else printf("no val2\n"); - } else printf("mismatched %s txid value %.8f < %.8f\n",symbol,dstr(val),dstr(satoshis)); + } + else + { + printf("mismatched %s txid value %.8f < %.8f\n",symbol,dstr(val),dstr(satoshis)); + for (iter=0; iter<2; iter++) + { + if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + } + } *valp = val; *val2p = val2; return(0); @@ -323,7 +350,7 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; - if ( LP_iseligible(&val,&val2,iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout,utxo->pubkey) == 0 ) + if ( LP_iseligible(&val,&val2,iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) { char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); continue; @@ -349,13 +376,17 @@ int32_t LP_inventory_prevent(int32_t iambob,bits256 txid,int32_t vout) struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { - struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; + uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; if ( symbol == 0 || destsatoshis == 0 ) return(0); HASH_ITER(hh,LP_utxoinfos[0],utxo,tmp) { + if ( strcmp(symbol,utxo->coin) != 0 ) + continue; //char str[65]; printf("[%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); - if ( strcmp(symbol,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) + if ( LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) + continue; + if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || utxo->S.satoshis < bestutxo->S.satoshis) ) bestutxo = utxo; @@ -442,7 +473,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); return(0); } - if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2,pubkey) <= 0 ) + if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { // iambob.0 utxoadd COQUI inactive.0 got ineligible txid value 1.20000000, value2 0.01000000, tmpsatoshis 1.20000000 printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); From f208e5291a0322a73b1af484ddb7777efcd35e95 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:01:17 +0300 Subject: [PATCH 012/682] Test --- iguana/exchanges/LP_prices.c | 4 +++- iguana/exchanges/LP_rpc.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8f879fffe..5aa34af35 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -541,7 +541,7 @@ int32_t LP_utxo_clientpublish(struct LP_utxoinfo *utxo) int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { - struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis; + struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis,val,val2; if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) baseid = basepp->ind; else return(num); @@ -556,6 +556,8 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamp > oldest && pubp->timestamp <= now ) { + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) + continue; if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) { if ( polarity > 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 3771498b6..fc0df6fa8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -105,6 +105,8 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx else { printf("issue_LP_notifyutxo: ineligible utxo iambob.%d %.8f %.8f\n",utxo->iambob,dstr(val),dstr(val2)); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); return(0); } } From 829679ff08cb9483809f14ba6c879e13d2f13e29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:07:36 +0300 Subject: [PATCH 013/682] Test --- iguana/exchanges/LP_utxos.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a47f6958e..7758c58aa 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -383,9 +383,13 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( strcmp(symbol,utxo->coin) != 0 ) continue; - //char str[65]; printf("[%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + char str[65]; printf("%d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); continue; + } if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || utxo->S.satoshis < bestutxo->S.satoshis) ) From 191f38d66b8b31a4293ce2bb7718cd35679796d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:18:15 +0300 Subject: [PATCH 014/682] Test --- iguana/exchanges/LP_utxos.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7758c58aa..3c07696cc 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -297,7 +297,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol *val2p = val2; return(1); } - } else printf("no val2\n"); + } // else printf("no val2\n"); } else { @@ -658,7 +658,7 @@ int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa cJSON *LP_inventory(char *symbol,int32_t iambob) { - struct LP_utxoinfo *utxo,*tmp; char *myipaddr; cJSON *array; + struct LP_utxoinfo *utxo,*tmp; struct _LP_utxoinfo u; char *myipaddr; cJSON *array; uint64_t val,val2; array = cJSON_CreateArray(); if ( LP_mypeer != 0 ) myipaddr = LP_mypeer->ipaddr; @@ -667,7 +667,15 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) { //char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypubkey)); if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 ) + { + u = (iambob != 0) ? utxo->deposit : utxo->fee; + if ( LP_iseligible(&val,&val2,iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); + } //else printf("skip %s %d %d %d %d\n",bits256_str(str,utxo->pubkey),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); } return(array); From 5a262a3aef2258a0a569ea61a3fb329632df72b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:21:11 +0300 Subject: [PATCH 015/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index e107765b5..b3656e2b4 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -358,7 +358,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free(retstr); } } - if ( n >= 0 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + if ( n >= 2 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } if ( msg != 0 ) From 24e26a8d40c1c537761a6a63469f7927de1f5b2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:24:07 +0300 Subject: [PATCH 016/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 16b515aa1..43e5fa59f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -282,14 +282,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int nonz += LP_subsock_check(ctx,origipaddr,pubsock,peer->subsock,profitmargin); } //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d forwarding\n",counter,LP_canbind); - if ( (counter % 600) == 20 ) + if ( (counter % 600) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase,profitmargin); if ( lastforward < now-3600 ) { if ( (retstr= LP_registerall(0)) != 0 ) free(retstr); - LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10); + //LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10); lastforward = now; } } From 6b97ceb5a6a18a4749c659bc2e1a8381d791d725 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:28:43 +0300 Subject: [PATCH 017/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3c07696cc..cc9cb9e7f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -383,7 +383,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( strcmp(symbol,utxo->coin) != 0 ) continue; - char str[65]; printf("%d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { if ( utxo->T.spentflag == 0 ) From b725d69fbf985cc546e57754e5dc3348761315a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:32:04 +0300 Subject: [PATCH 018/682] Test --- iguana/exchanges/LP_utxos.c | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index cc9cb9e7f..44eb677ef 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -299,31 +299,32 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - else + printf("mismatched %s txid value %.8f < %.8f\n",symbol,dstr(val),dstr(satoshis)); + for (iter=0; iter<2; iter++) { - printf("mismatched %s txid value %.8f < %.8f\n",symbol,dstr(val),dstr(satoshis)); - for (iter=0; iter<2; iter++) + if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { - if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) - { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) - { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) - { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } - if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) - { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - } + printf("iambob.%d case 00\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) + { + printf("iambob.%d case 01\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) + { + printf("iambob.%d case 10\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + } + if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) + { + printf("iambob.%d case 11\n",iter); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); } } *valp = val; From 864d5344026185d301b0afa92fbe8d20b41e72c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:36:27 +0300 Subject: [PATCH 019/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 44eb677ef..26252f89a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -299,7 +299,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - printf("mismatched %s txid value %.8f < %.8f\n",symbol,dstr(val),dstr(satoshis)); + char str[65],str2[65]; printf("spent %s txid or mismatched value %.8f < %.8f, %s/v%d %s/v%d\n",symbol,dstr(val),dstr(satoshis),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) From e65d0a383161d7e8e2b43601dc560d704f3a28d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:41:28 +0300 Subject: [PATCH 020/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 26252f89a..72dc2f5de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -280,7 +280,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,threshold; int32_t iter; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; + uint64_t val,val2=0,threshold=0; int32_t iter; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; destaddr[0] = destaddr2[0] = 0; if ( (val= LP_txvalue(destaddr,symbol,txid,vout)) >= satoshis ) { @@ -299,7 +299,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - char str[65],str2[65]; printf("spent %s txid or mismatched value %.8f < %.8f, %s/v%d %s/v%d\n",symbol,dstr(val),dstr(satoshis),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); + char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) From 7062ee4047f8fd89f5ef80d528be2aa82c486e81 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:44:12 +0300 Subject: [PATCH 021/682] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 72dc2f5de..5468c3a73 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -351,7 +351,7 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; - if ( LP_iseligible(&val,&val2,iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) == 0 ) { char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); continue; @@ -384,8 +384,8 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( strcmp(symbol,utxo->coin) != 0 ) continue; - char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); - if ( LP_iseligible(&srcvalue,&srcvalue2,1,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) + char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); From 0aac47cc33c9ba4332a0271d972066b437463794 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:47:32 +0300 Subject: [PATCH 022/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5468c3a73..041df4e3a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -304,25 +304,25 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { - printf("iambob.%d case 00\n",iter); + //printf("iambob.%d case 00\n",iter); if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } if ( (utxo= LP_utxo2find(iter,txid,vout)) != 0 ) { - printf("iambob.%d case 01\n",iter); + //printf("iambob.%d case 01\n",iter); if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } if ( (utxo= LP_utxofind(iter,txid2,vout2)) != 0 ) { - printf("iambob.%d case 10\n",iter); + //printf("iambob.%d case 10\n",iter); if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } if ( (utxo= LP_utxo2find(iter,txid2,vout2)) != 0 ) { - printf("iambob.%d case 11\n",iter); + //printf("iambob.%d case 11\n",iter); if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } From f016f95aa86a492bd04a64a0d37f632a0af9f66c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:51:20 +0300 Subject: [PATCH 023/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_utxos.c | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5aa34af35..1d7d239da 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -556,10 +556,10 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * //char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey)); if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamp > oldest && pubp->timestamp <= now ) { - if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) - continue; if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) { + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) + continue; if ( polarity > 0 ) basesatoshis = utxo->S.satoshis; else basesatoshis = utxo->S.satoshis * price; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 041df4e3a..6dd328819 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -384,17 +384,19 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( strcmp(symbol,utxo->coin) != 0 ) continue; - char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); - if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) - { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - continue; - } + //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || utxo->S.satoshis < bestutxo->S.satoshis) ) + { + if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) + { + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + continue; + } bestutxo = utxo; + } } } return(bestutxo); From 0ba0779b3630d0e67d7a45af1d91ca3acce2bc85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 11:58:50 +0300 Subject: [PATCH 024/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 43e5fa59f..49ce1c3ea 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -369,7 +369,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( coin->lastscanht == coin->longestchain ) continue; - else if ( coin->lastscanht > coin->longestchain ) + else if ( coin->lastscanht > coin->longestchain+1 ) { printf("detected chain rewind lastscanht.%d vs longestchain.%d, first.%d ref.%d\n",coin->lastscanht,coin->longestchain,coin->firstscanht,coin->firstrefht); LP_undospends(coin,coin->longestchain-1); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 81743e794..529e279a3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1338,7 +1338,7 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data return(0); } } - return(0); + return(-1); } /* Bob deposit: From dfe9a78896766f23f1d87b75c4507a312c346714 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 12:01:25 +0300 Subject: [PATCH 025/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 49ce1c3ea..93beef3d5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -367,7 +367,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int printf("detected %s firstrefht.%d < firstscanht.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht); coin->lastscanht = coin->firstscanht = coin->firstrefht; } - if ( coin->lastscanht == coin->longestchain ) + if ( coin->lastscanht == coin->longestchain+1 ) continue; else if ( coin->lastscanht > coin->longestchain+1 ) { From 51e248ebe977878f6b1b16514e7b19501e82d214 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 12:02:27 +0300 Subject: [PATCH 026/682] Test --- iguana/exchanges/LP_nativeDEX.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 93beef3d5..a239a73cd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -310,23 +310,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int // printf("lasttime set %s\n",bits256_str(str,utxo->payment.txid)); } } - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d swapentry\n",counter,LP_canbind); - if ( (counter % 6000) == 5999 ) - { - if ( (retstr= basilisk_swapentry(0,0)) != 0 ) - { - //printf("SWAPS.(%s)\n",retstr); - free(retstr); - } - } - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d pullsock check\n",counter,LP_canbind); nonz += LP_pullsock_check(ctx,&retstr,myipaddr,pubsock,pullsock,profitmargin); if ( retstr != 0 ) free(retstr); - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d hellos\n",counter,LP_canbind); if ( IAMLP != 0 && (counter % 600) == 42 ) LP_hellos(); - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d\n",counter,LP_canbind); if ( LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) { char keepalive[128]; @@ -388,6 +376,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht++; break; } + if ( (counter % 6000) == 60 ) + { + if ( (retstr= basilisk_swapentry(0,0)) != 0 ) + { + //printf("SWAPS.(%s)\n",retstr); + free(retstr); + } + } counter++; return(nonz); } From c1d7132ecd0d90cb88812bc342cf821e7530cd8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 12:05:06 +0300 Subject: [PATCH 027/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6dd328819..7c77c9980 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -506,13 +506,13 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit { utxo->T.errors++; char str[65],str2[65],str3[65],str4[65],str5[65],str6[65]; - if ( dispflag != 0 ) - printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(spendscript,utxo->spendscript) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); if ( utxo->T.spentflag != 0 || LP_txvalue(0,utxo->coin,utxo->payment.txid,utxo->payment.vout) < utxo->payment.value || LP_txvalue(0,utxo->coin,u.txid,u.vout) < u.value ) { if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); printf("original utxo pair not valid\n"); + if ( dispflag != 0 ) + printf("error on subsequent utxo iambob.%d %.8f %.8f add.(%s %s) when.(%s %s) %d %d %d %d %d %d %d %d %d %d %d pubkeys.(%s vs %s)\n",iambob,dstr(val),dstr(val2),bits256_str(str,txid),bits256_str(str2,txid2),bits256_str(str3,utxo->payment.txid),bits256_str(str4,utxo->deposit.txid),bits256_cmp(txid,utxo->payment.txid) != 0,bits256_cmp(txid2,u.txid) != 0,vout != utxo->payment.vout,tmpsatoshis != utxo->S.satoshis,vout2 != u.vout,value2 != u.value,strcmp(symbol,utxo->coin) != 0,strcmp(spendscript,utxo->spendscript) != 0,strcmp(coinaddr,utxo->coinaddr) != 0,bits256_cmp(pubkey,utxo->pubkey) != 0,value != utxo->payment.value,bits256_str(str5,pubkey),bits256_str(str6,utxo->pubkey)); utxo = 0; } } From ab5a0d0d7372317a0725feaf9ec709de9063e5b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 14:42:15 +0300 Subject: [PATCH 028/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index b3656e2b4..270b611c6 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -358,7 +358,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free(retstr); } } - if ( n >= 2 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } if ( msg != 0 ) From 021c45e06ad472eb91fb88a4a2e005910570efd0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 5 Jul 2017 14:47:08 +0300 Subject: [PATCH 029/682] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2d34b0c98..a9f39580c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -39,7 +39,7 @@ #define LP_PEERGOOD_ERRORDECAY 0.9 #define LP_SWAPSTEP_TIMEOUT 3 -#define LP_AUTOTRADE_TIMEOUT 10 +#define LP_AUTOTRADE_TIMEOUT 60 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 10 #define LP_MINCLIENTVOL 20 From 050a2b58ec668c81eb56b9f20bed1ebb74638a6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 11:35:00 +0300 Subject: [PATCH 030/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/coins | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 270b611c6..f41ae28ee 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -176,7 +176,7 @@ int32_t LP_forwarding_register(bits256 pubkey,char *publicaddr,uint16_t publicpo if ( peer->pushsock >= 0 ) { if ( LP_send(peer->pushsock,argstr,arglen,0) != arglen ) - printf("error sending command to %s:%u\n",peer->ipaddr,peer->port); + printf("you can ignore error sending command to %s:%u\n",peer->ipaddr,peer->port); //else printf("sent register to %s:%u\n",peer->ipaddr,peer->port); n++; } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b25dc824a..9b416291b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -63,7 +63,7 @@ int32_t LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) //portable_mutex_unlock(&LP_networkmutex); usleep(1000); } - printf("error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); + printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); if ( freeflag != 0 ) free(msg); return(-1); diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 90e4896c3..bd77ff509 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,4 +1,2 @@ -export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" - -#,{\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 7a111abcbcdf40b15799fd7920e6a83e2acf5d3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 12:23:13 +0300 Subject: [PATCH 031/682] Test --- iguana/exchanges/LP_commands.c | 6 ++++++ iguana/exchanges/message | 2 ++ 2 files changed, 8 insertions(+) create mode 100755 iguana/exchanges/message diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 465a0852f..5bb0f614d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -56,6 +56,11 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJ //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } + else if ( strcmp(method,"message") == 0 ) + { + printf("got message.(%s) from %s:%u\n",jprint(argjson,0),ipaddr!=0?ipaddr:"",argport); + return(0); + } else if ( strcmp(method,"nn_tests") == 0 ) return(clonestr("{\"result\":\"success\"}")); else if ( strcmp(method,"help") == 0 ) @@ -83,6 +88,7 @@ trust(pubkey, trust)\n\ register(pubkey,pushaddr)\n\ registerall(numnodes)\n\ lookup(pubkey)\n\ +message(pubkey,)\n\ forward(pubkey,method2,)\n\ forward(pubkey,method2=publish,)\n\ forwardhex(pubkey,hex)\n\ diff --git a/iguana/exchanges/message b/iguana/exchanges/message new file mode 100755 index 000000000..595ce00ad --- /dev/null +++ b/iguana/exchanges/message @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"forward\",\"method2\":\"message\",\"message\":\"some sort of message\"}" From 4959734d37fc8b08273683c2bf8830d005b82156 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 12:43:53 +0300 Subject: [PATCH 032/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5bb0f614d..d759c4723 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -245,7 +245,7 @@ forwardhex(pubkey,hex)\n\ retstr = clonestr("{\"result\":\"success\"}"); else retstr = clonestr("{\"result\":\"error forwarding\"}"); } else retstr = clonestr("{\"result\":\"cant recurse forwards\"}"); - + return(retstr); } else if ( strcmp(method,"keepalive") == 0 ) { From 86da3f78768f4c9842f9597e05e1445d25eb64f0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 12:59:42 +0300 Subject: [PATCH 033/682] Test --- iguana/exchanges/coins | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index bd77ff509..225cc88e9 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,3 @@ -export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 1dc7c0312af0be776bb478f322b997600a2c7124 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:22:40 +0300 Subject: [PATCH 034/682] Test --- iguana/exchanges/LP_forwarding.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index f41ae28ee..bf0033905 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -339,24 +339,19 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, mlen = (int32_t)strlen(msg) + 1; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( bits256_cmp(pubkey,LP_mypubkey) == 0 ) - continue; - if ( bits256_nonz(pubkey) != 0 ) + if ( (retstr= issue_LP_lookup(peer->ipaddr,peer->port,pubkey)) != 0 ) { - if ( (retstr= issue_LP_lookup(peer->ipaddr,peer->port,pubkey)) != 0 ) + if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) + if ( jint(retjson,"forwarding") != 0 && peer->pushsock >= 0 ) { - if ( jint(retjson,"forwarding") != 0 && peer->pushsock >= 0 ) - { - printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); - if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) - n++; - } - free_json(retjson); + printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); + if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) + n++; } - free(retstr); + free_json(retjson); } + free(retstr); } if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; From b1ba52e8a9adc18f9674e103e7f16bc7f6a32a98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:26:58 +0300 Subject: [PATCH 035/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index bf0033905..dc3b9902c 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -352,7 +352,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free_json(retjson); } free(retstr); - } + } else printf("%s:%u doesnt have pubkey\n",peer->ipaddr,peer->port); if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } From e179b6e1ea79479c52963ec67805dc6a09275e17 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:29:44 +0300 Subject: [PATCH 036/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index dc3b9902c..532067c1c 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -348,7 +348,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) n++; - } + } else printf("%s:%u doesnt forward pubkey (%s)\n",peer->ipaddr,peer->port,retstr); free_json(retjson); } free(retstr); From 3b2f61eff845d97a6ba74da8370077fae7f736f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:44:01 +0300 Subject: [PATCH 037/682] Test --- iguana/exchanges/LP_network.c | 8 ++++---- iguana/exchanges/install | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9b416291b..c592599c6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -107,7 +107,7 @@ void LP_psockloop(void *_ptr) { if ( (sentbytes= LP_send(sendsock,buf,size,0)) > 0 ) { - //printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); + printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); } else { @@ -150,7 +150,7 @@ void LP_psockloop(void *_ptr) } else if ( (pfds[n].revents & POLLIN) != 0 ) { - //printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); + printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); if ( (size= nn_recv(ptr->publicsock,&buf,NN_MSG,0)) > 0 ) { ptr->lasttime = now; @@ -176,7 +176,7 @@ void LP_psockloop(void *_ptr) { if ( (size= nn_recv(ptr->sendsock,&buf,NN_MSG,0)) > 0 ) { - //printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); + printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); ptr->lasttime = now; if ( ptr->ispaired != 0 ) { @@ -201,7 +201,7 @@ void LP_psockloop(void *_ptr) if ( retval != 0 ) printf("nn_poll retval.%d\n",retval); break; - } // else printf("num pfds.%d retval.%d\n",n,retval); + } else printf("num pfds.%d retval.%d\n",n,retval); } } //free(pfds); diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 30a86e730..b1ce26149 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts echo now in dexscripts directory where you can make customized scripts that wont conflict with git pull #cp ../exchanges/passphrase ../exchanges/userpass . From 0a1bd85a3c2f1825ec1e4d53d553ce9b44d07aca Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:52:04 +0300 Subject: [PATCH 038/682] Test --- iguana/exchanges/LP_network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c592599c6..991e025ac 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -107,7 +107,7 @@ void LP_psockloop(void *_ptr) { if ( (sentbytes= LP_send(sendsock,buf,size,0)) > 0 ) { - printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); + //printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); } else { @@ -150,7 +150,7 @@ void LP_psockloop(void *_ptr) } else if ( (pfds[n].revents & POLLIN) != 0 ) { - printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); + //printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); if ( (size= nn_recv(ptr->publicsock,&buf,NN_MSG,0)) > 0 ) { ptr->lasttime = now; @@ -176,7 +176,7 @@ void LP_psockloop(void *_ptr) { if ( (size= nn_recv(ptr->sendsock,&buf,NN_MSG,0)) > 0 ) { - printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); + //printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); ptr->lasttime = now; if ( ptr->ispaired != 0 ) { @@ -201,7 +201,7 @@ void LP_psockloop(void *_ptr) if ( retval != 0 ) printf("nn_poll retval.%d\n",retval); break; - } else printf("num pfds.%d retval.%d\n",n,retval); + } //else printf("num pfds.%d retval.%d\n",n,retval); } } //free(pfds); From d29ec0feed71bc5e0d87d30b238fe50a5665d720 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:55:29 +0300 Subject: [PATCH 039/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 991e025ac..35dc811b5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -107,7 +107,7 @@ void LP_psockloop(void *_ptr) { if ( (sentbytes= LP_send(sendsock,buf,size,0)) > 0 ) { - //printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); + printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); } else { @@ -201,7 +201,7 @@ void LP_psockloop(void *_ptr) if ( retval != 0 ) printf("nn_poll retval.%d\n",retval); break; - } //else printf("num pfds.%d retval.%d\n",n,retval); + } else printf("num pfds.%d retval.%d\n",n,retval); } } //free(pfds); From b812ba23d66c9b17ba97ea2fad5cc2b218c3253a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 13:57:50 +0300 Subject: [PATCH 040/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 35dc811b5..c592599c6 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -150,7 +150,7 @@ void LP_psockloop(void *_ptr) } else if ( (pfds[n].revents & POLLIN) != 0 ) { - //printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); + printf("publicsock.%d %s has pollin\n",ptr->publicsock,ptr->publicaddr); if ( (size= nn_recv(ptr->publicsock,&buf,NN_MSG,0)) > 0 ) { ptr->lasttime = now; @@ -176,7 +176,7 @@ void LP_psockloop(void *_ptr) { if ( (size= nn_recv(ptr->sendsock,&buf,NN_MSG,0)) > 0 ) { - //printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); + printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); ptr->lasttime = now; if ( ptr->ispaired != 0 ) { From 37d3cedbc03e54b030f373a26c75abc35c1de77e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 14:06:52 +0300 Subject: [PATCH 041/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 532067c1c..25a1c9b4c 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -353,7 +353,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, } free(retstr); } else printf("%s:%u doesnt have pubkey\n",peer->ipaddr,peer->port); - if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + if ( n >= 3 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } if ( msg != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c592599c6..a97f4b413 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -94,7 +94,7 @@ uint32_t LP_swapsend(int32_t pairsock,struct basilisk_swap *swap,uint32_t msgbit return(nextbits); } -void LP_psockloop(void *_ptr) +void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to work { static struct nn_pollfd *pfds; int32_t i,n,nonz,iter,retval,size=0,sentbytes,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512];//,*myipaddr = _ptr; From 9642090bef31117dbfc2028e3306a9263b175cd4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 15:19:43 +0300 Subject: [PATCH 042/682] Test --- basilisk/basilisk_bitcoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index ad1165fd0..ae7937fe9 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -602,7 +602,7 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi free_json(vins); return(rawtx); } - //printf("duplicatesTX.(%s)\n",rawtx); + printf("splitfunds tx.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( signedtxidp != 0 ) { if ( (signedtx= iguana_signrawtx(myinfo,coin,0,signedtxidp,completedp,vins,rawtx,0,0)) != 0 ) From f2e66d90e3f426d9ab3eabae25dd1a9399a2e1bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 15:53:15 +0300 Subject: [PATCH 043/682] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d759c4723..636afeb11 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -108,6 +108,7 @@ forwardhex(pubkey,hex)\n\ } if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,USERPASS) != 0 ) return(clonestr("{\"error\":\"authentication error\"}")); + jdelete(argjson,"userpass"); if ( base != 0 && rel != 0 ) { double price,bid,ask; From 5f2c13641a510adf74a697a48c32e1d437e3765c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 16:09:03 +0300 Subject: [PATCH 044/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 25a1c9b4c..532067c1c 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -353,7 +353,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, } free(retstr); } else printf("%s:%u doesnt have pubkey\n",peer->ipaddr,peer->port); - if ( n >= 3 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) + if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } if ( msg != 0 ) From 153f6f399295f00604e0008f302aee18fbb3ebdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 17:15:03 +0300 Subject: [PATCH 045/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_forwarding.c | 6 ++++-- iguana/exchanges/LP_network.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 636afeb11..0678fc459 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -295,7 +295,7 @@ forwardhex(pubkey,hex)\n\ { if ( strcmp(method,"register") == 0 ) { - printf("nonLP got (%s)\n",jprint(argjson,0)); + //printf("nonLP got (%s)\n",jprint(argjson,0)); retstr = clonestr("{\"result\":\"success\",\"register\":\"received\"}"); } } diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 532067c1c..9a6659dc2 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -176,8 +176,10 @@ int32_t LP_forwarding_register(bits256 pubkey,char *publicaddr,uint16_t publicpo if ( peer->pushsock >= 0 ) { if ( LP_send(peer->pushsock,argstr,arglen,0) != arglen ) - printf("you can ignore error sending command to %s:%u\n",peer->ipaddr,peer->port); - //else printf("sent register to %s:%u\n",peer->ipaddr,peer->port); + { + if ( strncmp(peer->ipaddr,"5.9.253",strlen("5.9.253")) == 0 ) + printf("error registering with %s:%u\n",peer->ipaddr,peer->port); + } n++; } //printf("register.(%s) %s %u with (%s)\n",publicaddr,ipaddr,publicport,peer->ipaddr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a97f4b413..0950cbf0d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -63,7 +63,7 @@ int32_t LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) //portable_mutex_unlock(&LP_networkmutex); usleep(1000); } - printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); + //printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); if ( freeflag != 0 ) free(msg); return(-1); From f5a5d49950cefc15b56a2cbc78ecc2d14dfdfc15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 17:29:32 +0300 Subject: [PATCH 046/682] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a9f39580c..dec2d2cc7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -25,7 +25,7 @@ #define LP_COMMAND_RECVSOCK NN_PULL #define LP_MAXPUBKEY_ERRORS 3 -#define PSOCK_KEEPALIVE 3600 +#define PSOCK_KEEPALIVE (3600 * 24) #define MAINLOOP_PERSEC 10 #define MAX_PSOCK_PORT 60000 #define MIN_PSOCK_PORT 10000 From 952c33b5910ba39273fcd13049e2730c90a8bbd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 17:38:40 +0300 Subject: [PATCH 047/682] Test --- iguana/exchanges/LP_forwarding.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 9a6659dc2..c02d84489 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -335,26 +335,18 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, reqjson = cJSON_CreateObject(); jaddstr(reqjson,"method","forwardhex"); jaddstr(reqjson,"hex",hexstr); - jaddbits256(reqjson,"pubkey",pubkey); free(hexstr); msg = jprint(reqjson,1); mlen = (int32_t)strlen(msg) + 1; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( (retstr= issue_LP_lookup(peer->ipaddr,peer->port,pubkey)) != 0 ) + if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( jint(retjson,"forwarding") != 0 && peer->pushsock >= 0 ) - { - printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); - if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) - n++; - } else printf("%s:%u doesnt forward pubkey (%s)\n",peer->ipaddr,peer->port,retstr); - free_json(retjson); - } - free(retstr); - } else printf("%s:%u doesnt have pubkey\n",peer->ipaddr,peer->port); + //printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); + if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) + n++; + free_json(retjson); + } if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } From 8cd0439c2964b61e4780c9b06dd04e87cf6e2d2a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 17:53:33 +0300 Subject: [PATCH 048/682] Test --- iguana/exchanges/LP_forwarding.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index c02d84489..edc712b0d 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -298,7 +298,7 @@ char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,bits256 pubkey,char *jsonstr,int32_t freeflag) { - struct LP_forwardinfo *ptr; struct LP_peerinfo *peer,*tmp; char *msg,*hexstr,*retstr; int32_t len,n=0,mlen; cJSON *retjson,*reqjson,*argjson; + struct LP_forwardinfo *ptr; struct LP_peerinfo *peer,*tmp; char *msg,*hexstr,*retstr; int32_t len,n=0,mlen; cJSON *reqjson,*argjson; if ( jsonstr == 0 || jsonstr[0] == 0 ) return(-1); len = (int32_t)strlen(jsonstr) + 1; @@ -340,13 +340,9 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, mlen = (int32_t)strlen(msg) + 1; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - //printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); - if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) - n++; - free_json(retjson); - } + //printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,msg); + if ( LP_send(peer->pushsock,msg,mlen,0) == mlen ) + n++; if ( n >= 8 )//sizeof(default_LPnodes)/sizeof(*default_LPnodes) ) break; } From 44ee5b58eae0fdb6596cc54ed9e480b5d13b9e6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:05:37 +0300 Subject: [PATCH 049/682] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- iguana/exchanges/LP_utxos.c | 4 ++-- iguana/exchanges/mm.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 3aba41ed2..a90eb7bab 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2083,7 +2083,7 @@ char *bitcoin_address(char *coinaddr,uint8_t taddr,uint8_t addrtype,uint8_t *pub return(coinaddr); } -void iguana_priv2pub(void *ctx,uint8_t *pubkey33,char *coinaddr,bits256 privkey,uint8_t taddr,uint8_t addrtype) +void bitcoin_priv2pub(void *ctx,uint8_t *pubkey33,char *coinaddr,bits256 privkey,uint8_t taddr,uint8_t addrtype) { bits256 pub; //char privstr[65],url[512],postdata[1024],*retstr,*pubstr,*addr; cJSON *retjson; memset(pubkey33,0,33); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7c77c9980..827cca91e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -807,10 +807,10 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); else { - privkey = iguana_wif2privkey(wifstr); + bitcoin_wif2priv(&tmptype,&privkey,wifstr); //printf("WIF.(%s) -> %s\n",wifstr,bits256_str(str,privkey)); } - iguana_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); + bitcoin_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) { coin->counter++; diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 1babc9d76..3f07735af 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -198,7 +198,7 @@ char *DEX_listunspent(char *coin,char *coinaddr) return(bitcoind_RPC(0,"dex",url,0,"listunspent",postdata,0)); } -bits256 iguana_wif2privkey(char *wifstr) +/*bits256 iguana_wif2privkey(char *wifstr) { char url[512],postdata[1024],*retstr,*privstr; bits256 privkey; cJSON *retjson; memset(privkey.bytes,0,sizeof(privkey)); @@ -218,7 +218,7 @@ bits256 iguana_wif2privkey(char *wifstr) free(retstr); } return(privkey); -} +}*/ double bittrex_balance(char *base,char *coinaddr) { From 1c9b8d8f638cb10b5d5dade8519f7e7cb853c25a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:07:55 +0300 Subject: [PATCH 050/682] Test --- iguana/exchanges/LP_utxos.c | 7 +++++-- iguana/exchanges/mm.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 827cca91e..9ea9a6ab8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -802,13 +802,16 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; - bits256 privkey,userpub,userpass; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; + bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; if ( passphrase != 0 && passphrase[0] != 0 ) conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); else { + char str[65],str2[65]; + checkkey = iguana_wif2privkey(wifstr); bitcoin_wif2priv(&tmptype,&privkey,wifstr); - //printf("WIF.(%s) -> %s\n",wifstr,bits256_str(str,privkey)); + if ( bits256_cmp(checkkey,privkey) != 0 ) + printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey)); } bitcoin_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 3f07735af..1babc9d76 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -198,7 +198,7 @@ char *DEX_listunspent(char *coin,char *coinaddr) return(bitcoind_RPC(0,"dex",url,0,"listunspent",postdata,0)); } -/*bits256 iguana_wif2privkey(char *wifstr) +bits256 iguana_wif2privkey(char *wifstr) { char url[512],postdata[1024],*retstr,*privstr; bits256 privkey; cJSON *retjson; memset(privkey.bytes,0,sizeof(privkey)); @@ -218,7 +218,7 @@ char *DEX_listunspent(char *coin,char *coinaddr) free(retstr); } return(privkey); -}*/ +} double bittrex_balance(char *base,char *coinaddr) { From a6cc45a5b269272a5a4d410abdb32cc85002405a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:09:38 +0300 Subject: [PATCH 051/682] Test --- iguana/exchanges/LP_utxos.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9ea9a6ab8..93c1c55fc 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -807,11 +807,14 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); else { - char str[65],str2[65]; - checkkey = iguana_wif2privkey(wifstr); bitcoin_wif2priv(&tmptype,&privkey,wifstr); - if ( bits256_cmp(checkkey,privkey) != 0 ) - printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey)); + if ( 0 ) + { + char str[65],str2[65]; + checkkey = iguana_wif2privkey(wifstr); + if ( bits256_cmp(checkkey,privkey) != 0 ) + printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey)); + } } bitcoin_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) From ec347f6b5188022be0bd45fa2e62aba6ca59f0b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:12:11 +0300 Subject: [PATCH 052/682] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a239a73cd..7fbe7971f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -512,6 +512,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit profitmargin = 0.01 + (double)(rand() % 100)/100000; printf("default profit margin %f\n",profitmargin); } + printf("getting myipaddr\n"); if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) { if ( (myipaddr= OS_filestr(&filesize,"/tmp/myipaddr")) != 0 && myipaddr[0] != 0 ) @@ -544,12 +545,15 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit printf(">>>>>>>>> myipaddr.%s (%s) pullsock.%d\n",myipaddr,subaddr,pubsock); LP_mypubsock = pubsock; } + printf("got %s, initpeers\n",myipaddr); LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode"),profitmargin); + printf("get public socket\n"); pullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); strcpy(LP_publicaddr,pushaddr); LP_publicport = mypullport; LP_deadman_switch = (uint32_t)time(NULL); printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,pullsock,mypullport); + printf("initcoins\n"); LP_initcoins(ctx,pubsock,jobj(argjson,"coins"),passphrase); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) { @@ -561,8 +565,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } - if ( (retstr= basilisk_swapentry(0,0)) != 0 ) - free(retstr); + //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) + // free(retstr); while ( 1 ) { //fprintf(stderr,"."); From 0f6508af9c5c65e5bf1c18cff56ce27748be9618 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:15:13 +0300 Subject: [PATCH 053/682] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fc0df6fa8..283979683 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -140,6 +140,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) { + printf("from %s:%u (%s)\n",peer->ipaddr,peer->port,retstr); if ( (addr= jstr(retjson,"publicaddr")) != 0 ) safecopy(publicaddr,addr,128); if ( (addr= jstr(retjson,"connectaddr")) != 0 ) @@ -150,7 +151,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) } printf("got.(%s) connect.%s public.%s\n",retstr,connectaddr,publicaddr); free(retstr); - } + } else printf("error psock from %s:%u\n",peer->ipaddr,peer->port); if ( publicport != 0 ) break; } From ac9338462568b019da4df9311e009c2dbbf7d338 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:16:07 +0300 Subject: [PATCH 054/682] Test --- iguana/exchanges/cancelorder | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/cancelorder diff --git a/iguana/exchanges/cancelorder b/iguana/exchanges/cancelorder new file mode 100755 index 000000000..31f46e020 --- /dev/null +++ b/iguana/exchanges/cancelorder @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"REVS\",\"rel\":\"KMD\",\"price\":9999999.99}" From 5a8916f2e4d8b9fc46caffdfd59738b7385065f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:19:08 +0300 Subject: [PATCH 055/682] Test --- iguana/exchanges/LP_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 283979683..bcb72608f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -127,6 +127,7 @@ char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport,ispaired); //return(LP_issue_curl("psock",destip,destport,url)); retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); + printf("issue_LP_psock got (%s) from %s\n",retstr,destip); return(retstr); } From 6673159e13e0b2fe7a5c8593a6e1637b2e3826dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:21:59 +0300 Subject: [PATCH 056/682] Test --- iguana/exchanges/LP_network.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0950cbf0d..c349f3b86 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -232,11 +232,20 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w else if ( now > ptr->lastping+PSOCK_KEEPALIVE/2 && ptr->errors < 3 ) { ptr->lastping = now; - sendsock = ptr->sendsock; - sprintf(keepalive,"{\"method\":\"keepalive\",\"endpoint\":\"%s\"}",ptr->sendaddr); - size = (int32_t)strlen(keepalive) + 1; - buf = keepalive; - printf("send keepalive.(%s)\n",keepalive); + if ( 0 ) + { + sendsock = ptr->sendsock; + sprintf(keepalive,"{\"method\":\"keepalive\",\"endpoint\":\"%s\"}",ptr->sendaddr); + size = (int32_t)strlen(keepalive) + 1; + buf = keepalive; + printf("send keepalive.(%s)\n",keepalive); + } + else + { + nn_freemsg(buf); + buf = 0; + size = 0; + } break; } } From 02c7e80d91265f703c6040cbafc709b8ddc9dcba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:41:40 +0300 Subject: [PATCH 057/682] Test --- iguana/exchanges/LP_commands.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0678fc459..f44b39f76 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -58,7 +58,19 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJ } else if ( strcmp(method,"message") == 0 ) { - printf("got message.(%s) from %s:%u\n",jprint(argjson,0),ipaddr!=0?ipaddr:"",argport); + static char *laststr; + char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); + if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypubkey) == 0 ) + { + newstr = jprint(argjson,0); + if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) + { + printf("got message.(%s) from %s:%u\n",newstr,ipaddr!=0?ipaddr:"",argport); + if ( laststr != 0 ) + free(laststr); + laststr = newstr; + } + } return(0); } else if ( strcmp(method,"nn_tests") == 0 ) From 3f5f9b063971a57c16908d9f1757e541f5b8fe73 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:45:42 +0300 Subject: [PATCH 058/682] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index dec2d2cc7..a9f39580c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -25,7 +25,7 @@ #define LP_COMMAND_RECVSOCK NN_PULL #define LP_MAXPUBKEY_ERRORS 3 -#define PSOCK_KEEPALIVE (3600 * 24) +#define PSOCK_KEEPALIVE 3600 #define MAINLOOP_PERSEC 10 #define MAX_PSOCK_PORT 60000 #define MIN_PSOCK_PORT 10000 From 789af16a8a062bcd5b973b5da4d0065149673044 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:48:54 +0300 Subject: [PATCH 059/682] Test --- iguana/exchanges/LP_forwarding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index edc712b0d..195432837 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -247,7 +247,7 @@ char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) if ( reqjson != 0 ) { retstr = LP_command_process(ctx,LP_mypeer != 0 ? LP_mypeer->ipaddr : "127.0.0.1",LP_mypubsock,reqjson,0,0,LP_profitratio - 1.); - printf("LP_forwardhex.(%s) -> (%s)\n",jprint(reqjson,0),retstr!=0?retstr:""); + //printf("LP_forwardhex.(%s) -> (%s)\n",jprint(reqjson,0),retstr!=0?retstr:""); if ( pubsock >= 0 ) { msg = jprint(reqjson,0); From 991a304d06ac93db931a3284854b4f13ffc48827 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 18:57:39 +0300 Subject: [PATCH 060/682] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7fbe7971f..c547dfc0c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,7 +17,9 @@ // LP_nativeDEX.c // marketmaker // -// activate orderbook timeouts +// swap cancel should cleanly cancel +// stronger anti rejected utxo pair into swap statemachine +// as much as possible on a unidirectional basis // verify bid volumes // stats // auto-utxo creation @@ -315,7 +317,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); if ( IAMLP != 0 && (counter % 600) == 42 ) LP_hellos(); - if ( LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) + if ( 0 && LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) { char keepalive[128]; sprintf(keepalive,"{\"method\":\"keepalive\"}"); @@ -453,7 +455,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profitmargin,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { - char *myipaddr=0,*retstr; long filesize,n; int32_t timeout,pullsock=-1,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); + char *myipaddr=0; long filesize,n; int32_t timeout,pullsock=-1,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); if ( passphrase == 0 || passphrase[0] == 0 ) { printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); From 88b858ab5eabebda7e99948bdd779211266ba27f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 19:05:26 +0300 Subject: [PATCH 061/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c349f3b86..a46155fe3 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -176,7 +176,7 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w { if ( (size= nn_recv(ptr->sendsock,&buf,NN_MSG,0)) > 0 ) { - printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); + //printf("%s paired has pollin (%s)\n",ptr->sendaddr,(char *)buf); ptr->lasttime = now; if ( ptr->ispaired != 0 ) { From 88cef257c465365384566a31fdf139988d04b172 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 19:10:39 +0300 Subject: [PATCH 062/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_swap.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c547dfc0c..5bdbab8d3 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,6 +21,7 @@ // stronger anti rejected utxo pair into swap statemachine // as much as possible on a unidirectional basis // verify bid volumes +// debounce comms // stats // auto-utxo creation diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 3ae4b853a..5b9a1c0ee 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -686,11 +686,11 @@ void LP_bobloop(void *_swap) basilisk_bobdeposit_refund(swap,swap->I.putduration); //printf("depositlen.%d\n",swap->bobdeposit.I.datalen); LP_swapsfp_update(&swap->I.req); - if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT,LP_verify_otherfee) < 0 ) + if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_otherfee) < 0 ) printf("error waiting for alicefee\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) printf("error sending bobdeposit\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT,LP_verify_alicepayment) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_alicepayment) < 0 ) printf("error waiting for alicepayment\n"); else { @@ -742,7 +742,7 @@ void LP_aliceloop(void *_swap) LP_swapsfp_update(&swap->I.req); if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x80,data,maxlen,&swap->myfee,0x40,0) == 0 ) printf("error sending alicefee\n"); - else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT,LP_verify_bobdeposit) < 0 ) + else if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_bobdeposit) < 0 ) printf("error waiting for bobdeposit\n"); else if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x1000,data,maxlen,&swap->alicepayment,0x800,0) == 0 ) printf("error sending alicepayment\n"); @@ -754,7 +754,7 @@ void LP_aliceloop(void *_swap) sleep(LP_SWAPSTEP_TIMEOUT); } swap->sentflag = 1; - if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT,LP_verify_bobpayment) < 0 ) + if ( LP_waitfor(swap->N.pair,swap,LP_SWAPSTEP_TIMEOUT*3,LP_verify_bobpayment) < 0 ) printf("error waiting for bobpayment\n"); else { From 4ece544e000a0d79b52ce54e7b34a50160a80ecf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 19:20:16 +0300 Subject: [PATCH 063/682] Test --- iguana/exchanges/LP_swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 5b9a1c0ee..e5fff82ea 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -671,7 +671,7 @@ void LP_bobloop(void *_swap) expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT; if ( swap != 0 ) { - if ( LP_waitsend("pubkeys",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) + if ( LP_waitsend("pubkeys",60,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) printf("error waitsend pubkeys\n"); else if ( LP_waitsend("choosei",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_choosei_verify,LP_choosei_data) < 0 ) printf("error waitsend choosei\n"); @@ -729,7 +729,7 @@ void LP_aliceloop(void *_swap) if ( swap != 0 ) { fprintf(stderr,"start swap iamalice pair.%d\n",swap->N.pair); - if ( LP_sendwait("pubkeys",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) + if ( LP_sendwait("pubkeys",60,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) printf("error LP_sendwait pubkeys\n"); else if ( LP_sendwait("choosei",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_choosei_verify,LP_choosei_data) < 0 ) printf("error LP_sendwait choosei\n"); From d97fea4619fbfed1d1cf8190b31f4e89e3c2a89f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 20:32:51 +0300 Subject: [PATCH 064/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a46155fe3..c450e4bc3 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); + sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); return(str); } From cf3cd9dd0ad3329c5f4a00c8bbcc674a563d3bf2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 21:54:40 +0300 Subject: [PATCH 065/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c450e4bc3..a46155fe3 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port); + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); return(str); } From 9f8e1596125da9e93d50fe87588493f580b58fa3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:19:44 +0300 Subject: [PATCH 066/682] Test --- iguana/exchanges/LP_ordermatch.c | 42 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b54557ea4..a4ed8c53c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -562,7 +562,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee) { - int64_t satoshis,destsatoshis; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,vout,numasks; double bestmetric=0.,metric,vol,price,bestprice = 0.; struct LP_pubkeyinfo *pubp; + int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,vout,numasks; double bestmetric=0.,metric,vol,price,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; *bestdestsatoshisp = 0; if ( duration <= 0 ) @@ -599,23 +599,26 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh metric = price / bestprice; if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 )//&& butxo->T.bestflag == 0 ) { - destsatoshis = ((butxo->S.satoshis - txfee) * price); - if ( destsatoshis > autxo->payment.value-desttxfee-1 ) - destsatoshis = autxo->payment.value-desttxfee-1; - satoshis = (destsatoshis / price + 0.0000000049) - txfee; - if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) + if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { - printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); - metric = dstr(destsatoshis) * metric * metric * metric; - if ( bestmetric == 0. || metric < bestmetric ) + destsatoshis = ((butxo->S.satoshis - txfee) * price); + if ( destsatoshis > autxo->payment.value-desttxfee-1 ) + destsatoshis = autxo->payment.value-desttxfee-1; + satoshis = (destsatoshis / price + 0.0000000049) - txfee; + if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { - bestutxo = butxo; - *ordermatchpricep = price; - *bestdestsatoshisp = destsatoshis; - bestmetric = metric; - printf("set best!\n"); - } - } else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); + printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); + metric = dstr(destsatoshis) * metric * metric * metric; + if ( bestmetric == 0. || metric < bestmetric ) + { + bestutxo = butxo; + *ordermatchpricep = price; + *bestdestsatoshisp = destsatoshis; + bestmetric = metric; + printf("set best!\n"); + } + } else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); + } } else { @@ -724,7 +727,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,st char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) { - int64_t desttxfee,txfee,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*bestutxo = 0; double ordermatchprice=0.; struct LP_quoteinfo Q; + int64_t desttxfee,txfee,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) @@ -746,6 +749,11 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargi return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypubkey,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); + if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) + { + printf("quote validate error %.0f\n",qprice); + return(clonestr("{\"error\":\"quote validation error\"}")); + } printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); return(LP_trade(ctx,myipaddr,mypubsock,profitmargin,&Q,maxprice,timeout,duration)); } From c7d7e4bc59154dd98079830f6a03d6036ef05c70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:22:27 +0300 Subject: [PATCH 067/682] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a4ed8c53c..ebff3a247 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -619,6 +619,11 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh } } else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); } + else + { + if ( butxo->T.spentflag == 0 ) + butxo->T.spentflag = (uint32_t)time(NULL); + } } else { From 19b36a430ec5cea420a2d3fa67b34aec9d82e139 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:23:42 +0300 Subject: [PATCH 068/682] Test --- iguana/exchanges/debug | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 iguana/exchanges/debug diff --git a/iguana/exchanges/debug b/iguana/exchanges/debug new file mode 100755 index 000000000..02017001a --- /dev/null +++ b/iguana/exchanges/debug @@ -0,0 +1,8 @@ +source passphrase +source coins +pkill -15 marketmaker; +git pull; +cd ..; +./m_mm; +gdb -args ./marketmaker "{\"gui\":\"nogui\",\"client\":1, \"userhome\":\"/${HOME#"/"}\", \"passphrase\":\"$passphrase\", \"coins\":$coins}" + From f2f04888f68a1e12e5facecd2709c5193295d4cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:31:26 +0300 Subject: [PATCH 069/682] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/install | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a9f39580c..2629b7033 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -41,8 +41,8 @@ #define LP_SWAPSTEP_TIMEOUT 3 #define LP_AUTOTRADE_TIMEOUT 60 #define LP_MIN_TXFEE 10000 -#define LP_MINVOL 10 -#define LP_MINCLIENTVOL 20 +#define LP_MINVOL 20 +#define LP_MINCLIENTVOL 100 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) #define LP_DEPOSITSATOSHIS(satoshis) ((satoshis) + (satoshis >> 3)) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index b1ce26149..145548421 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,4 @@ -cp register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts -echo now in dexscripts directory where you can make customized scripts that wont conflict with git pull #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 967d9af1ea6b9b75a1fda80914a7d215466568c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:44:14 +0300 Subject: [PATCH 070/682] Test --- iguana/exchanges/LP_utxos.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 93c1c55fc..b35ba7a1f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -114,6 +114,8 @@ int32_t LP_utxoaddptrs(struct LP_utxoinfo *ptrs[],int32_t n,struct LP_utxoinfo * int32_t LP_utxocollisions(struct LP_utxoinfo *ptrs[],struct LP_utxoinfo *refutxo) { int32_t iambob,n = 0; struct LP_utxoinfo *utxo; struct _LP_utxoinfo u; + if ( refutxo == 0 ) + return(0); portable_mutex_lock(&LP_utxomutex); for (iambob=0; iambob<=1; iambob++) { @@ -175,17 +177,20 @@ void LP_unavailableset(struct LP_utxoinfo *utxo,bits256 otherpubkey) void LP_availableset(struct LP_utxoinfo *utxo) { struct LP_utxoinfo *ptrs[8]; int32_t i,n,count = 0; struct _LP_utxoinfo u; - memset(ptrs,0,sizeof(ptrs)); - if ( (n= LP_utxocollisions(ptrs,utxo)) > 0 ) - { - for (i=0; i 0 ) + if ( utxo != 0 ) { - u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - char str[65],str2[65]; printf("UTXO.[%d] AVAIL %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n); + memset(ptrs,0,sizeof(ptrs)); + if ( (n= LP_utxocollisions(ptrs,utxo)) > 0 ) + { + for (i=0; i 0 ) + { + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + char str[65],str2[65]; printf("UTXO.[%d] AVAIL %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n); + } } } @@ -229,6 +234,8 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; jaddstr(item,"method","notified"); + if ( utxo == 0 ) + return(item); if ( utxo->gui[0] != 0 ) jaddstr(item,"gui",utxo->gui); jaddstr(item,"coin",utxo->coin); From dc478dfefa4f77ec8d684b5d90f20584ccc36db0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 22:46:29 +0300 Subject: [PATCH 071/682] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b35ba7a1f..a036fb6f6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -412,6 +412,8 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) { cJSON *argjson; struct _LP_utxoinfo u; char *msg; + if ( utxo == 0 ) + return; utxo->T.spentflag = (uint32_t)time(NULL); if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) LP_mypeer->numutxos--; @@ -489,7 +491,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( LP_iseligible(&val,&val2,iambob,symbol,txid,vout,tmpsatoshis,txid2,vout2) <= 0 ) { - // iambob.0 utxoadd COQUI inactive.0 got ineligible txid value 1.20000000, value2 0.01000000, tmpsatoshis 1.20000000 printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); return(0); } From ca8cf5a09b97ca86dc531301cf2429e5de44ee97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 23:10:18 +0300 Subject: [PATCH 072/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index a036fb6f6..09051fc3c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -704,13 +704,13 @@ int32_t LP_maxvalue(uint64_t *values,int32_t n) return(maxi); } -int32_t LP_nearestvalue(uint64_t *values,int32_t n,uint64_t targetval) +int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targetval) { int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1 << 31); for (i=0; i= 0 && dist < mindist ) { @@ -767,9 +767,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr targetval = (depositval / 776) + 100000; else targetval = (depositval / 9) * 8 + 100000; //printf("i.%d %.8f target %.8f\n",i,dstr(depositval),dstr(targetval)); - if ( (i= LP_nearestvalue(values,n,targetval)) < 0 && iambob != 0 ) + if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 && iambob != 0 ) targetval /= 4; - if ( (i= LP_nearestvalue(values,n,targetval)) >= 0 ) + if ( (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { item = jitem(array,i); txid = jbits256(item,"txid"); From df6da37f58f811fefb3c876c1610439d5585eeb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 6 Jul 2017 23:41:47 +0300 Subject: [PATCH 073/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a46155fe3..55bef4a2e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -30,7 +30,7 @@ uint16_t Numpsocks,Psockport = MIN_PSOCK_PORT; char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t port) { - sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); + sprintf(str,"tcp://%s:%u",bindflag == 0 ? ipaddr : "*",port); // ws is worse return(str); } @@ -63,7 +63,7 @@ int32_t LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) //portable_mutex_unlock(&LP_networkmutex); usleep(1000); } - //printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); + printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); if ( freeflag != 0 ) free(msg); return(-1); From 0a316c1379ca44ea8b014142ef34ee86f111a5f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 07:45:41 +0300 Subject: [PATCH 074/682] test --- iguana/exchanges/LP_nativeDEX.c | 5 ++-- iguana/exchanges/LP_rpc.c | 42 +++++++++++++-------------------- iguana/iguana_sign.c | 2 +- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5bdbab8d3..fd0e2c581 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,12 +18,13 @@ // marketmaker // // swap cancel should cleanly cancel -// stronger anti rejected utxo pair into swap statemachine // as much as possible on a unidirectional basis -// verify bid volumes +// queuing // debounce comms // stats // auto-utxo creation +// multiple smartaddresses? enable/disable causes? 250 KMD bounty +// verify bid volumes #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bcb72608f..0387c161a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -111,15 +111,23 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx } } -/*char *issue_LP_register(char *destip,uint16_t destport,bits256 pubkey,char *ipaddr,uint16_t pushport) +char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) { - char url[512],str[65],*retstr; - sprintf(url,"http://%s:%u/api/stats/register?client=%s&pushaddr=%s&pushport=%u",destip,destport,bits256_str(str,pubkey),ipaddr,pushport); - //return(LP_issue_curl("register",destip,destport,url)); - retstr = issue_curlt(url,LP_HTTP_TIMEOUT); - //printf("register.(%s) -> (%s)\n",url,retstr!=0?retstr:""); - return(retstr); -}*/ + char url[512],str[65]; + sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey)); + //printf("getutxo.(%s)\n",url); + return(LP_issue_curl("lookup",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); +} + +char *issue_LP_getprices(char *destip,uint16_t destport) +{ + char url[512]; + sprintf(url,"http://%s:%u/api/stats/getprices",destip,destport); + //printf("getutxo.(%s)\n",url); + return(LP_issue_curl("getprices",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); +} char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) { @@ -159,24 +167,6 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) return(publicport); } -char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) -{ - char url[512],str[65]; - sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey)); - //printf("getutxo.(%s)\n",url); - return(LP_issue_curl("lookup",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} - -char *issue_LP_getprices(char *destip,uint16_t destport) -{ - char url[512]; - sprintf(url,"http://%s:%u/api/stats/getprices",destip,destport); - //printf("getutxo.(%s)\n",url); - return(LP_issue_curl("getprices",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} - cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { char *retstr; cJSON *retjson = 0; diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 3e96145c2..b1fee7f0e 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -1276,7 +1276,7 @@ cJSON *bitcoin_txcreate(char *symbol,int32_t isPoS,int64_t locktime,uint32_t txv cJSON *json = cJSON_CreateObject(); jaddnum(json,"version",txversion); if ( locktime == 0 && strcmp(symbol,"KMD") == 0 ) - locktime = (uint32_t)time(NULL); + locktime = (uint32_t)time(NULL) - 55; jaddnum(json,"locktime",locktime); if ( isPoS != 0 ) jaddnum(json,"timestamp",timestamp == 0 ? time(NULL) : timestamp); From e75539bab55425fa94ecdfc408f06bcfef662a53 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 08:05:30 +0300 Subject: [PATCH 075/682] test --- iguana/exchanges/LP_network.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 55bef4a2e..e82bddc5e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -240,12 +240,6 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w buf = keepalive; printf("send keepalive.(%s)\n",keepalive); } - else - { - nn_freemsg(buf); - buf = 0; - size = 0; - } break; } } From 5ed18c9fe62a307df7549a398760cf5fd6aea4ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 14:39:33 +0300 Subject: [PATCH 076/682] New networking --- iguana/exchanges/LP_coins.c | 22 ++- iguana/exchanges/LP_commands.c | 84 ++++++--- iguana/exchanges/LP_forwarding.c | 58 +++--- iguana/exchanges/LP_include.h | 9 +- iguana/exchanges/LP_nativeDEX.c | 302 ++++++++++++++++++++----------- iguana/exchanges/LP_network.c | 280 +++++++++++++++++++++++----- iguana/exchanges/LP_ordermatch.c | 60 +++--- iguana/exchanges/LP_peers.c | 54 +++++- iguana/exchanges/LP_prices.c | 32 +--- iguana/exchanges/LP_rpc.c | 8 +- iguana/exchanges/LP_swap.c | 19 +- iguana/exchanges/LP_utxos.c | 72 ++++++-- iguana/exchanges/mm.c | 3 +- 13 files changed, 711 insertions(+), 292 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 697823cc6..4d71b4df6 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -18,7 +18,7 @@ // marketmaker // -char *portstrs[][2] = { { "BTC", "8332" }, { "KMD", "7771" } }; +char *portstrs[][3] = { { "BTC", "8332" }, { "KMD", "7771", "7772" } }; uint16_t LP_rpcport(char *symbol) { @@ -29,6 +29,15 @@ uint16_t LP_rpcport(char *symbol) return(0); } +uint16_t LP_busport(uint16_t rpcport) +{ + if ( rpcport == 8332 ) + return(8334); // BTC + else if ( rpcport < (1 << 15) ) + return(65535 - rpcport); + else return(rpcport+1); +} + char *parse_conf_line(char *line,char *field) { line += strlen(field); @@ -204,7 +213,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) return(coin); } -int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t taddr) +int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t taddr,uint16_t busport) { char *name2; memset(coin,0,sizeof(*coin)); @@ -219,6 +228,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->p2shtype = p2shtype; coin->wiftype = wiftype; coin->inactive = (uint32_t)time(NULL); + coin->bussock = LP_coinbus(busport); if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; @@ -237,11 +247,13 @@ int32_t LP_isdisabled(char *base,char *rel) struct iguana_info *LP_coinfind(char *symbol) { - struct iguana_info *coin,cdata; int32_t isPoS,longestchain = 1; uint16_t port; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname; + struct iguana_info *coin,cdata; int32_t isPoS,longestchain = 1; uint16_t port,busport; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname; if ( (coin= LP_coinsearch(symbol)) != 0 ) return(coin); if ( (port= LP_rpcport(symbol)) == 0 ) return(0); + if ( (busport= LP_busport(port)) == 0 ) + return(0); isPoS = 0; txfee = 10000; estimatedrate = 20; @@ -261,7 +273,7 @@ struct iguana_info *LP_coinfind(char *symbol) else if ( strcmp(symbol,"KMD") == 0 ) name = "komodo"; else return(0); - if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0) > 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,busport) > 0 ) { if ( (coin= LP_coinadd(&cdata)) != 0 ) { @@ -300,7 +312,7 @@ struct iguana_info *LP_coincreate(cJSON *item) name = assetname; else if ( (name= jstr(item,"name")) == 0 ) name = symbol; - if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr")) < 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr"),LP_busport(port)) < 0 ) { coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f44b39f76..b880f0e10 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -51,16 +51,16 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJ printf("stats_JSON no method: (%s) (%s:%u)\n",jprint(argjson,0),ipaddr,argport); return(0); } - if ( strcmp(method,"hello") == 0 ) + /*if ( strcmp(method,"hello") == 0 ) { //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else if ( strcmp(method,"message") == 0 ) + else*/ if ( strcmp(method,"message") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); - if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypubkey) == 0 ) + if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypub25519) == 0 ) { newstr = jprint(argjson,0); if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) @@ -73,8 +73,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJ } return(0); } - else if ( strcmp(method,"nn_tests") == 0 ) - return(clonestr("{\"result\":\"success\"}")); + //else if ( strcmp(method,"nn_tests") == 0 ) + // return(clonestr("{\"result\":\"success\"}")); else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ @@ -96,15 +96,19 @@ getutxos()\n\ getutxos(coin, lastn)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ +sendmessage(base=coin, rel="", pubkey=zero, )\n\ trust(pubkey, trust)\n\ -register(pubkey,pushaddr)\n\ -registerall(numnodes)\n\ -lookup(pubkey)\n\ -message(pubkey,)\n\ -forward(pubkey,method2,)\n\ -forward(pubkey,method2=publish,)\n\ -forwardhex(pubkey,hex)\n\ \"}")); + + /* + register(pubkey,pushaddr)\n\ + registerall(numnodes)\n\ + lookup(pubkey)\n\ + forward(pubkey,method2,)\n\ + forward(pubkey,method2=publish,)\n\ + forwardhex(pubkey,hex)\n\ + */ + base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); if ( USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) @@ -114,13 +118,22 @@ forwardhex(pubkey,hex)\n\ USERPASS_COUNTER = 1; retjson = cJSON_CreateObject(); jaddstr(retjson,"userpass",USERPASS); - jaddbits256(retjson,"mypubkey",LP_mypubkey); + jaddbits256(retjson,"mypubkey",LP_mypub25519); jadd(retjson,"coins",LP_coinsjson()); return(jprint(retjson,1)); } if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,USERPASS) != 0 ) return(clonestr("{\"error\":\"authentication error\"}")); jdelete(argjson,"userpass"); + if ( strcmp(method,"sendmessage") == 0 ) + { + cJSON *reqjson; + if ( (reqjson= LP_dereference(argjson,"sendmessage")) != 0 ) + { + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(reqjson,1)); + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"couldnt dereference sendmessage\"}")); + } if ( base != 0 && rel != 0 ) { double price,bid,ask; @@ -240,15 +253,15 @@ forwardhex(pubkey,hex)\n\ return(jprint(LP_coinsjson(),1)); else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); - else if ( strcmp(method,"broadcast") == 0 ) - retstr = LP_broadcasted(argjson); + //else if ( strcmp(method,"broadcast") == 0 ) + // retstr = LP_broadcasted(argjson); else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); - else if ( strcmp(method,"registerall") == 0 ) - return(LP_registerall(jint(argjson,"numnodes"))); - else if ( strcmp(method,"forward") == 0 ) + //else if ( strcmp(method,"registerall") == 0 ) + // return(LP_registerall(jint(argjson,"numnodes"))); + /*else if ( strcmp(method,"forward") == 0 ) { cJSON *reqjson; if ( (reqjson= LP_dereference(argjson,"forward")) != 0 ) @@ -265,7 +278,7 @@ forwardhex(pubkey,hex)\n\ printf("got keepalive lag.%d switch.%u\n",(int32_t)time(NULL) - LP_deadman_switch,LP_deadman_switch); LP_deadman_switch = (uint32_t)time(NULL); return(clonestr("{\"result\":\"success\"}")); - } + }*/ else if ( strcmp(method,"getpeers") == 0 ) return(LP_peers()); else if ( strcmp(method,"getutxos") == 0 ) @@ -280,16 +293,37 @@ forwardhex(pubkey,hex)\n\ { if ( IAMLP != 0 ) { - if ( strcmp(method,"register") == 0 ) + /*if ( strcmp(method,"register") == 0 ) { retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"),juint(argjson,"pushport")); //printf("got (%s) from register\n",retstr!=0?retstr:""); return(retstr); } else if ( strcmp(method,"lookup") == 0 ) - return(LP_lookup(jbits256(argjson,"client"))); - else if ( strcmp(method,"forwardhex") == 0 ) - retstr = LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex")); + return(LP_lookup(jbits256(argjson,"client")));*/ + if ( strcmp(method,"broadcast") == 0 ) + { + cJSON *reqjson; bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; + if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) + { + if ( (cipherstr= jstr(reqjson,"cipherstr")) != 0 ) + { + cipherlen = (int32_t)strlen(cipherstr) >> 1; + if ( cipherlen <= sizeof(cipher) ) + { + decode_hex(cipher,cipherlen,cipherstr); + LP_queuesend(LP_mypubsock,base,rel,cipher,cipherlen); + } else retstr = clonestr("{\"error\":\"cipherstr too big\"}"); + } + else + { + memset(zero.bytes,0,sizeof(zero)); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,1)); + } + retstr = clonestr("{\"result\":\"success\"}"); + } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); + //retstr = LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex")); + } else if ( strcmp(method,"psock") == 0 ) { if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) @@ -305,11 +339,11 @@ forwardhex(pubkey,hex)\n\ } else { - if ( strcmp(method,"register") == 0 ) + /*if ( strcmp(method,"register") == 0 ) { //printf("nonLP got (%s)\n",jprint(argjson,0)); retstr = clonestr("{\"result\":\"success\",\"register\":\"received\"}"); - } + }*/ } } if ( retstr != 0 ) diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 195432837..0106e7296 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -18,6 +18,19 @@ // marketmaker // +cJSON *LP_dereference(cJSON *argjson,char *excludemethod) +{ + cJSON *reqjson = 0; + if ( jstr(argjson,"method2") != 0 && strncmp(excludemethod,jstr(argjson,"method2"),strlen(excludemethod)) != 0 ) + { + reqjson = jduplicate(argjson); + jdelete(reqjson,"method"); + jaddstr(reqjson,"method",jstr(argjson,"method2")); + } + return(reqjson); +} + +/* struct LP_forwardinfo { UT_hash_handle hh; @@ -183,19 +196,6 @@ int32_t LP_forwarding_register(bits256 pubkey,char *publicaddr,uint16_t publicpo n++; } //printf("register.(%s) %s %u with (%s)\n",publicaddr,ipaddr,publicport,peer->ipaddr); - /*if ( (retstr= issue_LP_register(peer->ipaddr,peer->port,pubkey,ipaddr,publicport)) != 0 ) - { - //printf("[%s] LP_register.(%s) returned.(%s)\n",publicaddr,peer->ipaddr,retstr); - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( jint(retjson,"registered") != 0 && ++n >= max ) - retval = 0; - free_json(retjson); - } - free(retstr); - } else printf("timeout registering with %s errs.%d good.%d\n",peer->ipaddr,peer->errors,peer->good); - if ( retval == 0 ) - break;*/ } free(argstr); return(n); @@ -220,18 +220,6 @@ char *LP_registerall(int32_t numnodes) return(jprint(retjson,1)); } -cJSON *LP_dereference(cJSON *argjson,char *excludemethod) -{ - cJSON *reqjson = 0; - if ( jstr(argjson,"method2") != 0 && strncmp(excludemethod,jstr(argjson,"method2"),strlen(excludemethod)) != 0 ) - { - reqjson = jduplicate(argjson); - jdelete(reqjson,"method"); - jaddstr(reqjson,"method",jstr(argjson,"method2")); - } - return(reqjson); -} - char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) { struct LP_forwardinfo *ptr=0; uint8_t *data; int32_t datalen=0,sentbytes=0; char *msg,*retstr=0; cJSON *retjson=0,*argjson=0,*reqjson=0; @@ -257,16 +245,20 @@ char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) } else if ( (ptr= LP_forwardfind(pubkey)) != 0 ) { - if ( ptr->pushsock >= 0 )//&& ptr->hello != 0 ) + if ( ptr->pushsock >= 0 ) { printf("%s forwardhex.(%s)\n",ptr->pushaddr,(char *)data); sentbytes = LP_send(ptr->pushsock,(char *)data,datalen,0); } retjson = cJSON_CreateObject(); - if ( sentbytes == datalen ) + if ( sentbytes >= 0 ) { jaddstr(retjson,"result","success"); - jaddnum(retjson,"forwarded",sentbytes); + if ( sentbytes == datalen ) + jaddnum(retjson,"forwarded",sentbytes); + else if ( sentbytes == 0 ) + jaddnum(retjson,"queued",sentbytes); + else jaddnum(retjson,"mismatch",sentbytes); retstr = jprint(retjson,1); } else @@ -317,15 +309,11 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, free(jsonstr); return(1); } - else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 )//&& ptr->lasttime > time(NULL)-LP_KEEPALIVE ) + else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 ) { printf("GOT FORWARDED.(%s) -> pushsock.%d\n",jsonstr,ptr->pushsock); - if ( LP_send(ptr->pushsock,jsonstr,len,0) == len ) - { - if ( freeflag != 0 ) - free(jsonstr); + if ( LP_send(ptr->pushsock,jsonstr,len,freeflag) == len ) return(1); - } } } hexstr = malloc(len*2 + 1); @@ -359,5 +347,5 @@ char *LP_broadcasted(cJSON *argjson) printf("RECV BROADCAST.(%s)\n",jprint(argjson,0)); return(clonestr("{\"result\":\"need to update broadcast messages\"}")); } - +*/ diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2629b7033..fbcc23581 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,6 +24,8 @@ #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL +#define LP_ENCRYPTED_MAXSIZE (1024 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) + #define LP_MAXPUBKEY_ERRORS 3 #define PSOCK_KEEPALIVE 3600 #define MAINLOOP_PERSEC 10 @@ -174,7 +176,8 @@ struct iguana_info UT_hash_handle hh; portable_mutex_t txmutex; struct LP_transaction *transactions; uint64_t txfee; double estimatedrate,profitmargin; - int32_t longestchain,firstrefht,firstscanht,lastscanht; uint32_t counter,inactive,lastmempool,lastgetinfo; + int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; + uint32_t counter,inactive,lastmempool,lastgetinfo; uint8_t pubtype,p2shtype,isPoS,wiftype,taddr; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; }; @@ -261,6 +264,10 @@ void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); +void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); +int32_t LP_coinbus(uint16_t coin_busport); +struct iguana_info *LP_coinfind(char *symbol); +int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); #endif diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fd0e2c581..f91e267d8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,8 +19,6 @@ // // swap cancel should cleanly cancel // as much as possible on a unidirectional basis -// queuing -// debounce comms // stats // auto-utxo creation // multiple smartaddresses? enable/disable causes? 250 KMD bounty @@ -30,12 +28,12 @@ #include "LP_include.h" portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex; int32_t LP_canbind; -#include "LP_network.c" struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; struct LP_peerinfo *LP_peerinfos,*LP_mypeer; struct LP_forwardinfo *LP_forwardinfos; struct iguana_info *LP_coins; +#include "LP_network.c" char *activecoins[] = { "BTC", "KMD" }; char GLOBAL_DBDIR[] = { "DB" }; @@ -44,12 +42,14 @@ char LP_gui[16] = { "cli" }; char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.253.198", "5.9.253.199", "5.9.253.200", "5.9.253.201", "5.9.253.202", "5.9.253.203", };//"5.9.253.204" }; // -uint32_t LP_deadman_switch; +//uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; +int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; +int32_t LP_mypullsock = -1; int32_t USERPASS_COUNTER,IAMLP = 0; double LP_profitratio = 1.; -bits256 LP_mypubkey; +bits256 LP_mypub25519,LP_mypriv25519; // stubs @@ -98,78 +98,138 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,profitmargin,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); - if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && - LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); + //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && + //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } } return(retstr); } -char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,double profitmargin,void *ptr,int32_t recvlen,int32_t recvsock) +int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - int32_t len,datalen=0; char *msg,*retstr=0,*jsonstr=0; cJSON *argjson,*reqjson; - if ( (datalen= is_hexstr((char *)ptr,0)) > 0 ) - { - datalen >>= 1; - jsonstr = malloc(datalen + 1); - decode_hex((void *)jsonstr,datalen,(char *)ptr); - jsonstr[datalen] = 0; - } else jsonstr = (char *)ptr; - if ( 0 && IAMLP == 0 ) - printf("%s %d, datalen.%d (%s)\n",typestr,recvlen,datalen,jsonstr); - if ( (argjson= cJSON_Parse(jsonstr)) != 0 ) + static uint32_t crcs[8192]; + int32_t i; + *duplicatep = 0; + if ( ind < 0 ) { - len = (int32_t)strlen(jsonstr) + 1; - portable_mutex_lock(&LP_commandmutex); - if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"forwardhex") == 0 ) - { - //printf("got forwardhex\n"); - if ( (retstr= LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 ) - { - } - } - else if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"publish") == 0 ) + for (i=0; i= 0 && (reqjson= LP_dereference(argjson,"publish")) != 0 ) + if ( crc32 == crcs[i] ) { - msg = jprint(reqjson,1); - LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); + if ( i > 0 ) + { + crcs[i] = crcs[i >> 1]; + crcs[i >> 1] = crc32; + printf("duplicate %08x in slot %d -> slot %d\n",crc32,i,i>>1); + } + *duplicatep = 1; + break; } + else if ( crcs[i] == 0 ) + break; } - else if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len,profitmargin)) != 0 ) - { - } - portable_mutex_unlock(&LP_commandmutex); - if ( LP_COMMAND_RECVSOCK == NN_REP ) + if ( i >= sizeof(crcs)/sizeof(*crcs) ) + i = (rand() % (sizeof(crcs)/sizeof(*crcs))); + return(i); + } + else + { + crcs[ind] = crc32; + return(ind); + } +} + +char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,double profitmargin,uint8_t *ptr,int32_t recvlen,int32_t recvsock) +{ + int32_t i,len,datalen=0,duplicate=0,encrypted=0; char *retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; + crc32 = calc_crc32(0,&ptr[2],recvlen-2); + if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) + encrypted = 1; + portable_mutex_lock(&LP_commandmutex); + i = LP_crc32find(&duplicate,-1,crc32); + if ( duplicate == 0 ) + { + LP_crc32find(&duplicate,i,crc32); + if ( encrypted != 0 ) { - if ( retstr != 0 ) + uint8_t *nonce,*cipher; int32_t cipherlen; + nonce = &ptr[2]; + cipher = &ptr[2 + crypto_box_NONCEBYTES]; + cipherlen = recvlen - (2 + crypto_box_NONCEBYTES); + if ( cipherlen > 0 && cipherlen < sizeof(decoded) ) { - if ( strcmp("PULL",typestr) == 0 ) + if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,LP_mypriv25519)) != 0 ) { - printf("%d got REQ.(%s) -> (%s)\n",recvsock,jprint(argjson,0),retstr); - LP_send(recvsock,retstr,(int32_t)strlen(retstr)+1,0); + recvlen = (cipherlen - crypto_box_ZEROBYTES); + if ( strlen(jsonstr)+1 != recvlen ) + { + printf("unexpected len %d vs recvlen.%d\n",(int32_t)strlen(jsonstr)+1,recvlen); + jsonstr = 0; + } else printf("decrypted (%s)\n",jsonstr); } - } - else if ( strcmp("PULL",typestr) == 0 ) - { - printf("%d got REQ.(%s) -> null\n",recvsock,jprint(argjson,0)); - LP_send(recvsock,"{\"result\":null}",(int32_t)strlen("{\"result\":null}")+1,0); - } + } else printf("cipher.%d too big for %d\n",cipherlen,(int32_t)sizeof(decoded)); } - free_json(argjson); - } else printf("error parsing(%s)\n",jsonstr); - if ( (void *)jsonstr != ptr ) + else if ( (datalen= is_hexstr((char *)ptr,0)) > 0 ) + { + datalen >>= 1; + jsonstr = malloc(datalen + 1); + decode_hex((void *)jsonstr,datalen,(char *)ptr); + jsonstr[datalen] = 0; + } else jsonstr = (char *)ptr; + // "encrypted" "cipherstr" case! + if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) + { + len = (int32_t)strlen(jsonstr) + 1; + /*if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"forwardhex") == 0 ) + { + //printf("got forwardhex\n"); + if ( (retstr= LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 ) + { + } + } + else if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"publish") == 0 ) + { + printf("got publish\n"); + if ( jobj(argjson,"method2") != 0 ) + jdelete(argjson,"method2"); + jaddstr(argjson,"method2","broadcast"); + if ( pubsock >= 0 && (reqjson= LP_dereference(argjson,"publish")) != 0 ) + { + msg = jprint(reqjson,1); + /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); + } + } + else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len,profitmargin)) != 0 ) + { + } + /*if ( LP_COMMAND_RECVSOCK == NN_REP ) + { + if ( retstr != 0 ) + { + if ( strcmp("PULL",typestr) == 0 ) + { + printf("%d got REQ.(%s) -> (%s)\n",recvsock,jprint(argjson,0),retstr); + /LP_send(recvsock,retstr,(int32_t)strlen(retstr)+1,0); + } + } + else if ( strcmp("PULL",typestr) == 0 ) + { + printf("%d got REQ.(%s) -> null\n",recvsock,jprint(argjson,0)); + /LP_send(recvsock,"{\"result\":null}",(int32_t)strlen("{\"result\":null}")+1,0); + } + }*/ + free_json(argjson); + } else printf("error parsing(%s)\n",jsonstr); + } + portable_mutex_unlock(&LP_commandmutex); + if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); if ( ptr != 0 ) nn_freemsg(ptr), ptr = 0; return(retstr); } -int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin) +/*int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin) { void *ptr; int32_t recvlen=-1,nonz = 0; *retstrp = 0; @@ -182,22 +242,7 @@ int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsoc } } return(nonz); -} - -int32_t LP_subsock_check(void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin) -{ - int32_t recvlen,nonz = 0; void *ptr; char *retstr; - if ( sock >= 0 ) - { - while ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) - { - nonz++; - if ( (retstr= LP_process_message(ctx,"SUB",myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) - free(retstr); - } - } - return(nonz); -} +}*/ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo,double profitmargin) { @@ -244,9 +289,65 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu return(n); } -int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t pushport,int32_t pullsock,uint16_t myport,char *passphrase,double profitmargin) +int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin) { - static uint32_t counter,lastforward,numpeers; + int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; + if ( sock >= 0 ) + { + while ( nonz < 10 && recvlen > 0 ) + { + memset(&pfd,0,sizeof(pfd)); + pfd.fd = sock; + pfd.events = NN_POLLIN; + if ( nn_poll(&pfd,1,1) != 1 ) + break; + if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) + { + nonz++; + if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) + free(retstr); + } + } + } + return(nonz); +} + +void command_rpcloop(void *myipaddr) +{ + int32_t nonz = 0; char *origipaddr; struct iguana_info *coin,*ctmp; struct LP_peerinfo *peer,*tmp; void *ctx; + ctx = bitcoin_ctx(); + if ( (origipaddr= myipaddr) == 0 ) + origipaddr = "127.0.0.1"; + while ( 1 ) + { + nonz = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( peer->errors >= LP_MAXPEER_ERRORS ) + { + if ( (rand() % 10000) == 0 ) + peer->errors--; + else continue; + } + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.); + } + HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht + { + if ( coin->bussock >= 0 ) + nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); + } + if ( LP_mypullsock >= 0 ) + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,LP_profitratio - 1.); + if ( LP_mybussock >= 0 ) + nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock,LP_profitratio - 1.); + if ( nonz == 0 ) + usleep(10000); + } +} + +int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase,double profitmargin) +{ + static uint32_t counter,numpeers; //lastforward struct LP_utxoinfo *utxo,*utmp; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0,n=0,lastn=-1; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) @@ -283,52 +384,40 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_peer_pricesquery(peer->ipaddr,peer->port); peer->diduquery = now; } - nonz += LP_subsock_check(ctx,origipaddr,pubsock,peer->subsock,profitmargin); } - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d forwarding\n",counter,LP_canbind); if ( (counter % 600) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase,profitmargin); - if ( lastforward < now-3600 ) + /*if ( lastforward < now-3600 ) { if ( (retstr= LP_registerall(0)) != 0 ) free(retstr); //LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10); lastforward = now; - } - } - //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d utxos\n",counter,LP_canbind); - if ( (counter % 600) == 60 ) - { + }*/ HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) { LP_utxo_spentcheck(pubsock,utxo,profitmargin); } HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) { - //char str[65]; LP_utxo_spentcheck(pubsock,utxo,profitmargin); - if ( utxo->T.lasttime == 0 ) + if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 ) LP_utxo_clientpublish(utxo); - //else if ( strcmp(utxo->coin,"HUSH") == 0 ) - // printf("lasttime set %s\n",bits256_str(str,utxo->payment.txid)); } } - nonz += LP_pullsock_check(ctx,&retstr,myipaddr,pubsock,pullsock,profitmargin); - if ( retstr != 0 ) - free(retstr); - if ( IAMLP != 0 && (counter % 600) == 42 ) - LP_hellos(); - if ( 0 && LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) + //if ( IAMLP != 0 && (counter % 600) == 42 ) + // LP_hellos(); + /*if ( 0 && LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) { char keepalive[128]; sprintf(keepalive,"{\"method\":\"keepalive\"}"); //printf("send keepalive to %s pullsock.%d\n",pushaddr,pullsock); - if ( LP_send(pullsock,keepalive,(int32_t)strlen(keepalive)+1,0) < 0 ) + if ( /LP_send(pullsock,keepalive,(int32_t)strlen(keepalive)+1,0) < 0 ) { //LP_deadman_switch = 0; } - } + }*/ HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { cJSON *obj; int32_t height; bits256 zero; @@ -455,9 +544,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } } -void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profitmargin,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) +void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,double profitmargin,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { - char *myipaddr=0; long filesize,n; int32_t timeout,pullsock=-1,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); + char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); if ( passphrase == 0 || passphrase[0] == 0 ) { printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); @@ -552,11 +641,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit printf("got %s, initpeers\n",myipaddr); LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode"),profitmargin); printf("get public socket\n"); - pullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); + LP_mypullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); strcpy(LP_publicaddr,pushaddr); LP_publicport = mypullport; - LP_deadman_switch = (uint32_t)time(NULL); - printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,pullsock,mypullport); + LP_mybussock = LP_coinbus(mybusport); + //LP_deadman_switch = (uint32_t)time(NULL); + printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); printf("initcoins\n"); LP_initcoins(ctx,pubsock,jobj(argjson,"coins"),passphrase); if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) @@ -569,14 +659,24 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)&myipaddr) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)&myipaddr) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) // free(retstr); while ( 1 ) { //fprintf(stderr,"."); - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,mypullport,pullsock,myport,passphrase,profitmargin) == 0 ) + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase,profitmargin) == 0 ) usleep(1000000 / MAINLOOP_PERSEC); - if ( LP_canbind == 0 ) + /*if ( LP_canbind == 0 ) { //printf("check deadman %u vs %u\n",LP_deadman_switch,(uint32_t)time(NULL)); if ( LP_deadman_switch < time(NULL)-PSOCK_KEEPALIVE ) @@ -590,7 +690,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit LP_publicport = mypullport; LP_forwarding_register(LP_mypubkey,pushaddr,mypullport,MAX_PSOCK_PORT); } - } + }*/ } } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e82bddc5e..9bab49d4b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -34,9 +34,9 @@ char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t por return(str); } -int32_t LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) +int32_t _LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) { - int32_t sentbytes,i; struct nn_pollfd pfd; + int32_t sentbytes; if ( sock < 0 ) { printf("LP_send.(%s) to illegal socket\n",(char *)msg); @@ -44,31 +44,236 @@ int32_t LP_send(int32_t sock,void *msg,int32_t sendlen,int32_t freeflag) free(msg); return(-1); } - //len = (int32_t)strlen(msg) + 1; - for (i=0; i<1000; i++) // 1000 * (1 ms + 1000 us) = 2 seconds + if ( (sentbytes= nn_send(sock,msg,sendlen,0)) != sendlen ) + printf("LP_send sent %d instead of %d\n",sentbytes,sendlen); + //else printf("SENT.(%s)\n",msg); + if ( freeflag != 0 ) + free(msg); + return(sentbytes); +} + +int32_t LP_sockcheck(int32_t sock) +{ + struct nn_pollfd pfd; + pfd.fd = sock; + pfd.events = NN_POLLOUT; + if ( nn_poll(&pfd,1,1) > 0 ) + return(1); + else return(-1); +} + +int32_t LP_peerindsock(int32_t *peerindp) +{ + struct LP_peerinfo *peer,*tmp; int32_t peerind = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) { - pfd.fd = sock; - pfd.events = NN_POLLOUT; - //portable_mutex_lock(&LP_networkmutex); - if ( nn_poll(&pfd,1,1) > 0 ) + peerind++; + if ( peer->errors < LP_MAXPEER_ERRORS && peer->pushsock >= 0 ) { - if ( (sentbytes= nn_send(sock,msg,sendlen,0)) != sendlen ) - printf("LP_send sent %d instead of %d\n",sentbytes,sendlen); - //else printf("SENT.(%s)\n",msg); - if ( freeflag != 0 ) - free(msg); - //portable_mutex_unlock(&LP_networkmutex); - return(sentbytes); + if ( peerind < *peerindp ) + continue; + *peerindp = peerind; + printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); + return(peer->pushsock); } - //portable_mutex_unlock(&LP_networkmutex); - usleep(1000); } - printf("you can ignore: error LP_send sock.%d, i.%d timeout.(%s) %s\n",sock,i,(char *)msg,nn_strerror(nn_errno())); - if ( freeflag != 0 ) - free(msg); return(-1); } +struct LP_queue +{ + struct LP_queue *next,*prev; + int32_t sock,peerind,msglen; + uint32_t starttime,crc32; + uint8_t msg[]; +} *LP_Q; + +void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) +{ + struct LP_queue *ptr; + ptr = calloc(1,sizeof(*ptr) + msglen); + ptr->crc32 = calc_crc32(0,&msg[2],msglen-2); + ptr->sock = sock; + ptr->peerind = peerind; + ptr->msglen = msglen; + memcpy(ptr->msg,msg,msglen); + DL_APPEND(LP_Q,ptr); +} + +void queue_loop(void *ignore) +{ + struct LP_queue *ptr; int32_t sentbytes,nonz,duplicate; + while ( 1 ) + { + nonz = 0; + DL_FOREACH(LP_Q,ptr) + { + portable_mutex_lock(&LP_networkmutex); + DL_DELETE(LP_Q,ptr); + portable_mutex_unlock(&LP_networkmutex); + if ( ptr->sock >= 0 ) + { + if ( LP_sockcheck(ptr->sock) > 0 ) + { + if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) + printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); + else printf("qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); + ptr->sock = -1; + if ( ptr->peerind > 0 ) + ptr->starttime = (uint32_t)time(NULL); + else + { + free(ptr); + ptr = 0; + } + } + } + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) + { + LP_crc32find(&duplicate,-1,ptr->crc32); + if ( duplicate > 0 ) + { + printf("found crc32.%u\n",ptr->crc32); + free(ptr); + ptr = 0; + } + else + { + ptr->peerind++; + if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) + { + printf("no more peers to try at peerind.%d\n",ptr->peerind); + free(ptr); + ptr = 0; + } + } + } + if ( ptr != 0 ) + { + printf("reQ: qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); + portable_mutex_lock(&LP_networkmutex); + DL_APPEND(LP_Q,ptr); + portable_mutex_unlock(&LP_networkmutex); + } + } + if ( nonz == 0 ) + usleep(10000); + } +} + +void _LP_queuesend(int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) +{ + int32_t sentbytes,peerind = 0; + if ( sock0 >= 0 || sock1 >= 0 ) + { + if ( sock0 >= 0 && LP_sockcheck(sock0) > 0 ) + { + if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) + printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); + else sock0 = -1; + } + if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) + { + if ( (sentbytes= nn_send(sock1,msg,msglen,0)) != msglen ) + printf("_LP_queuesend1 sent %d instead of %d\n",sentbytes,msglen); + else sock1 = -1; + } + if ( sock0 < 0 && sock1 < 0 ) + return; + } + else + { + peerind = 1; + sock0 = LP_peerindsock(&peerind); + } + portable_mutex_lock(&LP_networkmutex); + if ( sock0 >= 0 ) + _LP_sendqueueadd(sock0,msg,msglen,needack * peerind); + if ( sock1 >= 0 ) + _LP_sendqueueadd(sock1,msg,msglen,needack); + portable_mutex_unlock(&LP_networkmutex); +} + +void LP_queuesend(int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) +{ + struct iguana_info *coin; int32_t flag=0,socks[2]; + if ( pubsock >= 0 ) + { + socks[0] = socks[1] = -1; + if ( rel != 0 && rel[0] != 0 && (coin= LP_coinfind(rel)) != 0 && coin->bussock >= 0 ) + socks[flag++] = coin->bussock; + if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) + socks[flag++] = coin->bussock; + if ( flag == 0 && pubsock >= 0 ) + _LP_queuesend(pubsock,-1,msg,msglen,0); + else _LP_queuesend(socks[0],socks[1],msg,msglen,0); + } else _LP_queuesend(-1,-1,msg,msglen,1); +} + +// first 2 bytes == (crc32 & 0xffff) if encrypted, then nonce is next crypto_box_NONCEBYTES +// GENESIS_PRIVKEY is always the sender + +void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25519,char *msgstr) +{ + uint8_t encoded[LP_ENCRYPTED_MAXSIZE],space[sizeof(encoded)],*msg,*nonce,*cipher; int32_t encrypted=0,msglen; uint32_t crc32; cJSON *argjson; char *methodstr,method[64],cipherstr[LP_ENCRYPTED_MAXSIZE*2+1]; + msglen = (int32_t)strlen(msgstr) + 1; + msg = (void *)msgstr; + if ( bits256_nonz(destpub25519) != 0 ) + { + nonce = &encoded[2]; + OS_randombytes(nonce,crypto_box_NONCEBYTES); + cipher = &encoded[2 + crypto_box_NONCEBYTES]; + msglen = _SuperNET_cipher(nonce,&encoded[2 + crypto_box_NONCEBYTES],msg,msglen,destpub25519,GENESIS_PRIVKEY,space); + msglen += crypto_box_NONCEBYTES; + crc32 = calc_crc32(0,&encoded[2],msglen); + encoded[0] = crc32 & 0xff; + encoded[1] = (crc32 >> 8) & 0xff; + msg = encoded; + msglen += 2; + encrypted = 1; + free(msgstr), msgstr = 0; + } + if ( IAMLP != 0 ) + { + LP_queuesend(pubsock,base,rel,msg,msglen); + } + else + { + if ( encrypted == 0 ) + { + if ( (argjson= cJSON_Parse(msgstr)) != 0 ) + { + if ( (methodstr= jstr(argjson,"method")) != 0 && strlen(methodstr) <= sizeof(method) ) + { + strcpy(method,methodstr); + jdelete(argjson,"method"); + jaddstr(argjson,"method2",method); + jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,1); + msglen = (int32_t)strlen((char *)msg) + 1; + LP_queuesend(-1,base,rel,msg,msglen); + free(msg); + } else printf("no valid method in (%s)\n",msgstr); + free_json(argjson); + } else printf("couldnt parse (%s)\n",msgstr); + } + else + { + argjson = cJSON_CreateObject(); + jaddstr(argjson,"method","broadcast"); + jaddstr(argjson,"method2","encrypted"); + init_hexbytes_noT(cipherstr,msg,msglen); + jaddstr(argjson,"cipher",cipherstr); + msg = (void *)jprint(argjson,1); + msglen = (int32_t)strlen((char *)msg) + 1; + LP_queuesend(-1,base,rel,msg,msglen); + free(msg); + } + } + if ( msgstr != 0 ) + free(msgstr); +} + uint32_t LP_swapsend(int32_t pairsock,struct basilisk_swap *swap,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t nextbits,uint32_t crcs[2]) { uint8_t *buf; int32_t sentbytes,offset=0,i; @@ -97,7 +302,7 @@ uint32_t LP_swapsend(int32_t pairsock,struct basilisk_swap *swap,uint32_t msgbit void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to work { static struct nn_pollfd *pfds; - int32_t i,n,nonz,iter,retval,size=0,sentbytes,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512];//,*myipaddr = _ptr; + int32_t i,n,nonz,iter,retval,sentbytes,size=0,sendsock = -1; uint32_t now; struct psock *ptr=0; void *buf=0; char keepalive[512]; while ( 1 ) { now = (uint32_t)time(NULL); @@ -105,15 +310,8 @@ void LP_psockloop(void *_ptr) // printouts seem to be needed for forwarding to w { if ( size > 0 ) { - if ( (sentbytes= LP_send(sendsock,buf,size,0)) > 0 ) - { - printf("PSOCKS (%d %d %d) (%s) -> %d/%d bytes %s\n",ptr->publicsock,ptr->sendsock,sendsock,(char *)buf,size,sentbytes,ptr->sendaddr); - } - else - { - ptr->errors++; - printf("send error.%d to %s\n",ptr->errors,ptr->sendaddr); - } + if ( (sentbytes= nn_send(sendsock,buf,size,0)) != size ) // need tight loop + printf("LP_psockloop sent %d instead of %d\n",sentbytes,size); if ( buf != 0 ) { if ( buf != keepalive ) @@ -290,7 +488,7 @@ int32_t LP_psockmark(char *publicaddr) char *LP_psock(char *myipaddr,int32_t ispaired) { - char pushaddr[128],subaddr[128]; uint16_t i,publicport,subport,maxiters=100; int32_t timeout,maxsize,pullsock=-1,pubsock=-1; cJSON *retjson=0; + char pushaddr[128],subaddr[128]; uint16_t i,publicport,subport,maxiters=100; int32_t timeout,pullsock=-1,pubsock=-1; cJSON *retjson=0; retjson = cJSON_CreateObject(); publicport = Psockport++; subport = Psockport++; @@ -309,12 +507,11 @@ char *LP_psock(char *myipaddr,int32_t ispaired) { timeout = 1; nn_setsockopt(pubsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); if ( ispaired != 0 ) { - maxsize = 1024 * 1024; - nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVBUF,&maxsize,sizeof(maxsize)); + //maxsize = 1024 * 1024; + //nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVBUF,&maxsize,sizeof(maxsize)); } //if ( ispaired != 0 ) { @@ -358,7 +555,7 @@ char *LP_psock(char *myipaddr,int32_t ispaired) */ -int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) +/*int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) { int32_t sock,n,m,timeout,retval = -1; char msg[512],*retstr; printf("nn_tests.(%s)\n",pushaddr); @@ -372,11 +569,11 @@ int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) timeout = 1; nn_setsockopt(sock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); sprintf(msg,"{\"method\":\"nn_tests\",\"ipaddr\":\"%s\"}",pushaddr); - n = LP_send(sock,msg,(int32_t)strlen(msg)+1,0); + n = /LP_send(sock,msg,(int32_t)strlen(msg)+1,0); sleep(3); LP_pullsock_check(ctx,&retstr,"127.0.0.1",-1,pullsock,0.); sprintf(msg,"{\"method\":\"nn_tests2\",\"ipaddr\":\"%s\"}",pushaddr); - m = LP_send(pullsock,msg,(int32_t)strlen(msg)+1,0); + m = /LP_send(pullsock,msg,(int32_t)strlen(msg)+1,0); printf(">>>>>>>>>>>>>>>>>>>>>> sent %d+%d bytes -> pullsock.%d retstr.(%s)\n",n,m,pullsock,retstr!=0?retstr:""); if ( retstr != 0 ) { @@ -387,7 +584,7 @@ int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) nn_close(sock); } return(retval); -} +}*/ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char *myipaddr,uint16_t mypullport,int32_t ispaired) { @@ -407,6 +604,8 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char else { *mypullportp = 0; + if ( ispaired == 0 ) + return(-1); while ( *mypullportp == 0 ) { if ( (*mypullportp= LP_psock_get(connectaddr,publicaddr,ispaired)) != 0 ) @@ -437,15 +636,14 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - timeout = 1; nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //maxsize = 2 * 1024 * 1024; //nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVBUF,&maxsize,sizeof(maxsize)); if ( nntype == NN_SUB ) nn_setsockopt(pullsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0); } - if ( LP_canbind != 0 || ispaired != 0 || nn_tests(ctx,pullsock,publicaddr,NN_PUSH) >= 0 ) - break; + //if ( LP_canbind != 0 || ispaired != 0 || nn_tests(ctx,pullsock,publicaddr,NN_PUSH) >= 0 ) + // break; printf("nn_tests failed, try again\n"); sleep(3); if ( pullsock >= 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ebff3a247..90fe7604a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -179,24 +179,27 @@ char *LP_quotereceived(cJSON *argjson) char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,char *base,char *rel,double price) { bits256 zero; char *msg; cJSON *reqjson = cJSON_CreateObject(); - jaddbits256(reqjson,"pubkey",LP_mypubkey); + memset(zero.bytes,0,sizeof(zero)); + jaddbits256(reqjson,"pubkey",LP_mypub25519); jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); jaddnum(reqjson,"price",price); - if ( pubsock >= 0 ) + /*if ( pubsock >= 0 ) { jaddstr(reqjson,"method","postprice"); //printf("%d pricepings.(%s)\n",pubsock,jprint(reqjson,0)); msg = jprint(reqjson,1); - LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); + /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); } else { jaddstr(reqjson,"method","forward"); jaddstr(reqjson,"method2","postprice"); - memset(zero.bytes,0,sizeof(zero)); - LP_forward(ctx,myipaddr,pubsock,profitmargin,zero,jprint(reqjson,1),1); - } + /LP_forward(ctx,myipaddr,pubsock,profitmargin,zero,jprint(reqjson,1),1); + }*/ + jaddstr(reqjson,"method","postprice"); + msg = jprint(reqjson,1); + LP_broadcast_message(pubsock,base,rel,zero,msg); return(clonestr("{\"result\":\"success\"}")); } @@ -312,19 +315,22 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,c if ( bits256_nonz(qp->desthash) != 0 ) flag = 1; //printf("QUERY.(%s)\n",jprint(reqjson,0)); - if ( IAMLP != 0 ) + /*if ( IAMLP != 0 ) { jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); - LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); + /LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); } else { jaddstr(reqjson,"method2",method); jaddstr(reqjson,"method","forward"); jaddbits256(reqjson,"pubkey",qp->srchash); - LP_forward(ctx,myipaddr,mypubsock,profitmargin,qp->srchash,jprint(reqjson,1),1); - } + /LP_forward(ctx,myipaddr,mypubsock,profitmargin,qp->srchash,jprint(reqjson,1),1); + }*/ + jaddstr(reqjson,"method",method); + msg = jprint(reqjson,1); + LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); for (i=0; i<30; i++) { if ( (price= LP_pricecache(qp,qp->srccoin,qp->destcoin,qp->txid,qp->vout)) > SMALLVAL ) @@ -383,7 +389,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ return(-1); } privkey = LP_privkey(utxo->coinaddr,coin->taddr); - if ( bits256_nonz(privkey) != 0 && qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && bits256_cmp(LP_mypubkey,qp->srchash) == 0 ) + if ( bits256_nonz(privkey) != 0 && qp->quotetime >= qp->timestamp-3 && qp->quotetime <= utxo->T.swappending && bits256_cmp(LP_mypub25519,qp->srchash) == 0 ) { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { @@ -400,7 +406,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddnum(retjson,"requestid",qp->R.requestid); jaddnum(retjson,"quoteid",qp->R.quoteid); char str[65]; printf("BOB pubsock.%d sends to (%s)\n",pubsock,bits256_str(str,utxo->S.otherpubkey)); - if ( pubsock >= 0 ) + /*if ( pubsock >= 0 ) { msg = jprint(retjson,0); LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); @@ -408,14 +414,16 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jdelete(retjson,"method"); jaddstr(retjson,"method2","connected"); jaddstr(retjson,"method","forward"); - LP_forward(ctx,myipaddr,pubsock,profitmargin,utxo->S.otherpubkey,jprint(retjson,1),1); + LP_forward(ctx,myipaddr,pubsock,profitmargin,utxo->S.otherpubkey,jprint(retjson,1),1);*/ + msg = jprint(retjson,1); + LP_broadcast_message(pubsock,base,rel,utxo->S.otherpubkey,msg); retval = 0; } else printf("error launching swaploop\n"); } else printf("couldnt bind to any port %s\n",pairstr); } else { - printf("dest %.8f vs required %.8f (%d %d %d %d %d)\n",dstr(qp->destsatoshis),dstr(price*(utxo->S.satoshis-qp->txfee)),bits256_nonz(privkey) != 0 ,qp->timestamp == utxo->T.swappending-LP_RESERVETIME,qp->quotetime >= qp->timestamp-3,qp->quotetime < utxo->T.swappending,bits256_cmp(LP_mypubkey,qp->srchash) == 0); + printf("dest %.8f vs required %.8f (%d %d %d %d %d)\n",dstr(qp->destsatoshis),dstr(price*(utxo->S.satoshis-qp->txfee)),bits256_nonz(privkey) != 0 ,qp->timestamp == utxo->T.swappending-LP_RESERVETIME,qp->quotetime >= qp->timestamp-3,qp->quotetime < utxo->T.swappending,bits256_cmp(LP_mypub25519,qp->srchash) == 0); } if ( retval < 0 ) { @@ -431,7 +439,7 @@ char *LP_connectedalice(cJSON *argjson) // alice cJSON *retjson; double bid,ask,price,qprice; int32_t timeout,pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); - if ( bits256_cmp(Q.desthash,LP_mypubkey) != 0 ) + if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) return(clonestr("{\"result\",\"update stats\"}")); printf("CONNECTED.(%s)\n",jprint(argjson,0)); if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) @@ -502,7 +510,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { //printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); retval = 1; - if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypubkey,Q.srchash) == 0 ) + if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) { if ( (price= LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin)) <= SMALLVAL || ask <= SMALLVAL ) { @@ -535,15 +543,17 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddbits256(retjson,"desthash",butxo->S.otherpubkey); jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); jaddstr(retjson,"method","reserved"); - if ( pubsock >= 0 ) + /*if ( pubsock >= 0 ) { msg = jprint(retjson,0); - LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); + /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); } jdelete(retjson,"method"); jaddstr(retjson,"method2","reserved"); jaddstr(retjson,"method","forward"); - LP_forward(ctx,myipaddr,pubsock,profitmargin,butxo->S.otherpubkey,jprint(retjson,1),1); + /LP_forward(ctx,myipaddr,pubsock,profitmargin,butxo->S.otherpubkey,jprint(retjson,1),1);*/ + msg = jprint(retjson,1); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n",butxo->T.swappending,qprice,price); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); @@ -588,7 +598,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( price > maxprice ) price = maxprice; pubkey = jbits256(item,"pubkey"); - if ( bits256_cmp(pubkey,LP_mypubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 && pubp->numerrors < LP_MAXPUBKEY_ERRORS ) + if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 && pubp->numerrors < LP_MAXPUBKEY_ERRORS ) { if ( bestprice == 0. ) // assumes price ordered asks bestprice = price; @@ -668,14 +678,14 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,char *rel,bits256 t return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypubkey,autxo->coinaddr) < 0 ) + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); return(jprint(LP_quotejson(&Q),1)); } char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { - struct LP_utxoinfo *bobutxo,*aliceutxo; char *retstr; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; + struct LP_utxoinfo *bobutxo,*aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) { char str[65],str2[65]; printf("dest.(%s)/v%d fee.(%s)/v%d\n",bits256_str(str,qp->desttxid),qp->destvout,bits256_str(str2,qp->feetxid),qp->feevout); @@ -684,8 +694,8 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,st if ( (bobutxo= LP_utxopairfind(1,qp->txid,qp->vout,qp->txid2,qp->vout2)) == 0 ) return(clonestr("{\"error\":\"cant find bob utxopair\"}")); bobutxo->T.bestflag = (uint32_t)time(NULL); - if ( (retstr= LP_registerall(0)) != 0 ) - free(retstr); + //if ( (retstr= LP_registerall(0)) != 0 ) + // free(retstr); price = LP_query(ctx,myipaddr,mypubsock,profitmargin,"request",qp); bestitem = LP_quotejson(qp); if ( price > SMALLVAL ) @@ -752,7 +762,7 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargi } if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); - if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypubkey,autxo->coinaddr) < 0 ) + if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) { diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 95c708348..3e24cf9cb 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -50,7 +50,7 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,double profitmargin,int32_t numpeers,int32_t numutxos) { - uint32_t ipbits; int32_t maxsize,pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; + uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; ipbits = (uint32_t)calc_ipbits(ipaddr); expand_ipbits(checkip,ipbits); if ( strcmp(checkip,ipaddr) == 0 ) @@ -75,10 +75,10 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char nanomsg_transportname(0,pushaddr,peer->ipaddr,pushport); if ( nn_connect(pushsock,pushaddr) >= 0 ) { - timeout = 100; + timeout = 1; nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - maxsize = 2 * 1024 * 1024; - nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); + //maxsize = 2 * 1024 * 1024; + //nn_setsockopt(pushsock,NN_SOL_SOCKET,NN_SNDBUF,&maxsize,sizeof(maxsize)); printf("connected to push.(%s) %d\n",pushaddr,pushsock); peer->connected = (uint32_t)time(NULL); peer->pushsock = pushsock; @@ -113,16 +113,56 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char printf("_LPaddpeer %s -> numpeers.%d mypubsock.%d other.(%d %d)\n",ipaddr,mypeer->numpeers,mypubsock,numpeers,numutxos); } else peer->numpeers = 1; // will become mypeer portable_mutex_unlock(&LP_peermutex); - if ( mypubsock >= 0 ) + if ( IAMLP != 0 && mypubsock >= 0 ) { - char *msg = jprint(LP_peerjson(peer),1); - LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); + struct iguana_info *coin,*ctmp; bits256 zero; char *msg,busaddr[64]; + msg = jprint(LP_peerjson(peer),1); + memset(zero.bytes,0,sizeof(zero)); + //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); + LP_broadcast_message(mypubsock,"","",zero,msg); + HASH_ITER(hh,LP_coins,coin,ctmp) + { + if ( coin->bussock >= 0 ) + { + nanomsg_transportname(0,busaddr,peer->ipaddr,coin->busport); + nn_connect(coin->bussock,busaddr); + } + } } } } else printf("LP_addpeer: checkip.(%s) vs (%s)\n",checkip,ipaddr); return(peer); } +int32_t LP_coinbus(uint16_t coin_busport) +{ + struct LP_peerinfo *peer,*tmp; char busaddr[64]; int32_t timeout,bussock = -1; + if ( IAMLP != 0 && LP_mypeer != 0 && (bussock= nn_socket(AF_SP,NN_BUS)) >= 0 ) + { + timeout = 1; + nn_setsockopt(bussock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + nn_setsockopt(bussock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); + nanomsg_transportname(0,busaddr,LP_mypeer->ipaddr,coin_busport); + if ( nn_bind(bussock,busaddr) < 0 ) + { + printf("error binding to coin_busport.%s\n",busaddr); + nn_close(bussock); + } + else + { + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( LP_mypeer->port != peer->port || strcmp(LP_mypeer->ipaddr,peer->ipaddr) != 0 ) + { + nanomsg_transportname(0,busaddr,peer->ipaddr,coin_busport); + nn_connect(bussock,busaddr); + } + } + } + } + return(bussock); +} + int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) { struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1d7d239da..1fd2fd4ed 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -332,7 +332,7 @@ int32_t LP_mypriceset(char *base,char *rel,double price) { basepp->myprices[relpp->ind] = price; // ask //relpp->myprices[basepp->ind] = (1. / price); // bid - if ( (pubp= LP_pubkeyadd(LP_mypubkey)) != 0 ) + if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; //pubp->matrix[relpp->ind][basepp->ind] = (1. / price); @@ -513,32 +513,6 @@ int32_t LP_orderbookfind(struct LP_orderbookentry **array,int32_t num,bits256 tx return(-1); } -int32_t LP_utxo_clientpublish(struct LP_utxoinfo *utxo) -{ - struct LP_peerinfo *peer,*tmp; cJSON *retjson; char *retstr; int32_t n = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( (retstr= issue_LP_notifyutxo(peer->ipaddr,peer->port,utxo)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( jobj(retjson,"error") == 0 ) - { - //if ( strcmp("HUSH",utxo->coin) == 0 ) - // printf("clientpublish %s (%s)\n",peer->ipaddr,retstr); - utxo->T.lasttime = (uint32_t)time(NULL); - n++; - } - free_json(retjson); - } - free(retstr); - } - //if ( utxo->T.lasttime != 0 ) - // return(0); - } - return(n); -} - int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) { struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis,val,val2; @@ -568,7 +542,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; - if ( bits256_cmp(utxo->pubkey,LP_mypubkey) == 0 && utxo->T.lasttime == 0 ) + if ( bits256_cmp(utxo->pubkey,LP_mypub25519) == 0 && utxo->T.lasttime == 0 ) LP_utxo_clientpublish(utxo); } } @@ -646,7 +620,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"method","postprice"); - jaddbits256(retjson,"pubkey",LP_mypubkey); + jaddbits256(retjson,"pubkey",LP_mypub25519); jaddstr(retjson,"base",base); jaddstr(retjson,"rel",rel); jaddnum(retjson,"price",price); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0387c161a..880eccad8 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -83,7 +83,7 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port, //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } -char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) +/*char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) { char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2; if ( (retstr= LP_isitme(destip,destport)) != 0 ) @@ -109,16 +109,16 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx utxo->T.spentflag = (uint32_t)time(NULL); return(0); } -} +}*/ -char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) +/*char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) { char url[512],str[65]; sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey)); //printf("getutxo.(%s)\n",url); return(LP_issue_curl("lookup",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -} +}*/ char *issue_LP_getprices(char *destip,uint16_t destport) { diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e5fff82ea..2c4bf5f34 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -417,6 +417,21 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i return(retval); } +int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags) +{ + struct nn_pollfd pfd; int32_t i; + for (i=0; i<3000; i++) + { + memset(&pfd,0,sizeof(pfd)); + pfd.fd = sock; + pfd.events = NN_POLLIN; + if ( nn_poll(&pfd,1,1) > 0 ) + return(nn_send(sock,data,datalen,flags)); + usleep(1000); + } + return(-1); +} + int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen),int32_t (*datagen)(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)) { int32_t datalen,sendlen,retval = -1; @@ -426,7 +441,7 @@ int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basi printf("waited for %s\n",statename); if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { - if ( (sendlen= nn_send(pairsock,data,datalen,0)) == datalen ) + if ( (sendlen= swap_nn_send(pairsock,data,datalen,0)) == datalen ) { printf("sent.%d after waitfor.%s\n",sendlen,statename); retval = 0; @@ -443,7 +458,7 @@ int32_t LP_sendwait(char *statename,int32_t timeout,int32_t pairsock,struct basi if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { //printf("generated %d for %s\n",datalen,statename); - if ( (sendlen= nn_send(pairsock,data,datalen,0)) == datalen ) + if ( (sendlen= swap_nn_send(pairsock,data,datalen,0)) == datalen ) { //printf("sendwait.%s sent %d\n",statename,sendlen); if ( LP_waitfor(pairsock,swap,timeout,verify) == 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 09051fc3c..b648924bf 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -20,7 +20,7 @@ int32_t LP_ismine(struct LP_utxoinfo *utxo) { - if ( utxo != 0 && bits256_cmp(utxo->pubkey,LP_mypubkey) == 0 ) + if ( utxo != 0 && bits256_cmp(utxo->pubkey,LP_mypub25519) == 0 ) return(1); else return(0); } @@ -197,7 +197,7 @@ void LP_availableset(struct LP_utxoinfo *utxo) int32_t LP_utxopurge(int32_t allutxos) { char str[65]; struct LP_utxoinfo *utxo,*tmp; int32_t iambob,n = 0; - printf("LP_utxopurge mypub.(%s)\n",bits256_str(str,LP_mypubkey)); + printf("LP_utxopurge mypub.(%s)\n",bits256_str(str,LP_mypub25519)); portable_mutex_lock(&LP_utxomutex); for (iambob=0; iambob<=1; iambob++) { @@ -257,13 +257,13 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) jaddnum(item,"pending",utxo->T.swappending); if ( utxo->iambob != 0 ) { - jaddbits256(item,"srchash",LP_mypubkey); + jaddbits256(item,"srchash",LP_mypub25519); if ( bits256_nonz(utxo->S.otherpubkey) != 0 ) jaddbits256(item,"desthash",utxo->S.otherpubkey); } else { - jaddbits256(item,"desthash",LP_mypubkey); + jaddbits256(item,"desthash",LP_mypub25519); if ( bits256_nonz(utxo->S.otherpubkey) != 0 ) jaddbits256(item,"srchash",utxo->S.otherpubkey); } @@ -411,13 +411,13 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) { - cJSON *argjson; struct _LP_utxoinfo u; char *msg; + //cJSON *argjson; struct _LP_utxoinfo u; char *msg; if ( utxo == 0 ) return; utxo->T.spentflag = (uint32_t)time(NULL); if ( LP_mypeer != 0 && LP_mypeer->numutxos > 0 ) LP_mypeer->numutxos--; - if ( LP_mypubsock >= 0 ) + /*if ( LP_mypubsock >= 0 ) { argjson = cJSON_CreateObject(); jaddstr(argjson,"method","checktxid"); @@ -432,8 +432,8 @@ void LP_spentnotify(struct LP_utxoinfo *utxo,int32_t selector) jaddnum(argjson,"checkvout",u.vout); } msg = jprint(argjson,1); - LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); - } + /LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); + }*/ } char *LP_spentcheck(cJSON *argjson) @@ -467,9 +467,37 @@ char *LP_spentcheck(cJSON *argjson) return(clonestr("{\"error\":\"cant find txid to check spent status\"}")); } +void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) +{ + bits256 zero; char *msg; + memset(zero.bytes,0,sizeof(zero)); + msg = jprint(LP_utxojson(utxo),1); + LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); + /*struct LP_peerinfo *peer,*tmp; cJSON *retjson; char *retstr; int32_t n = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( (retstr= issue_LP_notifyutxo(peer->ipaddr,peer->port,utxo)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( jobj(retjson,"error") == 0 ) + { + utxo->T.lasttime = (uint32_t)time(NULL); + n++; + } + free_json(retjson); + } + free(retstr); + } + //if ( utxo->T.lasttime != 0 ) + // return(0); + } + return(n);*/ +} + struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,double profitmargin,char *gui) { - uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; char *msg; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 ) { printf("malformed addutxo %d %d %d %d %d %d %d %d %d\n", symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); @@ -484,7 +512,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit else return(0); } else tmpsatoshis = value; char str[65],str2[65],dispflag = (iambob == 0); - if ( iambob == 0 && bits256_cmp(pubkey,LP_mypubkey) != 0 ) + if ( iambob == 0 && bits256_cmp(pubkey,LP_mypub25519) != 0 ) { printf("trying to add Alice utxo when not mine? %s/v%d\n",bits256_str(str,txid),vout); return(0); @@ -561,11 +589,12 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit portable_mutex_unlock(&LP_utxomutex); if ( iambob != 0 ) { - if ( mypubsock >= 0 ) + /*if ( mypubsock >= 0 ) { msg = jprint(LP_utxojson(utxo),1); - LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - } else LP_utxo_clientpublish(utxo); + /LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); + } else LP_utxo_clientpublish(utxo);*/ + LP_utxo_clientpublish(utxo); if ( LP_mypeer != 0 && LP_ismine(utxo) > 0 ) LP_mypeer->numutxos++; } @@ -676,7 +705,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) else myipaddr = "127.0.0.1"; HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) { - //char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypubkey)); + //char str[65]; printf("iambob.%d iterate %s\n",iambob,bits256_str(str,LP_mypub25519)); if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; @@ -684,7 +713,10 @@ cJSON *LP_inventory(char *symbol,int32_t iambob) { if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); + continue; } + if ( iambob != 0 ) + LP_utxo_clientpublish(utxo); jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } //else printf("skip %s %d %d %d %d\n",bits256_str(str,utxo->pubkey),LP_isunspent(utxo) != 0,strcmp(symbol,utxo->coin) == 0,utxo->iambob == iambob,LP_ismine(utxo) > 0); @@ -836,6 +868,13 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan if ( counter++ == 0 ) { bitcoin_priv2wif(USERPASS_WIFSTR,privkey,188); + bitcoin_wif2priv(&tmptype,&checkkey,USERPASS_WIFSTR); + if ( bits256_cmp(checkkey,privkey) != 0 ) + { + char str[65],str2[65]; + printf("FATAL ERROR converting USERPASS_WIFSTR %s -> %s != %s\n",USERPASS_WIFSTR,bits256_str(str,checkkey),bits256_str(str2,privkey)); + exit(-1); + } conv_NXTpassword(userpass.bytes,pubkeyp->bytes,(uint8_t *)USERPASS_WIFSTR,(int32_t)strlen(USERPASS_WIFSTR)); userpub = curve25519(userpass,curve25519_basepoint9()); printf("userpass.(%s)\n",bits256_str(USERPASS,userpub)); @@ -849,8 +888,9 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan } } } - LP_mypubkey = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); - //printf("privkey.(%s) -> LP_mypubkey.(%s)\n",bits256_str(str,privkey),bits256_str(str2,LP_mypubkey)); + LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); + LP_mypriv25519 = privkey; + //printf("privkey.(%s) -> LP_mypub25519.(%s)\n",bits256_str(str,privkey),bits256_str(str2,LP_mypub25519)); return(privkey); } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 1babc9d76..9d2e6f336 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -790,7 +790,7 @@ void LP_main(void *ptr) if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); - LPinit(7779,7780,7781,profitmargin,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(7779,7780,7781,7782,profitmargin,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } @@ -799,6 +799,7 @@ int main(int argc, const char * argv[]) char *base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; + OS_init(); if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) From 2f47a6683340b8157f3f2d0991b5a43eebaf0ead Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 14:41:00 +0300 Subject: [PATCH 077/682] Test --- iguana/exchanges/LP_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9bab49d4b..638f2425e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -644,8 +644,9 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char } //if ( LP_canbind != 0 || ispaired != 0 || nn_tests(ctx,pullsock,publicaddr,NN_PUSH) >= 0 ) // break; - printf("nn_tests failed, try again\n"); - sleep(3); + //printf("nn_tests failed, try again\n"); + //sleep(3); + break; if ( pullsock >= 0 ) nn_close(pullsock); } From 67c0d736b2c822aabba13808e272b7a46fb86270 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 14:53:58 +0300 Subject: [PATCH 078/682] Test --- iguana/exchanges/LP_commands.c | 37 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b880f0e10..90154b383 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -259,11 +259,15 @@ trust(pubkey, trust)\n\ return(LP_prices()); else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); - //else if ( strcmp(method,"registerall") == 0 ) - // return(LP_registerall(jint(argjson,"numnodes"))); - /*else if ( strcmp(method,"forward") == 0 ) + else if ( strcmp(method,"registerall") == 0 ) { - cJSON *reqjson; + return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + //return(LP_registerall(jint(argjson,"numnodes"))); + } + else if ( strcmp(method,"forward") == 0 ) + { + return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + /*cJSON *reqjson; if ( (reqjson= LP_dereference(argjson,"forward")) != 0 ) { //printf("FORWARDED.(%s)\n",jprint(argjson,0)); @@ -271,14 +275,15 @@ trust(pubkey, trust)\n\ retstr = clonestr("{\"result\":\"success\"}"); else retstr = clonestr("{\"result\":\"error forwarding\"}"); } else retstr = clonestr("{\"result\":\"cant recurse forwards\"}"); - return(retstr); + return(retstr);*/ } else if ( strcmp(method,"keepalive") == 0 ) { - printf("got keepalive lag.%d switch.%u\n",(int32_t)time(NULL) - LP_deadman_switch,LP_deadman_switch); + return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + /*printf("got keepalive lag.%d switch.%u\n",(int32_t)time(NULL) - LP_deadman_switch,LP_deadman_switch); LP_deadman_switch = (uint32_t)time(NULL); - return(clonestr("{\"result\":\"success\"}")); - }*/ + return(clonestr("{\"result\":\"success\"}"));*/ + } else if ( strcmp(method,"getpeers") == 0 ) return(LP_peers()); else if ( strcmp(method,"getutxos") == 0 ) @@ -293,14 +298,18 @@ trust(pubkey, trust)\n\ { if ( IAMLP != 0 ) { - /*if ( strcmp(method,"register") == 0 ) + if ( strcmp(method,"register") == 0 ) { - retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"),juint(argjson,"pushport")); + return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + /*retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"),juint(argjson,"pushport")); //printf("got (%s) from register\n",retstr!=0?retstr:""); - return(retstr); + return(retstr);*/ } else if ( strcmp(method,"lookup") == 0 ) - return(LP_lookup(jbits256(argjson,"client")));*/ + { + return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); + //return(LP_lookup(jbits256(argjson,"client"))); + } if ( strcmp(method,"broadcast") == 0 ) { cJSON *reqjson; bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; @@ -332,7 +341,9 @@ trust(pubkey, trust)\n\ myipaddr = LP_mypeer->ipaddr; else printf("LP_psock dont have actual ipaddr?\n"); } - return(LP_psock(myipaddr,jint(argjson,"ispaired"))); + if ( jint(argjson,"ispaired") != 0 ) + return(LP_psock(myipaddr,jint(argjson,"ispaired"))); + else return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); } else if ( strcmp(method,"notify") == 0 ) retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); From 91bbae2a77afe188f9b5b6765d346f5f2a329266 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 14:58:53 +0300 Subject: [PATCH 079/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f91e267d8..15219d51d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -220,7 +220,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, }*/ free_json(argjson); } else printf("error parsing(%s)\n",jsonstr); - } + } else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); From 494adc44be36522237c91b3fbac8907a14436b84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:00:01 +0300 Subject: [PATCH 080/682] Test --- iguana/exchanges/LP_nativeDEX.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 15219d51d..cd3ffacc0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -107,11 +107,12 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) { - static uint32_t crcs[8192]; + static uint32_t crcs[8192]; static unsigned long dup,total; int32_t i; *duplicatep = 0; if ( ind < 0 ) { + total++; for (i=0; i> 1]; crcs[i >> 1] = crc32; - printf("duplicate %08x in slot %d -> slot %d\n",crc32,i,i>>1); + dup++; + printf("duplicate %08x in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); } *duplicatep = 1; break; From cabf8448798eac39f8fec0943eae0b7809dbd335 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:17:30 +0300 Subject: [PATCH 081/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 638f2425e..2b1a3b9e5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -249,7 +249,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method","broadcast"); - msg = (void *)jprint(argjson,1); + msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; LP_queuesend(-1,base,rel,msg,msglen); free(msg); From f6616598349cc5d7d474f99a314601307ec80584 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:28:13 +0300 Subject: [PATCH 082/682] Test --- iguana/exchanges/LP_network.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2b1a3b9e5..b10a2f96f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,6 +87,7 @@ struct LP_queue uint32_t starttime,crc32; uint8_t msg[]; } *LP_Q; +int32_t LP_Qenqueued,LP_Qdequeued; void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { @@ -98,6 +99,7 @@ void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) ptr->msglen = msglen; memcpy(ptr->msg,msg,msglen); DL_APPEND(LP_Q,ptr); + LP_Qenqueued++; } void queue_loop(void *ignore) @@ -111,13 +113,14 @@ void queue_loop(void *ignore) portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); portable_mutex_unlock(&LP_networkmutex); + LP_Qdequeued++; if ( ptr->sock >= 0 ) { if ( LP_sockcheck(ptr->sock) > 0 ) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); - else printf("qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); + //else printf("qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -150,10 +153,11 @@ void queue_loop(void *ignore) } if ( ptr != 0 ) { - printf("reQ: qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); + printf("reQ: qsent %u msglen.%d (+%d, -%d) -> %d\n",ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); portable_mutex_lock(&LP_networkmutex); DL_APPEND(LP_Q,ptr); portable_mutex_unlock(&LP_networkmutex); + LP_Qenqueued++; } } if ( nonz == 0 ) From c155340bf69408b80c08373a6256598548d934f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:32:09 +0300 Subject: [PATCH 083/682] Test --- iguana/exchanges/LP_network.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b10a2f96f..38fa4d6f2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -100,6 +100,7 @@ void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) memcpy(ptr->msg,msg,msglen); DL_APPEND(LP_Q,ptr); LP_Qenqueued++; + printf("Q.%p\n",ptr); } void queue_loop(void *ignore) @@ -108,11 +109,11 @@ void queue_loop(void *ignore) while ( 1 ) { nonz = 0; + portable_mutex_lock(&LP_networkmutex); DL_FOREACH(LP_Q,ptr) { - portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); - portable_mutex_unlock(&LP_networkmutex); + printf("deQ.%p\n",ptr); LP_Qdequeued++; if ( ptr->sock >= 0 ) { @@ -153,13 +154,12 @@ void queue_loop(void *ignore) } if ( ptr != 0 ) { - printf("reQ: qsent %u msglen.%d (+%d, -%d) -> %d\n",ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); - portable_mutex_lock(&LP_networkmutex); + printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); DL_APPEND(LP_Q,ptr); - portable_mutex_unlock(&LP_networkmutex); LP_Qenqueued++; } } + portable_mutex_unlock(&LP_networkmutex); if ( nonz == 0 ) usleep(10000); } From e30a265f8266f7a271e6c453da00ea2150cf2db1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:37:14 +0300 Subject: [PATCH 084/682] Test --- iguana/exchanges/LP_network.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 38fa4d6f2..04fb91f19 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -100,7 +100,7 @@ void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) memcpy(ptr->msg,msg,msglen); DL_APPEND(LP_Q,ptr); LP_Qenqueued++; - printf("Q.%p\n",ptr); + printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); } void queue_loop(void *ignore) @@ -110,6 +110,7 @@ void queue_loop(void *ignore) { nonz = 0; portable_mutex_lock(&LP_networkmutex); + printf("LP_Q next.%p prev.%p\n",LP_Q->next,LP_Q->prev); DL_FOREACH(LP_Q,ptr) { DL_DELETE(LP_Q,ptr); @@ -146,7 +147,7 @@ void queue_loop(void *ignore) ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { - printf("no more peers to try at peerind.%d\n",ptr->peerind); + printf("no more peers to try at peerind.%d %p\n",ptr->peerind,ptr); free(ptr); ptr = 0; } @@ -154,9 +155,9 @@ void queue_loop(void *ignore) } if ( ptr != 0 ) { - printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); DL_APPEND(LP_Q,ptr); LP_Qenqueued++; + printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); } } portable_mutex_unlock(&LP_networkmutex); From 7fc89f7d78a4956aadd14fce17124fada2201e18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:38:49 +0300 Subject: [PATCH 085/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 04fb91f19..f772ac9fe 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -110,7 +110,7 @@ void queue_loop(void *ignore) { nonz = 0; portable_mutex_lock(&LP_networkmutex); - printf("LP_Q next.%p prev.%p\n",LP_Q->next,LP_Q->prev); + printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); DL_FOREACH(LP_Q,ptr) { DL_DELETE(LP_Q,ptr); From deae68d217a2676c8cb617c9ccce171e29572d92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:42:07 +0300 Subject: [PATCH 086/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f772ac9fe..4a73d2080 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -147,8 +147,8 @@ void queue_loop(void *ignore) ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { - printf("no more peers to try at peerind.%d %p\n",ptr->peerind,ptr); - free(ptr); + printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); + //free(ptr); ptr = 0; } } From abc82217da249a87bf45010fc6a0ac543d83d7e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:44:11 +0300 Subject: [PATCH 087/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 4a73d2080..7b388e994 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -145,10 +145,10 @@ void queue_loop(void *ignore) else { ptr->peerind++; - if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) + //if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); - //free(ptr); + free(ptr); ptr = 0; } } From 2f9895144ad72628b500abe96c00c51d3bebf4b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:49:39 +0300 Subject: [PATCH 088/682] Test --- iguana/exchanges/LP_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7b388e994..eab936b3b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -114,12 +114,12 @@ void queue_loop(void *ignore) DL_FOREACH(LP_Q,ptr) { DL_DELETE(LP_Q,ptr); - printf("deQ.%p\n",ptr); LP_Qdequeued++; if ( ptr->sock >= 0 ) { if ( LP_sockcheck(ptr->sock) > 0 ) { + nonz++; if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); //else printf("qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); @@ -135,6 +135,7 @@ void queue_loop(void *ignore) } else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { + nonz++; LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { @@ -145,7 +146,7 @@ void queue_loop(void *ignore) else { ptr->peerind++; - //if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) + if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); free(ptr); From 6607d5320ff6ff57559558b4271eda549b98c385 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:55:18 +0300 Subject: [PATCH 089/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eab936b3b..901af2a29 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -133,7 +133,7 @@ void queue_loop(void *ignore) } } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) + else if ( 0 && time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { nonz++; LP_crc32find(&duplicate,-1,ptr->crc32); From dde31cc0dd56e2e715d34147278b429a6a97110e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 15:59:34 +0300 Subject: [PATCH 090/682] Test --- iguana/exchanges/LP_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 901af2a29..fd642811b 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -133,10 +133,11 @@ void queue_loop(void *ignore) } } } - else if ( 0 && time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { nonz++; - LP_crc32find(&duplicate,-1,ptr->crc32); + duplicate = 1; + //LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { printf("found crc32.%u\n",ptr->crc32); From b3e3790fc35b0d532afcaebec2ce0e34c8d32146 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:01:13 +0300 Subject: [PATCH 091/682] Test --- iguana/exchanges/LP_network.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index fd642811b..d3689c833 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -141,7 +141,7 @@ void queue_loop(void *ignore) if ( duplicate > 0 ) { printf("found crc32.%u\n",ptr->crc32); - free(ptr); + //free(ptr); ptr = 0; } else @@ -150,16 +150,16 @@ void queue_loop(void *ignore) if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); - free(ptr); + //free(ptr); ptr = 0; } } } if ( ptr != 0 ) { + printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); DL_APPEND(LP_Q,ptr); LP_Qenqueued++; - printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); } } portable_mutex_unlock(&LP_networkmutex); From 96516b435d6eccb5aefc02366f332c90db79b269 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:03:33 +0300 Subject: [PATCH 092/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d3689c833..eabf4f6f2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -105,13 +105,13 @@ void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) void queue_loop(void *ignore) { - struct LP_queue *ptr; int32_t sentbytes,nonz,duplicate; + struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,duplicate; while ( 1 ) { nonz = 0; portable_mutex_lock(&LP_networkmutex); printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); - DL_FOREACH(LP_Q,ptr) + DL_FOREACH_SAFE(LP_Q,ptr,tmp) { DL_DELETE(LP_Q,ptr); LP_Qdequeued++; From 8e71195f74e924b8e29019513af9a4cae544db46 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:04:49 +0300 Subject: [PATCH 093/682] Test --- iguana/exchanges/LP_network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index eabf4f6f2..3d121ef1c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -136,12 +136,12 @@ void queue_loop(void *ignore) else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { nonz++; - duplicate = 1; - //LP_crc32find(&duplicate,-1,ptr->crc32); + //duplicate = 1; + LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { printf("found crc32.%u\n",ptr->crc32); - //free(ptr); + free(ptr); ptr = 0; } else @@ -150,7 +150,7 @@ void queue_loop(void *ignore) if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); - //free(ptr); + free(ptr); ptr = 0; } } From e98ce168bb2843e156c2075d8c2e8524f1a7f26f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:06:41 +0300 Subject: [PATCH 094/682] Test --- iguana/exchanges/LP_network.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 3d121ef1c..698d59bf8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -135,11 +135,10 @@ void queue_loop(void *ignore) } else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { - nonz++; - //duplicate = 1; LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { + nonz++; printf("found crc32.%u\n",ptr->crc32); free(ptr); ptr = 0; From b27fa2fdc92db1fe683ac3a375fa8b5738e61140 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:09:48 +0300 Subject: [PATCH 095/682] Test --- iguana/exchanges/LP_network.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 698d59bf8..455ad4844 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -113,8 +113,6 @@ void queue_loop(void *ignore) printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); DL_FOREACH_SAFE(LP_Q,ptr,tmp) { - DL_DELETE(LP_Q,ptr); - LP_Qdequeued++; if ( ptr->sock >= 0 ) { if ( LP_sockcheck(ptr->sock) > 0 ) @@ -128,6 +126,9 @@ void queue_loop(void *ignore) ptr->starttime = (uint32_t)time(NULL); else { + nonz++; + DL_DELETE(LP_Q,ptr); + LP_Qdequeued++; free(ptr); ptr = 0; } @@ -140,6 +141,8 @@ void queue_loop(void *ignore) { nonz++; printf("found crc32.%u\n",ptr->crc32); + LP_Qdequeued++; + DL_DELETE(LP_Q,ptr); free(ptr); ptr = 0; } @@ -148,18 +151,21 @@ void queue_loop(void *ignore) ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { + nonz++; printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); + LP_Qdequeued++; + DL_DELETE(LP_Q,ptr); free(ptr); ptr = 0; } } } - if ( ptr != 0 ) + /*if ( ptr != 0 ) { printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); DL_APPEND(LP_Q,ptr); LP_Qenqueued++; - } + }*/ } portable_mutex_unlock(&LP_networkmutex); if ( nonz == 0 ) From 4da71e07cb077a39709052b565029427dd9ac471 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:14:57 +0300 Subject: [PATCH 096/682] Test --- iguana/exchanges/LP_network.c | 40 ++++++++++++++++------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 455ad4844..3b10b51e0 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -105,33 +105,28 @@ void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) void queue_loop(void *ignore) { - struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,duplicate; + struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; while ( 1 ) { nonz = 0; portable_mutex_lock(&LP_networkmutex); - printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); + //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); + n = 0; DL_FOREACH_SAFE(LP_Q,ptr,tmp) { + n++; + flag = 0; if ( ptr->sock >= 0 ) { if ( LP_sockcheck(ptr->sock) > 0 ) { - nonz++; if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); - //else printf("qsent %u msglen.%d\n",ptr->crc32,ptr->msglen); + else printf("%p qsent %u msglen.%d\n",ptr,ptr->crc32,ptr->msglen); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); - else - { - nonz++; - DL_DELETE(LP_Q,ptr); - LP_Qdequeued++; - free(ptr); - ptr = 0; - } + else flag = 1; } } else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) @@ -139,27 +134,27 @@ void queue_loop(void *ignore) LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { - nonz++; printf("found crc32.%u\n",ptr->crc32); - LP_Qdequeued++; - DL_DELETE(LP_Q,ptr); - free(ptr); - ptr = 0; + flag = 1; } else { ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { - nonz++; printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); - LP_Qdequeued++; - DL_DELETE(LP_Q,ptr); - free(ptr); - ptr = 0; + flag = 1; } } } + if ( flag != 0 ) + { + nonz++; + DL_DELETE(LP_Q,ptr); + LP_Qdequeued++; + free(ptr); + ptr = 0; + } /*if ( ptr != 0 ) { printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); @@ -168,6 +163,7 @@ void queue_loop(void *ignore) }*/ } portable_mutex_unlock(&LP_networkmutex); + printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(10000); } From 81b47558dd8fb63a7a2d11c2eefb17af3e82d0ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:18:08 +0300 Subject: [PATCH 097/682] Test --- iguana/exchanges/LP_network.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 3b10b51e0..9af822dab 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -121,12 +121,14 @@ void queue_loop(void *ignore) if ( LP_sockcheck(ptr->sock) > 0 ) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) + { printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); - else printf("%p qsent %u msglen.%d\n",ptr,ptr->crc32,ptr->msglen); + flag = 1; + } else printf("%p qsent %u msglen.%d\n",ptr,ptr->crc32,ptr->msglen); ptr->sock = -1; - if ( ptr->peerind > 0 ) + /*if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); - else flag = 1; + else flag = 1;*/ } } else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) @@ -165,7 +167,7 @@ void queue_loop(void *ignore) portable_mutex_unlock(&LP_networkmutex); printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) - usleep(10000); + usleep(500000); } } From 6f3b856a5f868991a0ccc6cc5d1923448cd1b4f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:20:38 +0300 Subject: [PATCH 098/682] Test --- iguana/exchanges/LP_network.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9af822dab..f37e3acda 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -109,7 +109,6 @@ void queue_loop(void *ignore) while ( 1 ) { nonz = 0; - portable_mutex_lock(&LP_networkmutex); //printf("LP_Q.%p next.%p prev.%p\n",LP_Q,LP_Q!=0?LP_Q->next:0,LP_Q!=0?LP_Q->prev:0); n = 0; DL_FOREACH_SAFE(LP_Q,ptr,tmp) @@ -122,9 +121,9 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) { - printf("LP_send sent %d instead of %d\n",sentbytes,ptr->msglen); + printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); flag = 1; - } else printf("%p qsent %u msglen.%d\n",ptr,ptr->crc32,ptr->msglen); + } else printf("%d %p qsent %u msglen.%d\n",n,ptr,ptr->crc32,ptr->msglen); ptr->sock = -1; /*if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -136,7 +135,7 @@ void queue_loop(void *ignore) LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { - printf("found crc32.%u\n",ptr->crc32); + printf("%d found crc32.%u\n",n,ptr->crc32); flag = 1; } else @@ -144,7 +143,7 @@ void queue_loop(void *ignore) ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { - printf("no more peers to try at peerind.%d %p Q_LP.%p\n",ptr->peerind,ptr,LP_Q); + printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); flag = 1; } } @@ -152,19 +151,15 @@ void queue_loop(void *ignore) if ( flag != 0 ) { nonz++; + printf("free %p nonz.%d\n",ptr,nonz); + portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); + portable_mutex_unlock(&LP_networkmutex); LP_Qdequeued++; free(ptr); ptr = 0; } - /*if ( ptr != 0 ) - { - printf("reQ.%p: %u msglen.%d (+%d, -%d) -> %d\n",ptr,ptr->crc32,ptr->msglen,LP_Qenqueued,LP_Qdequeued,LP_Qenqueued-LP_Qdequeued); - DL_APPEND(LP_Q,ptr); - LP_Qenqueued++; - }*/ } - portable_mutex_unlock(&LP_networkmutex); printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(500000); From b5fe5f5af50aff1646cb9e64fb7dadc163e1e092 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:21:58 +0300 Subject: [PATCH 099/682] Test --- iguana/exchanges/LP_network.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f37e3acda..da19a4b10 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -120,10 +120,9 @@ void queue_loop(void *ignore) if ( LP_sockcheck(ptr->sock) > 0 ) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) - { printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - flag = 1; - } else printf("%d %p qsent %u msglen.%d\n",n,ptr,ptr->crc32,ptr->msglen); + else printf("%d %p qsent %u msglen.%d\n",n,ptr,ptr->crc32,ptr->msglen); + flag = 1; ptr->sock = -1; /*if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); From 1a95e0362d2e361237df6016d86551303560eaa5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:23:36 +0300 Subject: [PATCH 100/682] Test --- iguana/exchanges/LP_network.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index da19a4b10..372450872 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -121,12 +121,11 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else printf("%d %p qsent %u msglen.%d\n",n,ptr,ptr->crc32,ptr->msglen); - flag = 1; + else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; - /*if ( ptr->peerind > 0 ) + if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); - else flag = 1;*/ + else flag = 1; } } else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) From 075715466de9ae68e17984f127242deeee3590a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:23:55 +0300 Subject: [PATCH 101/682] Test --- iguana/exchanges/LP_network.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 372450872..45a58f60f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -158,7 +158,8 @@ void queue_loop(void *ignore) ptr = 0; } } - printf("LP_Q.[%d]\n",n); + if ( n != 0 ) + printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(500000); } From 212a456a701755e9779bdabc8d11d16a5e51400b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:26:35 +0300 Subject: [PATCH 102/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cd3ffacc0..944b10835 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -147,6 +147,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; + printf("recv.%u\n",crc32); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) From 0a71ce2d4ff51d4daa99b41989b45d23c2f57d45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:30:00 +0300 Subject: [PATCH 103/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 944b10835..9e387d386 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -302,8 +302,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; - if ( nn_poll(&pfd,1,1) != 1 ) - break; + //if ( nn_poll(&pfd,1,1) != 1 ) + // break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { nonz++; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 45a58f60f..9df1dad44 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -158,8 +158,8 @@ void queue_loop(void *ignore) ptr = 0; } } - if ( n != 0 ) - printf("LP_Q.[%d]\n",n); + //if ( n != 0 ) + // printf("LP_Q.[%d]\n",n); if ( nonz == 0 ) usleep(500000); } From ae1f28bf8e53984badb0bf1a00bf23fc85b5f08c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:37:23 +0300 Subject: [PATCH 104/682] Test --- iguana/exchanges/LP_nativeDEX.c | 9 +++++++-- iguana/exchanges/LP_network.c | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9e387d386..c2128f154 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -302,10 +302,12 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; - //if ( nn_poll(&pfd,1,1) != 1 ) - // break; + if ( nn_poll(&pfd,1,1) != 1 ) + break; + printf("checking sock.%d\n",sock); if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { + printf("got recvlen.%d\n",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) free(retstr); @@ -332,10 +334,13 @@ void command_rpcloop(void *myipaddr) peer->errors--; else continue; } + printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.); } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { + if ( coin->inactive != 0 ) + continue; if ( coin->bussock >= 0 ) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 9df1dad44..e4897a863 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -73,7 +73,7 @@ int32_t LP_peerindsock(int32_t *peerindp) if ( peerind < *peerindp ) continue; *peerindp = peerind; - printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); + //printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); return(peer->pushsock); } } @@ -609,7 +609,10 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char { *mypullportp = 0; if ( ispaired == 0 ) + { + strcpy(publicaddr,"127.0.0.1"); return(-1); + } while ( *mypullportp == 0 ) { if ( (*mypullportp= LP_psock_get(connectaddr,publicaddr,ispaired)) != 0 ) From 8231121b923957834b473ef7833fa6820a909ddd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:39:21 +0300 Subject: [PATCH 105/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c2128f154..e7bce3d5d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -304,10 +304,10 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) break; - printf("checking sock.%d\n",sock); + //printf("checking sock.%d\n",sock); if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - printf("got recvlen.%d\n",recvlen); + //printf("got recvlen.%d\n",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) free(retstr); From b3964bd7a8140bc950c0baa6a12a2fb87f8883ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:41:29 +0300 Subject: [PATCH 106/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e7bce3d5d..48545380f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -334,7 +334,7 @@ void command_rpcloop(void *myipaddr) peer->errors--; else continue; } - printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); + //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.); } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht From a695b9c683d2b480865f3d062cbb36f30dec3d5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:44:51 +0300 Subject: [PATCH 107/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 48545380f..8183c5298 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -304,10 +304,8 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) break; - //printf("checking sock.%d\n",sock); if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { - //printf("got recvlen.%d\n",recvlen); nonz++; if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e4897a863..f0d4d2521 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -121,7 +121,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + //else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -149,7 +149,7 @@ void queue_loop(void *ignore) if ( flag != 0 ) { nonz++; - printf("free %p nonz.%d\n",ptr,nonz); + //printf("free %p nonz.%d\n",ptr,nonz); portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); portable_mutex_unlock(&LP_networkmutex); From 316d569196e0695e2ffd41bf233a3d1e35eb0927 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:51:43 +0300 Subject: [PATCH 108/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8183c5298..299173c56 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -147,7 +147,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("recv.%u\n",crc32); + printf("%s recv.%u\n",typestr,crc32); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f0d4d2521..304f7e72a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -149,7 +149,6 @@ void queue_loop(void *ignore) if ( flag != 0 ) { nonz++; - //printf("free %p nonz.%d\n",ptr,nonz); portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); portable_mutex_unlock(&LP_networkmutex); @@ -239,6 +238,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 } if ( IAMLP != 0 ) { + printf("queuesend %d -> %d\n",msglen,pubsock); LP_queuesend(pubsock,base,rel,msg,msglen); } else From a5336fb180414ba819ed0bb38e9362306b69fb07 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:55:58 +0300 Subject: [PATCH 109/682] Test --- iguana/exchanges/LP_network.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 304f7e72a..41d85fed4 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -173,7 +173,11 @@ void _LP_queuesend(int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32 { if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); - else sock0 = -1; + else + { + printf("_LP_queuesend %d\n",msglen); + sock0 = -1; + } } if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) { @@ -199,17 +203,17 @@ void _LP_queuesend(int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32 void LP_queuesend(int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) { - struct iguana_info *coin; int32_t flag=0,socks[2]; + //struct iguana_info *coin; int32_t flag=0,socks[2]; if ( pubsock >= 0 ) { - socks[0] = socks[1] = -1; - if ( rel != 0 && rel[0] != 0 && (coin= LP_coinfind(rel)) != 0 && coin->bussock >= 0 ) - socks[flag++] = coin->bussock; - if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) - socks[flag++] = coin->bussock; - if ( flag == 0 && pubsock >= 0 ) + //socks[0] = socks[1] = -1; + //if ( rel != 0 && rel[0] != 0 && (coin= LP_coinfind(rel)) != 0 && coin->bussock >= 0 ) + // socks[flag++] = coin->bussock; + //if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) + // socks[flag++] = coin->bussock; + //if ( flag == 0 && pubsock >= 0 ) _LP_queuesend(pubsock,-1,msg,msglen,0); - else _LP_queuesend(socks[0],socks[1],msg,msglen,0); + //else _LP_queuesend(socks[0],socks[1],msg,msglen,0); } else _LP_queuesend(-1,-1,msg,msglen,1); } From d8f9497ee19ad452a568792ac5171a078dd408d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 16:58:31 +0300 Subject: [PATCH 110/682] Test --- iguana/exchanges/LP_peers.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 3e24cf9cb..d0778931e 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -120,12 +120,15 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char memset(zero.bytes,0,sizeof(zero)); //LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); LP_broadcast_message(mypubsock,"","",zero,msg); - HASH_ITER(hh,LP_coins,coin,ctmp) + if ( 0 ) { - if ( coin->bussock >= 0 ) + HASH_ITER(hh,LP_coins,coin,ctmp) { - nanomsg_transportname(0,busaddr,peer->ipaddr,coin->busport); - nn_connect(coin->bussock,busaddr); + if ( coin->bussock >= 0 ) + { + nanomsg_transportname(0,busaddr,peer->ipaddr,coin->busport); + nn_connect(coin->bussock,busaddr); + } } } } @@ -137,6 +140,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char int32_t LP_coinbus(uint16_t coin_busport) { struct LP_peerinfo *peer,*tmp; char busaddr[64]; int32_t timeout,bussock = -1; + return(-1); if ( IAMLP != 0 && LP_mypeer != 0 && (bussock= nn_socket(AF_SP,NN_BUS)) >= 0 ) { timeout = 1; From 51b8872af5b7ff0a9d8cd3ad5a3f645b441a4f0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:01:07 +0300 Subject: [PATCH 111/682] Test --- iguana/exchanges/LP_network.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 41d85fed4..f84776ddf 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -138,6 +138,7 @@ void queue_loop(void *ignore) } else { + printf("couldnt find.%u\n",ptr->crc32); ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { @@ -242,7 +243,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 } if ( IAMLP != 0 ) { - printf("queuesend %d -> %d\n",msglen,pubsock); + //printf("queuesend %d -> %d\n",msglen,pubsock); LP_queuesend(pubsock,base,rel,msg,msglen); } else From ede5b52f5029cdcf351b431b55b8a5b6bc34360b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:03:11 +0300 Subject: [PATCH 112/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 299173c56..6bd4982be 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -147,7 +147,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s recv.%u\n",typestr,crc32); + printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f84776ddf..1ca2eb4e2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -138,7 +138,7 @@ void queue_loop(void *ignore) } else { - printf("couldnt find.%u\n",ptr->crc32); + printf("couldnt find.%u (%s)\n",ptr->crc32,(char *)ptr->msg); ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { From bb7705bd01cd9c168c8fa2929709160af98110c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:06:38 +0300 Subject: [PATCH 113/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b648924bf..016a2a121 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -239,7 +239,7 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) if ( utxo->gui[0] != 0 ) jaddstr(item,"gui",utxo->gui); jaddstr(item,"coin",utxo->coin); - jaddnum(item,"now",time(NULL)); + //jaddnum(item,"now",time(NULL)); jaddnum(item,"iambob",utxo->iambob); jaddstr(item,"address",utxo->coinaddr); jaddbits256(item,"txid",utxo->payment.txid); From ff49f1003122f9fb93cd26306789cb3e93d1b062 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:35:28 +0300 Subject: [PATCH 114/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_network.c | 38 ++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 90154b383..4b75e35b2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -321,7 +321,7 @@ trust(pubkey, trust)\n\ if ( cipherlen <= sizeof(cipher) ) { decode_hex(cipher,cipherlen,cipherstr); - LP_queuesend(LP_mypubsock,base,rel,cipher,cipherlen); + LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); } else retstr = clonestr("{\"error\":\"cipherstr too big\"}"); } else diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 1ca2eb4e2..225d5cdeb 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -89,11 +89,11 @@ struct LP_queue } *LP_Q; int32_t LP_Qenqueued,LP_Qdequeued; -void _LP_sendqueueadd(int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) +void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; ptr = calloc(1,sizeof(*ptr) + msglen); - ptr->crc32 = calc_crc32(0,&msg[2],msglen-2); + ptr->crc32 = crc32; ptr->sock = sock; ptr->peerind = peerind; ptr->msglen = msglen; @@ -165,7 +165,7 @@ void queue_loop(void *ignore) } } -void _LP_queuesend(int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) +void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32_t needack) { int32_t sentbytes,peerind = 0; if ( sock0 >= 0 || sock1 >= 0 ) @@ -196,13 +196,13 @@ void _LP_queuesend(int32_t sock0,int32_t sock1,uint8_t *msg,int32_t msglen,int32 } portable_mutex_lock(&LP_networkmutex); if ( sock0 >= 0 ) - _LP_sendqueueadd(sock0,msg,msglen,needack * peerind); + _LP_sendqueueadd(crc32,sock0,msg,msglen,needack * peerind); if ( sock1 >= 0 ) - _LP_sendqueueadd(sock1,msg,msglen,needack); + _LP_sendqueueadd(crc32,sock1,msg,msglen,needack); portable_mutex_unlock(&LP_networkmutex); } -void LP_queuesend(int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) +void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msglen) { //struct iguana_info *coin; int32_t flag=0,socks[2]; if ( pubsock >= 0 ) @@ -213,9 +213,9 @@ void LP_queuesend(int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msgl //if ( base != 0 && base[0] != 0 && (coin= LP_coinfind(base)) != 0 && coin->bussock >= 0 ) // socks[flag++] = coin->bussock; //if ( flag == 0 && pubsock >= 0 ) - _LP_queuesend(pubsock,-1,msg,msglen,0); + _LP_queuesend(crc32,pubsock,-1,msg,msglen,0); //else _LP_queuesend(socks[0],socks[1],msg,msglen,0); - } else _LP_queuesend(-1,-1,msg,msglen,1); + } else _LP_queuesend(crc32,-1,-1,msg,msglen,1); } // first 2 bytes == (crc32 & 0xffff) if encrypted, then nonce is next crypto_box_NONCEBYTES @@ -223,7 +223,7 @@ void LP_queuesend(int32_t pubsock,char *base,char *rel,uint8_t *msg,int32_t msgl void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25519,char *msgstr) { - uint8_t encoded[LP_ENCRYPTED_MAXSIZE],space[sizeof(encoded)],*msg,*nonce,*cipher; int32_t encrypted=0,msglen; uint32_t crc32; cJSON *argjson; char *methodstr,method[64],cipherstr[LP_ENCRYPTED_MAXSIZE*2+1]; + uint8_t encoded[LP_ENCRYPTED_MAXSIZE],space[sizeof(encoded)],*msg,*nonce,*cipher; int32_t encrypted=0,msglen; uint32_t crc32=0; cJSON *argjson; char *methodstr,method[64],cipherstr[LP_ENCRYPTED_MAXSIZE*2+1]; msglen = (int32_t)strlen(msgstr) + 1; msg = (void *)msgstr; if ( bits256_nonz(destpub25519) != 0 ) @@ -244,7 +244,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( IAMLP != 0 ) { //printf("queuesend %d -> %d\n",msglen,pubsock); - LP_queuesend(pubsock,base,rel,msg,msglen); + LP_queuesend(crc32,pubsock,base,rel,msg,msglen); } else { @@ -257,10 +257,14 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 strcpy(method,methodstr); jdelete(argjson,"method"); jaddstr(argjson,"method2",method); + jaddstr(argjson,"method",method); + msg = (void *)jprint(argjson,0); + crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); + jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; - LP_queuesend(-1,base,rel,msg,msglen); + LP_queuesend(crc32,-1,base,rel,msg,msglen); free(msg); } else printf("no valid method in (%s)\n",msgstr); free_json(argjson); @@ -269,13 +273,17 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 else { argjson = cJSON_CreateObject(); - jaddstr(argjson,"method","broadcast"); - jaddstr(argjson,"method2","encrypted"); init_hexbytes_noT(cipherstr,msg,msglen); jaddstr(argjson,"cipher",cipherstr); - msg = (void *)jprint(argjson,1); + jaddstr(argjson,"method2","encrypted"); + jaddstr(argjson,"method","encrypted"); + msg = (void *)jprint(argjson,0); + crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); + jdelete(argjson,"method"); + jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; - LP_queuesend(-1,base,rel,msg,msglen); + LP_queuesend(crc32,-1,base,rel,msg,msglen); free(msg); } } From 9b657e2497bccfbbba7f6856b41da46fd1259415 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:50:22 +0300 Subject: [PATCH 115/682] Test --- iguana/exchanges/LP_commands.c | 6 +-- iguana/exchanges/LP_network.c | 78 ++++++++++++++++------------------ iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4b75e35b2..75769ae74 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -288,11 +288,11 @@ trust(pubkey, trust)\n\ return(LP_peers()); else if ( strcmp(method,"getutxos") == 0 ) return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); - else if ( strcmp(method,"notified") == 0 ) + else if ( strcmp(method,"utxo") == 0 ) { if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) - return(clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}")); - else return(clonestr("{\"result\":\"couldnt add utxo\"}")); + retstr = clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}"); + else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); } else { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 225d5cdeb..518d86d9d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -241,51 +241,47 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 encrypted = 1; free(msgstr), msgstr = 0; } - if ( IAMLP != 0 ) + if ( encrypted == 0 ) { - //printf("queuesend %d -> %d\n",msglen,pubsock); - LP_queuesend(crc32,pubsock,base,rel,msg,msglen); + if ( (argjson= cJSON_Parse(msgstr)) != 0 ) + { + if ( (methodstr= jstr(argjson,"method")) != 0 && strlen(methodstr) <= sizeof(method) ) + { + strcpy(method,methodstr); + jdelete(argjson,"method"); + jaddstr(argjson,"method2",method); + jaddstr(argjson,"method",method); + msg = (void *)jprint(argjson,0); + crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); + jdelete(argjson,"method"); + jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + if ( IAMLP != 0 ) + LP_queuesend(crc32,pubsock,base,rel,msg,msglen); + else LP_queuesend(crc32,-1,base,rel,msg,msglen); + free(msg); + } else printf("no valid method in (%s)\n",msgstr); + free_json(argjson); + } else printf("couldnt parse (%s)\n",msgstr); } else { - if ( encrypted == 0 ) - { - if ( (argjson= cJSON_Parse(msgstr)) != 0 ) - { - if ( (methodstr= jstr(argjson,"method")) != 0 && strlen(methodstr) <= sizeof(method) ) - { - strcpy(method,methodstr); - jdelete(argjson,"method"); - jaddstr(argjson,"method2",method); - jaddstr(argjson,"method",method); - msg = (void *)jprint(argjson,0); - crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); - jdelete(argjson,"method"); - jaddstr(argjson,"method","broadcast"); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - LP_queuesend(crc32,-1,base,rel,msg,msglen); - free(msg); - } else printf("no valid method in (%s)\n",msgstr); - free_json(argjson); - } else printf("couldnt parse (%s)\n",msgstr); - } - else - { - argjson = cJSON_CreateObject(); - init_hexbytes_noT(cipherstr,msg,msglen); - jaddstr(argjson,"cipher",cipherstr); - jaddstr(argjson,"method2","encrypted"); - jaddstr(argjson,"method","encrypted"); - msg = (void *)jprint(argjson,0); - crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); - jdelete(argjson,"method"); - jaddstr(argjson,"method","broadcast"); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - LP_queuesend(crc32,-1,base,rel,msg,msglen); - free(msg); - } + argjson = cJSON_CreateObject(); + init_hexbytes_noT(cipherstr,msg,msglen); + jaddstr(argjson,"cipher",cipherstr); + jaddstr(argjson,"method2","encrypted"); + jaddstr(argjson,"method","encrypted"); + msg = (void *)jprint(argjson,0); + crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); + jdelete(argjson,"method"); + jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + if ( IAMLP != 0 ) + LP_queuesend(crc32,pubsock,base,rel,msg,msglen); + else LP_queuesend(crc32,-1,base,rel,msg,msglen); + free(msg); } if ( msgstr != 0 ) free(msgstr); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 016a2a121..9ee1e5243 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -233,7 +233,7 @@ int32_t LP_utxopurge(int32_t allutxos) cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; - jaddstr(item,"method","notified"); + jaddstr(item,"method","utxo"); if ( utxo == 0 ) return(item); if ( utxo->gui[0] != 0 ) From 293bc04a2ba61391c74ab3579574e28fd5ea6ae0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:53:40 +0300 Subject: [PATCH 116/682] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_network.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index fbcc23581..5bcc85479 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -24,7 +24,7 @@ #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL -#define LP_ENCRYPTED_MAXSIZE (1024 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) +#define LP_ENCRYPTED_MAXSIZE (4096 + 2 + crypto_box_NONCEBYTES + crypto_box_ZEROBYTES) #define LP_MAXPUBKEY_ERRORS 3 #define PSOCK_KEEPALIVE 3600 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 518d86d9d..e1dc1db6d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -249,6 +249,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 { strcpy(method,methodstr); jdelete(argjson,"method"); + if ( jobj(argjson,"method2") != 0 ) + jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); msg = (void *)jprint(argjson,0); From 2012f902d6601006165c30a4392396053f60f9c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:54:08 +0300 Subject: [PATCH 117/682] Test --- iguana/exchanges/LP_network.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e1dc1db6d..6a1a9b269 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -174,11 +174,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 { if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); - else - { - printf("_LP_queuesend %d\n",msglen); - sock0 = -1; - } + else sock0 = -1; } if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) { From 294bb2b96dd2edf52dc3cf5c7915177adfdb670c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 17:58:05 +0300 Subject: [PATCH 118/682] Test --- iguana/exchanges/LP_network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 6a1a9b269..0a6e38ae8 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -251,6 +251,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"method",method); msg = (void *)jprint(argjson,0); crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); msg = (void *)jprint(argjson,0); From c09544afc4a5c31cc7e966cdd76c6c888c94f3bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:02:13 +0300 Subject: [PATCH 119/682] Test --- iguana/exchanges/LP_network.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0a6e38ae8..ac27882e7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -248,14 +248,14 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( jobj(argjson,"method2") != 0 ) jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); - jaddstr(argjson,"method",method); - msg = (void *)jprint(argjson,0); - crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); - jdelete(argjson,"method"); jaddstr(argjson,"method","broadcast"); msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; + crc32 = calc_crc32(0,&msg[2],msglen - 2); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //jdelete(argjson,"method"); + //jaddstr(argjson,"method","broadcast"); + //msg = (void *)jprint(argjson,0); if ( IAMLP != 0 ) LP_queuesend(crc32,pubsock,base,rel,msg,msglen); else LP_queuesend(crc32,-1,base,rel,msg,msglen); From 851163072e0f07cb3f2efac6cc12b12b4b597bdb Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:15:18 +0300 Subject: [PATCH 120/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 6 +++--- iguana/exchanges/LP_utxos.c | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6bd4982be..74c25ad54 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -223,7 +223,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, }*/ free_json(argjson); } else printf("error parsing(%s)\n",jsonstr); - } else printf("DUPLICATE.(%s)\n",(char *)ptr); + } //else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ac27882e7..0f189cbcf 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -140,11 +140,11 @@ void queue_loop(void *ignore) { printf("couldnt find.%u (%s)\n",ptr->crc32,(char *)ptr->msg); ptr->peerind++; - if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) + /*if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); flag = 1; - } + }*/ flag = 1; } } if ( flag != 0 ) @@ -252,7 +252,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9ee1e5243..42577916b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -641,11 +641,7 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n txid = jbits256(item,"txid"); //printf("parse.(%s)\n",jprint(item,0)); if ( (utxo= LP_utxoaddjson(1,-1,item)) != 0 ) - { - //if ( strcmp(utxo->coin,"HUSH") == 0 ) - // printf("%s set lasttime (%s)\n",destipaddr,jprint(item,0)); utxo->T.lasttime = now; - } } } if ( (destpeer= LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport)) != 0 ) From 9da10139cae9a6f11b73eae8edd9f5c690f805d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:19:32 +0300 Subject: [PATCH 121/682] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 74c25ad54..0f61bd5d9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -297,7 +297,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; if ( sock >= 0 ) { - while ( nonz < 10 && recvlen > 0 ) + while ( nonz < 1000 && recvlen > 0 ) { memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; @@ -335,13 +335,13 @@ void command_rpcloop(void *myipaddr) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.); } - HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht + /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { if ( coin->inactive != 0 ) continue; if ( coin->bussock >= 0 ) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); - } + }*/ if ( LP_mypullsock >= 0 ) nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,LP_profitratio - 1.); if ( LP_mybussock >= 0 ) From 01d717e3a60fc9e45ce94a056bec1ac8476c8c02 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:23:38 +0300 Subject: [PATCH 122/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_network.c | 21 ++++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 75769ae74..b28194033 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -291,8 +291,8 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"utxo") == 0 ) { if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) - retstr = clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}"); - else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); + return(clonestr("{\"result\":\"success\",\"utxo\":\"received\"}")); + else return(clonestr("{\"result\":\"couldnt add utxo\"}")); } else { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0f61bd5d9..22617a814 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -122,7 +122,7 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) crcs[i] = crcs[i >> 1]; crcs[i >> 1] = crc32; dup++; - printf("duplicate %08x in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); + printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); } *duplicatep = 1; break; @@ -317,7 +317,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int void command_rpcloop(void *myipaddr) { - int32_t nonz = 0; char *origipaddr; struct iguana_info *coin,*ctmp; struct LP_peerinfo *peer,*tmp; void *ctx; + int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; void *ctx; //struct iguana_info *coin,*ctmp; ctx = bitcoin_ctx(); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0f189cbcf..052b6fd0a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -92,15 +92,18 @@ int32_t LP_Qenqueued,LP_Qdequeued; void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; - ptr = calloc(1,sizeof(*ptr) + msglen); - ptr->crc32 = crc32; - ptr->sock = sock; - ptr->peerind = peerind; - ptr->msglen = msglen; - memcpy(ptr->msg,msg,msglen); - DL_APPEND(LP_Q,ptr); - LP_Qenqueued++; - printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); + if ( LP_Qenqueued == 0 ) + { + ptr = calloc(1,sizeof(*ptr) + msglen); + ptr->crc32 = crc32; + ptr->sock = sock; + ptr->peerind = peerind; + ptr->msglen = msglen; + memcpy(ptr->msg,msg,msglen); + DL_APPEND(LP_Q,ptr); + LP_Qenqueued++; + //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); + } } void queue_loop(void *ignore) From 0cc6e017aeb5ad08aa33d667ddb7e87740b4e639 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:27:15 +0300 Subject: [PATCH 123/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 052b6fd0a..bbe2ad91f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -143,11 +143,11 @@ void queue_loop(void *ignore) { printf("couldnt find.%u (%s)\n",ptr->crc32,(char *)ptr->msg); ptr->peerind++; - /*if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) + if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); flag = 1; - }*/ flag = 1; + } } } if ( flag != 0 ) From 25afa3b4cfa81fedaf9bf6c8b30c581a288b0db1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:34:36 +0300 Subject: [PATCH 124/682] Test --- iguana/exchanges/LP_commands.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b28194033..e2a82dddb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -21,7 +21,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { - char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson; struct iguana_info *ptr; + char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { @@ -127,7 +127,6 @@ trust(pubkey, trust)\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { - cJSON *reqjson; if ( (reqjson= LP_dereference(argjson,"sendmessage")) != 0 ) { LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(reqjson,1)); @@ -239,6 +238,20 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"trust") == 0 ) return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); } + if ( IAMLP == 0 ) + { + if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) + { + argjson = reqjson; + if ( jobj(argjson,"method2") != 0 ) + { + jdelete(argjson,"method"); + method = jstr(argjson,"method2"); + jaddstr(argjson,"method",method); + jdelete(argjson,"method2"); + } + } + } if ( LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) @@ -312,7 +325,7 @@ trust(pubkey, trust)\n\ } if ( strcmp(method,"broadcast") == 0 ) { - cJSON *reqjson; bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; + bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { if ( (cipherstr= jstr(reqjson,"cipherstr")) != 0 ) @@ -327,7 +340,7 @@ trust(pubkey, trust)\n\ else { memset(zero.bytes,0,sizeof(zero)); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,1)); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); @@ -357,6 +370,8 @@ trust(pubkey, trust)\n\ }*/ } } + if ( reqjson != 0 ) + free_json(reqjson); if ( retstr != 0 ) { free(retstr); From 08a2e10174bb2177b6ace8a1f0a69ed6dd8a8fe2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:36:37 +0300 Subject: [PATCH 125/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index bbe2ad91f..d5440d4bf 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -92,7 +92,7 @@ int32_t LP_Qenqueued,LP_Qdequeued; void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; - if ( LP_Qenqueued == 0 ) + if ( LP_Qenqueued == 0 || IAMLP != 0 ) { ptr = calloc(1,sizeof(*ptr) + msglen); ptr->crc32 = crc32; From bc6c7695c241488fac3c4e2f667313dbc23eb2b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:38:43 +0300 Subject: [PATCH 126/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index e2a82dddb..56225f4a4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -370,6 +370,7 @@ trust(pubkey, trust)\n\ }*/ } } + printf("ERROR.(%s)\n",jprint(argjson,0)); if ( reqjson != 0 ) free_json(reqjson); if ( retstr != 0 ) @@ -377,6 +378,5 @@ trust(pubkey, trust)\n\ free(retstr); return(0); } - printf("ERROR.(%s)\n",jprint(argjson,0)); return(0); } From 8fc3c056ad39600e44abfc42774c6933d40daeb5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 18:59:51 +0300 Subject: [PATCH 127/682] Test --- iguana/exchanges/DEXstats.h | 2 +- iguana/exchanges/LP_commands.c | 12 +++--- iguana/exchanges/LP_forwarding.c | 4 +- iguana/exchanges/LP_include.h | 11 +++--- iguana/exchanges/LP_nativeDEX.c | 68 +++++++++++++++----------------- iguana/exchanges/LP_network.c | 3 +- iguana/exchanges/LP_ordermatch.c | 28 ++++++------- iguana/exchanges/LP_peers.c | 20 +++++----- iguana/exchanges/LP_rpc.c | 14 +++---- iguana/exchanges/LP_utxos.c | 22 +++++------ iguana/exchanges/mm.c | 9 +++-- iguana/exchanges/stats.c | 6 +-- 12 files changed, 97 insertions(+), 102 deletions(-) diff --git a/iguana/exchanges/DEXstats.h b/iguana/exchanges/DEXstats.h index dec43b0cc..919e6d0ff 100644 --- a/iguana/exchanges/DEXstats.h +++ b/iguana/exchanges/DEXstats.h @@ -927,7 +927,7 @@ char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t } #ifndef FROM_MARKETMAKER -char *stats_JSON(char *myipaddr,int32_t mypubsock,double profitmargin,cJSON *argjson,char *remoteaddr,uint16_t port) +char *stats_JSON(char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) { char *method,*agent,*retstr,*source,*dest; struct tai T; uint32_t endtimestamp; struct DEXstats_disp prices[365]; int32_t leftdatenum,seconds,numdates; if ( (method= jstr(argjson,"method")) == 0 ) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 56225f4a4..f52b838db 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -19,7 +19,7 @@ // -char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port +char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); @@ -42,7 +42,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJ peer->numutxos = othernumutxos; } //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); - } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jdouble(argjson,"profit"),jint(argjson,"numpeers"),jint(argjson,"numutxos")); + } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos")); } } if ( (method= jstr(argjson,"method")) == 0 ) @@ -145,7 +145,7 @@ trust(pubkey, trust)\n\ { if ( LP_mypriceset(base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); - else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,profitmargin,base,rel,price * LP_profitratio)); + else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } else if ( strcmp(method,"myprice") == 0 ) @@ -172,7 +172,7 @@ trust(pubkey, trust)\n\ if ( price > SMALLVAL || jobj(argjson,"quote") != 0 ) { LP_quoteparse(&Q,jobj(argjson,"quote")); - return(LP_trade(ctx,myipaddr,pubsock,profitmargin,&Q,price,jint(argjson,"timeout"),jint(argjson,"duration"))); + return(LP_trade(ctx,myipaddr,pubsock,&Q,price,jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set or no quote object\"}")); } else if ( strcmp(method,"autotrade") == 0 ) @@ -181,7 +181,7 @@ trust(pubkey, trust)\n\ { printf("price set (%s/%s) <- %.8f\n",rel,base,1./price); LP_mypriceset(rel,base,1./price); - return(LP_autotrade(ctx,myipaddr,pubsock,profitmargin,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); + return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } @@ -284,7 +284,7 @@ trust(pubkey, trust)\n\ if ( (reqjson= LP_dereference(argjson,"forward")) != 0 ) { //printf("FORWARDED.(%s)\n",jprint(argjson,0)); - if ( LP_forward(ctx,myipaddr,pubsock,profitmargin,jbits256(argjson,"pubkey"),jprint(reqjson,1),1) > 0 ) + if ( LP_forward(ctx,myipaddr,pubsock,jbits256(argjson,"pubkey"),jprint(reqjson,1),1) > 0 ) retstr = clonestr("{\"result\":\"success\"}"); else retstr = clonestr("{\"result\":\"error forwarding\"}"); } else retstr = clonestr("{\"result\":\"cant recurse forwards\"}"); diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 0106e7296..749cf2f2e 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -288,7 +288,7 @@ char *LP_forwardhex(void *ctx,int32_t pubsock,bits256 pubkey,char *hexstr) return(retstr); } -int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,bits256 pubkey,char *jsonstr,int32_t freeflag) +int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,bits256 pubkey,char *jsonstr,int32_t freeflag) { struct LP_forwardinfo *ptr; struct LP_peerinfo *peer,*tmp; char *msg,*hexstr,*retstr; int32_t len,n=0,mlen; cJSON *reqjson,*argjson; if ( jsonstr == 0 || jsonstr[0] == 0 ) @@ -301,7 +301,7 @@ int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin, printf("GOT FORWARDED.(%s)\n",myipaddr); if ( (argjson= cJSON_Parse(jsonstr)) != 0 ) { - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,0,0,profitmargin)) != 0 ) + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,0,0)) != 0 ) free(retstr); free_json(argjson); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5bcc85479..d607c0f6f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -175,7 +175,7 @@ struct iguana_info { UT_hash_handle hh; portable_mutex_t txmutex; struct LP_transaction *transactions; - uint64_t txfee; double estimatedrate,profitmargin; + uint64_t txfee; double estimatedrate; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; uint32_t counter,inactive,lastmempool,lastgetinfo; uint8_t pubtype,p2shtype,isPoS,wiftype,taddr; @@ -190,7 +190,7 @@ struct LP_utxobob { struct _LP_utxoinfo utxo,deposit; }; struct LP_utxoalice { struct _LP_utxoinfo utxo,fee; }; -struct LP_utxoswap { bits256 otherpubkey; void *swap; uint64_t satoshis; double profitmargin; }; +struct LP_utxoswap { bits256 otherpubkey; void *swap; uint64_t satoshis; }; struct LP_utxoinfo { @@ -210,7 +210,6 @@ struct LP_peerinfo { UT_hash_handle hh; uint64_t ip_port; - double profitmargin; uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos,lastpeers,diduquery,good; int32_t pushsock,subsock; uint16_t port; @@ -255,14 +254,14 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 //double LP_query(char *method,struct LP_quoteinfo *qp,char *base,char *rel,bits256 mypub); int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct basilisk_rawtx *rawtx,int32_t v,uint8_t *recvbuf,int32_t recvlen,int32_t suppress_pubkeys); void LP_quotesinit(char *base,char *rel); -int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,bits256 pubkey,char *jsonstr,int32_t freeflag); +int32_t LP_forward(void *ctx,char *myipaddr,int32_t pubsock,bits256 pubkey,char *jsonstr,int32_t freeflag); int32_t LP_ismine(struct LP_utxoinfo *utxo); int32_t LP_isavailable(struct LP_utxoinfo *utxo); struct LP_peerinfo *LP_peerfind(uint32_t ipbits,uint16_t port); -char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin); +char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen); void LP_availableset(struct LP_utxoinfo *utxo); int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2); -int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin); +int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock); uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired); void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 22617a814..9c7a1d1f2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -88,14 +88,14 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_ordermatch.c" #include "LP_commands.c" -char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin) +char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *retstr=0; if ( jobj(argjson,"result") != 0 || jobj(argjson,"error") != 0 ) return(0); - if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen,profitmargin) <= 0 ) + if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,profitmargin,argjson,"127.0.0.1",0)) != 0 ) + if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && @@ -141,7 +141,7 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) } } -char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,double profitmargin,uint8_t *ptr,int32_t recvlen,int32_t recvsock) +char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,uint8_t *ptr,int32_t recvlen,int32_t recvsock) { int32_t i,len,datalen=0,duplicate=0,encrypted=0; char *retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; crc32 = calc_crc32(0,&ptr[2],recvlen-2); @@ -202,7 +202,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); } } - else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len,profitmargin)) != 0 ) + else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } /*if ( LP_COMMAND_RECVSOCK == NN_REP ) @@ -232,7 +232,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, return(retstr); } -/*int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin) +/*int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock) { void *ptr; int32_t recvlen=-1,nonz = 0; *retstrp = 0; @@ -241,13 +241,13 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, while ( (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) > 0 ) { nonz++; - *retstrp = LP_process_message(ctx,"PULL",myipaddr,pubsock,profitmargin,ptr,recvlen,pullsock); + *retstrp = LP_process_message(ctx,"PULL",myipaddr,pubsock,ptr,recvlen,pullsock); } } return(nonz); }*/ -void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo,double profitmargin) +void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; char str[65]; uint32_t now = (uint32_t)time(NULL); //printf("%s lag.%d\n",bits256_str(str,utxo->txid),now-utxo->lastspentcheck); @@ -268,13 +268,13 @@ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo,double profitma } } -void LP_myutxo_updates(void *ctx,int32_t pubsock,char *passphrase,double profitmargin) +void LP_myutxo_updates(void *ctx,int32_t pubsock,char *passphrase) { //LP_utxopurge(0); not good to disrupt existing pointers LP_privkey_updates(ctx,pubsock,passphrase,0); } -int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,double profitmargin,int32_t interval) +int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,int32_t interval) { int32_t lastn,n = -1; if ( peer->lastutxos < now-interval ) @@ -286,13 +286,13 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu { peer->lastutxos = now; //printf("query utxos from %s\n",peer->ipaddr); - n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,profitmargin); + n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport); } } //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos); return(n); } -int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin) +int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) { int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; if ( sock >= 0 ) @@ -307,7 +307,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { nonz++; - if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) + if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); } } @@ -333,7 +333,7 @@ void command_rpcloop(void *myipaddr) else continue; } //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); - nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.); + nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -343,15 +343,15 @@ void command_rpcloop(void *myipaddr) nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); }*/ if ( LP_mypullsock >= 0 ) - nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,LP_profitratio - 1.); + nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock); if ( LP_mybussock >= 0 ) - nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock,LP_profitratio - 1.); + nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) usleep(10000); } } -int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase,double profitmargin) +int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) { static uint32_t counter,numpeers; //lastforward struct LP_utxoinfo *utxo,*utmp; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0,n=0,lastn=-1; @@ -378,14 +378,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP != 0 && peer->numpeers != numpeers ) printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) - LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport,profitmargin); + LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); } if ( peer->diduquery == 0 ) { if ( lastn != n || n < 20 ) { lastn = n; - n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,profitmargin,60); + n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,60); } LP_peer_pricesquery(peer->ipaddr,peer->port); peer->diduquery = now; @@ -393,7 +393,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( (counter % 600) == 10 ) { - LP_myutxo_updates(ctx,pubsock,passphrase,profitmargin); + LP_myutxo_updates(ctx,pubsock,passphrase); /*if ( lastforward < now-3600 ) { if ( (retstr= LP_registerall(0)) != 0 ) @@ -403,11 +403,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int }*/ HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) { - LP_utxo_spentcheck(pubsock,utxo,profitmargin); + LP_utxo_spentcheck(pubsock,utxo); } HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) { - LP_utxo_spentcheck(pubsock,utxo,profitmargin); + LP_utxo_spentcheck(pubsock,utxo); if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 ) LP_utxo_clientpublish(utxo); } @@ -510,12 +510,12 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins,char *passphrase) LP_privkey_updates(ctx,pubsock,passphrase,1); } -void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode,double profitmargin) +void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode) { int32_t i,j; uint32_t r; if ( IAMLP != 0 ) { - LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,profitmargin,0,0); + LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,0); if ( myipaddr == 0 || mypeer == 0 ) { printf("couldnt get myipaddr or null mypeer.%p\n",mypeer); @@ -527,9 +527,9 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { if ( (rand() % 100) > 25 ) continue; - LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport,profitmargin); + LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport); } - } else LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport,profitmargin); + } else LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport); } else { @@ -544,13 +544,13 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint for (j=0; j /tmp/myipaddr") == 0 ) { @@ -645,7 +639,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu LP_mypubsock = pubsock; } printf("got %s, initpeers\n",myipaddr); - LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode"),profitmargin); + LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode")); printf("get public socket\n"); LP_mypullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); strcpy(LP_publicaddr,pushaddr); @@ -680,7 +674,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu while ( 1 ) { //fprintf(stderr,"."); - if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase,profitmargin) == 0 ) + if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) == 0 ) usleep(1000000 / MAINLOOP_PERSEC); /*if ( LP_canbind == 0 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d5440d4bf..d88d66555 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -148,6 +148,7 @@ void queue_loop(void *ignore) printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); flag = 1; } + flag = 1; } } if ( flag != 0 ) @@ -255,7 +256,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 90fe7604a..009499ec0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -176,7 +176,7 @@ char *LP_quotereceived(cJSON *argjson) } else return(clonestr("{\"error\":\"nullptr\"}")); } -char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,char *base,char *rel,double price) +char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { bits256 zero; char *msg; cJSON *reqjson = cJSON_CreateObject(); memset(zero.bytes,0,sizeof(zero)); @@ -195,7 +195,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin { jaddstr(reqjson,"method","forward"); jaddstr(reqjson,"method2","postprice"); - /LP_forward(ctx,myipaddr,pubsock,profitmargin,zero,jprint(reqjson,1),1); + /LP_forward(ctx,myipaddr,pubsock,zero,jprint(reqjson,1),1); }*/ jaddstr(reqjson,"method","postprice"); msg = jprint(reqjson,1); @@ -298,7 +298,7 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) return(-1); } -double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,char *method,struct LP_quoteinfo *qp) +double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct LP_quoteinfo *qp) { cJSON *reqjson; char *msg; int32_t i,flag = 0; double price = 0.; struct LP_utxoinfo *utxo; if ( strcmp(method,"request") == 0 ) @@ -326,7 +326,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,c jaddstr(reqjson,"method2",method); jaddstr(reqjson,"method","forward"); jaddbits256(reqjson,"pubkey",qp->srchash); - /LP_forward(ctx,myipaddr,mypubsock,profitmargin,qp->srchash,jprint(reqjson,1),1); + /LP_forward(ctx,myipaddr,mypubsock,qp->srchash,jprint(reqjson,1),1); }*/ jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); @@ -378,7 +378,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *myipaddr,char *base,char *rel,double profitmargin,double price,struct LP_quoteinfo *qp) +int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *myipaddr,char *base,char *rel,double price,struct LP_quoteinfo *qp) { char pairstr[512],*msg; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; printf("LP_connectstartbob.(%s) with.(%s) %s\n",myipaddr,jprint(argjson,0),LP_myipaddr); @@ -414,7 +414,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jdelete(retjson,"method"); jaddstr(retjson,"method2","connected"); jaddstr(retjson,"method","forward"); - LP_forward(ctx,myipaddr,pubsock,profitmargin,utxo->S.otherpubkey,jprint(retjson,1),1);*/ + LP_forward(ctx,myipaddr,pubsock,utxo->S.otherpubkey,jprint(retjson,1),1);*/ msg = jprint(retjson,1); LP_broadcast_message(pubsock,base,rel,utxo->S.otherpubkey,msg); retval = 0; @@ -503,7 +503,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } } -int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin) +int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) { char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) @@ -551,7 +551,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jdelete(retjson,"method"); jaddstr(retjson,"method2","reserved"); jaddstr(retjson,"method","forward"); - /LP_forward(ctx,myipaddr,pubsock,profitmargin,butxo->S.otherpubkey,jprint(retjson,1),1);*/ + /LP_forward(ctx,myipaddr,pubsock,butxo->S.otherpubkey,jprint(retjson,1),1);*/ msg = jprint(retjson,1); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); butxo->T.lasttime = (uint32_t)time(NULL); @@ -562,7 +562,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { retval = 4; if ( butxo->T.swappending != 0 && butxo->S.swap == 0 ) - LP_connectstartbob(ctx,pubsock,butxo,argjson,myipaddr,Q.srccoin,Q.destcoin,profitmargin,qprice,&Q); + LP_connectstartbob(ctx,pubsock,butxo,argjson,myipaddr,Q.srccoin,Q.destcoin,qprice,&Q); else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } } @@ -683,7 +683,7 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,char *rel,bits256 t return(jprint(LP_quotejson(&Q),1)); } -char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) +char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) { struct LP_utxoinfo *bobutxo,*aliceutxo; cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; if ( (aliceutxo= LP_utxopairfind(0,qp->desttxid,qp->destvout,qp->feetxid,qp->feevout)) == 0 ) @@ -696,13 +696,13 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,st bobutxo->T.bestflag = (uint32_t)time(NULL); //if ( (retstr= LP_registerall(0)) != 0 ) // free(retstr); - price = LP_query(ctx,myipaddr,mypubsock,profitmargin,"request",qp); + price = LP_query(ctx,myipaddr,mypubsock,"request",qp); bestitem = LP_quotejson(qp); if ( price > SMALLVAL ) { if ( price <= maxprice ) { - price = LP_query(ctx,myipaddr,mypubsock,profitmargin,"connect",qp); + price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); LP_requestinit(&qp->R,qp->srchash,qp->desthash,bobutxo->coin,qp->satoshis,qp->destcoin,qp->destsatoshis,qp->timestamp,qp->quotetime,DEXselector); expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) @@ -740,7 +740,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,st return(jprint(bestitem,0)); } -char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargin,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) +char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) { int64_t desttxfee,txfee,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) @@ -770,7 +770,7 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,double profitmargi return(clonestr("{\"error\":\"quote validation error\"}")); } printf("do quote.(%s)\n",jprint(LP_quotejson(&Q),1)); - return(LP_trade(ctx,myipaddr,mypubsock,profitmargin,&Q,maxprice,timeout,duration)); + return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration)); } diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index d0778931e..1b3f55083 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -33,7 +33,7 @@ cJSON *LP_peerjson(struct LP_peerinfo *peer) cJSON *item = cJSON_CreateObject(); jaddstr(item,"ipaddr",peer->ipaddr); jaddnum(item,"port",peer->port); - jaddnum(item,"profit",peer->profitmargin); + //jaddnum(item,"profit",peer->profitmargin); return(item); } @@ -48,7 +48,7 @@ char *LP_peers() return(jprint(peersjson,1)); } -struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,double profitmargin,int32_t numpeers,int32_t numutxos) +struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; ipbits = (uint32_t)calc_ipbits(ipaddr); @@ -57,8 +57,8 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { if ( (peer= LP_peerfind(ipbits,port)) != 0 ) { - if ( profitmargin != 0. ) - peer->profitmargin = profitmargin; + //if ( profitmargin != 0. ) + // peer->profitmargin = profitmargin; if ( numpeers > peer->numpeers ) peer->numpeers = numpeers; if ( numutxos > peer->numutxos ) @@ -101,7 +101,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char printf("error connecting to push.(%s)\n",pushaddr); } } else printf("%s pushport.%u subport.%u pushsock.%d\n",ipaddr,pushport,subport,pushsock); - peer->profitmargin = profitmargin; + //peer->profitmargin = profitmargin; peer->ipbits = ipbits; peer->port = port; peer->ip_port = ((uint64_t)port << 32) | ipbits; @@ -186,7 +186,7 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa argipbits = (uint32_t)calc_ipbits(argipaddr); if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { - peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jdouble(item,"profit"),jint(item,"numpeers"),jint(item,"numutxos")); + peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos")); } if ( peer != 0 ) { @@ -202,11 +202,11 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa return(n); } -void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport,double myprofit) +void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport) { char *retstr; struct LP_peerinfo *peer,*tmp; uint32_t now,flag = 0; peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); - if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,myprofit,mypeer!=0?mypeer->numpeers:0,mypeer!=0?mypeer->numutxos:0)) != 0 ) + if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0,mypeer!=0?mypeer->numutxos:0)) != 0 ) { //printf("got.(%s)\n",retstr); now = (uint32_t)time(NULL); @@ -218,9 +218,9 @@ void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr { if ( peer->lasttime != now ) { - printf("{%s:%u %.6f}.%d ",peer->ipaddr,peer->port,peer->profitmargin,peer->lasttime - now); + printf("{%s:%u}.%d ",peer->ipaddr,peer->port,peer->lasttime - now); flag++; - if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->profitmargin,peer->numpeers,0)) != 0 ) + if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,0)) != 0 ) free(retstr); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 880eccad8..83053fe62 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -48,17 +48,17 @@ char *LP_isitme(char *destip,uint16_t destport) } else return(0); } -char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers,int32_t numutxos) +char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512]; - sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&profit=%.6f&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,profitmargin,numpeers,numutxos); + sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); return(LP_issue_curl("getpeers",destip,port,url)); } -char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers,int32_t numutxos) +char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512]; - sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&profit=%.6f&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,profitmargin,numpeers,numutxos); + sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos); return(LP_issue_curl("getutxos",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } @@ -73,12 +73,12 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t //return(retstr); } -char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers,int32_t numutxos) +char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512],*retstr; if ( (retstr= LP_isitme(destip,destport)) != 0 ) return(retstr); - sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&profit=%.6f&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,profitmargin,numpeers,numutxos); + sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); return(LP_issue_curl("notify",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } @@ -96,7 +96,7 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port, u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) > 0 ) { - sprintf(url,"http://%s:%u/api/stats/notified?iambob=%d&pubkey=%s&profit=%.6f&coin=%s&txid=%s&vout=%d&value=%llu&txid2=%s&vout2=%d&value2=%llu&script=%s&address=%s×tamp=%u&gui=%s",destip,destport,utxo->iambob,bits256_str(str3,utxo->pubkey),utxo->S.profitmargin,utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,(long long)utxo->payment.value,bits256_str(str2,utxo->deposit.txid),utxo->deposit.vout,(long long)utxo->deposit.value,utxo->spendscript,utxo->coinaddr,(uint32_t)time(NULL),utxo->gui); + sprintf(url,"http://%s:%u/api/stats/notified?iambob=%d&pubkey=%s&coin=%s&txid=%s&vout=%d&value=%llu&txid2=%s&vout2=%d&value2=%llu&script=%s&address=%s×tamp=%u&gui=%s",destip,destport,utxo->iambob,bits256_str(str3,utxo->pubkey),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,(long long)utxo->payment.value,bits256_str(str2,utxo->deposit.txid),utxo->deposit.vout,(long long)utxo->deposit.value,utxo->spendscript,utxo->coinaddr,(uint32_t)time(NULL),utxo->gui); if ( strlen(url) > 1024 ) printf("WARNING long url.(%s)\n",url); return(LP_issue_curl("notifyutxo",destip,destport,url)); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 42577916b..9da50666f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -279,7 +279,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) cJSON *item = cJSON_CreateObject(); item = LP_inventoryjson(item,utxo); jaddbits256(item,"pubkey",utxo->pubkey); - jaddnum(item,"profit",utxo->S.profitmargin); + //jaddnum(item,"profit",utxo->S.profitmargin); jaddstr(item,"base",utxo->coin); jaddstr(item,"script",utxo->spendscript); return(item); @@ -495,7 +495,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) return(n);*/ } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,double profitmargin,char *gui) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui) { uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 ) @@ -552,13 +552,13 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit utxo = 0; } } - else if ( profitmargin > SMALLVAL ) - utxo->S.profitmargin = profitmargin; + //else if ( profitmargin > SMALLVAL ) + // utxo->S.profitmargin = profitmargin; if ( utxo != 0 ) return(utxo); } utxo = calloc(1,sizeof(*utxo)); - utxo->S.profitmargin = profitmargin; + //utxo->S.profitmargin = profitmargin; utxo->pubkey = pubkey; safecopy(utxo->gui,gui,sizeof(utxo->gui)); safecopy(utxo->coin,symbol,sizeof(utxo->coin)); @@ -610,7 +610,7 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson return(0); } portable_mutex_lock(&LP_UTXOmutex); - utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jdouble(argjson,"profit"),jstr(argjson,"gui")); + utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui")); portable_mutex_unlock(&LP_UTXOmutex); return(utxo); } @@ -634,7 +634,7 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n subport = argport + 2; argipbits = (uint32_t)calc_ipbits(argipaddr); if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) - peer = LP_addpeer(0,-1,argipaddr,argport,pushport,subport,jdouble(item,"profit"),jint(item,"numpeers"),jint(item,"numutxos")); + peer = LP_addpeer(0,-1,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos")); } if ( jobj(item,"txid") != 0 ) { @@ -654,7 +654,7 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n return(n); } -int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport,double myprofit) +int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport) { char *retstr; struct LP_peerinfo *peer; uint32_t now; int32_t retval = -1; peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); @@ -662,7 +662,7 @@ int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa coin = ""; //printf("utxo query.(%s)\n",destipaddr); if ( IAMLP != 0 ) - retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,myprofit,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0); + retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0); else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,100); if ( retstr != 0 ) { @@ -809,13 +809,13 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_mypeer != 0 ? LP_mypeer->profitmargin : 0.01,LP_gui)) != 0 ) + if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui)) != 0 ) { } } else { - if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,0.,LP_gui)) != 0 ) + if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui)) != 0 ) { } } diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 9d2e6f336..44cf4f5f0 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -24,7 +24,7 @@ #include #include "OS_portable.h" #define MAX(a,b) ((a) > (b) ? (a) : (b)) -char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,double profitmargin,cJSON *argjson,char *remoteaddr,uint16_t port); +char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]); @@ -179,10 +179,10 @@ char *iguana_walletpassphrase(char *passphrase,int32_t timeout) return(bitcoind_RPC(0,"",url,0,"listunspent",postdata)); }*/ -/*char *issue_LP_intro(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers) +/*char *issue_LP_intro(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers) { char url[512]; - sprintf(url,"http://%s:%u/api/stats/intro?ipaddr=%s&port=%u&profit=%.6f&numpeers=%d",destip,destport,ipaddr,port,profitmargin,numpeers); + sprintf(url,"http://%s:%u/api/stats/intro?ipaddr=%s&port=%u&numpeers=%d",destip,destport,ipaddr,port,numpeers); printf("(%s)\n",url); return(issue_curl(url)); }*/ @@ -790,7 +790,8 @@ void LP_main(void *ptr) if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); - LPinit(7779,7780,7781,7782,profitmargin,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LP_profitratio += profitmargin; + LPinit(7779,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 64e4f985e..c565fa78f 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -307,7 +307,7 @@ extern void *bitcoin_ctx(); char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *postflagp,char *urlstr,char *remoteaddr,char *filetype,uint16_t port) { static void *ctx; - cJSON *tokens,*argjson,*origargjson,*tmpjson=0,*json = 0; long filesize; double profitmargin = 0.; char *myipaddr="127.0.0.1",symbol[64],buf[4096],*userpass=0,urlmethod[16],*data,url[8192],furl[8192],*retstr,*filestr,*token = 0; int32_t i,j,n,num=0; + cJSON *tokens,*argjson,*origargjson,*tmpjson=0,*json = 0; long filesize; char *myipaddr="127.0.0.1",symbol[64],buf[4096],*userpass=0,urlmethod[16],*data,url[8192],furl[8192],*retstr,*filestr,*token = 0; int32_t i,j,n,num=0; //printf("rpcparse.(%s)\n",urlstr); if ( ctx == 0 ) ctx = bitcoin_ctx(); @@ -493,7 +493,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po if ( userpass != 0 && jstr(argjson,"userpass") == 0 ) jaddstr(argjson,"userpass",userpass); //printf("after urlconv.(%s) argjson.(%s)\n",jprint(json,0),jprint(argjson,0)); - if ( (retstr= stats_JSON(ctx,myipaddr,-1,profitmargin,argjson,remoteaddr,port)) != 0 ) + if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) { if ( (retitem= cJSON_Parse(retstr)) != 0 ) jaddi(retarray,retitem); @@ -516,7 +516,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po //printf("ARGJSON.(%s)\n",jprint(arg,0)); if ( userpass != 0 && jstr(arg,"userpass") == 0 ) jaddstr(arg,"userpass",userpass); - retstr = stats_JSON(ctx,myipaddr,-1,profitmargin,arg,remoteaddr,port); + retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port); } free_json(argjson); free_json(json); From 1f2d8b3ecba615f1534bba784cb3f6ddc8c0a6fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:04:41 +0300 Subject: [PATCH 128/682] Test --- iguana/exchanges/LP_commands.c | 13 +++++++------ iguana/exchanges/LP_network.c | 23 ++++++++++------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f52b838db..9b93fcd41 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -242,14 +242,15 @@ trust(pubkey, trust)\n\ { if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { - argjson = reqjson; - if ( jobj(argjson,"method2") != 0 ) + if ( jobj(reqjson,"method2") != 0 ) { - jdelete(argjson,"method"); - method = jstr(argjson,"method2"); - jaddstr(argjson,"method",method); - jdelete(argjson,"method2"); + jdelete(reqjson,"method"); + method = jstr(reqjson,"method2"); + jaddstr(reqjson,"method",method); + jdelete(reqjson,"method2"); + printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); } + argjson = reqjson; } } if ( LP_isdisabled(base,rel) != 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index d88d66555..18b0d277e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -92,18 +92,15 @@ int32_t LP_Qenqueued,LP_Qdequeued; void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { struct LP_queue *ptr; - if ( LP_Qenqueued == 0 || IAMLP != 0 ) - { - ptr = calloc(1,sizeof(*ptr) + msglen); - ptr->crc32 = crc32; - ptr->sock = sock; - ptr->peerind = peerind; - ptr->msglen = msglen; - memcpy(ptr->msg,msg,msglen); - DL_APPEND(LP_Q,ptr); - LP_Qenqueued++; - //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); - } + ptr = calloc(1,sizeof(*ptr) + msglen); + ptr->crc32 = crc32; + ptr->sock = sock; + ptr->peerind = peerind; + ptr->msglen = msglen; + memcpy(ptr->msg,msg,msglen); + DL_APPEND(LP_Q,ptr); + LP_Qenqueued++; + //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); } void queue_loop(void *ignore) @@ -256,7 +253,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 91fba923814bab1cc812a9c1d2252095b4a978d2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:09:14 +0300 Subject: [PATCH 129/682] Test --- iguana/exchanges/LP_commands.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9b93fcd41..9c25f7e1e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -248,7 +248,8 @@ trust(pubkey, trust)\n\ method = jstr(reqjson,"method2"); jaddstr(reqjson,"method",method); jdelete(reqjson,"method2"); - printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); + //printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); + printf("BROADCASTED METHOD.%s\n",method); } argjson = reqjson; } @@ -304,9 +305,10 @@ trust(pubkey, trust)\n\ return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { + printf("UTXO.%s\n",method); if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) - return(clonestr("{\"result\":\"success\",\"utxo\":\"received\"}")); - else return(clonestr("{\"result\":\"couldnt add utxo\"}")); + retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); + else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); } else { From 106520925691d40c4cd5f52423dc12cfd34f4749 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:12:01 +0300 Subject: [PATCH 130/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9c25f7e1e..24d785cf5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -247,7 +247,7 @@ trust(pubkey, trust)\n\ jdelete(reqjson,"method"); method = jstr(reqjson,"method2"); jaddstr(reqjson,"method",method); - jdelete(reqjson,"method2"); + //jdelete(reqjson,"method2"); //printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); printf("BROADCASTED METHOD.%s\n",method); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9c7a1d1f2..9c71c6070 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -147,7 +147,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); + //printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) From 4dd2fd1b02c8bfb718dd8d82eb4e8fb91d40aaa8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:16:39 +0300 Subject: [PATCH 131/682] Test --- iguana/exchanges/LP_commands.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 24d785cf5..2492ba102 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -249,7 +249,7 @@ trust(pubkey, trust)\n\ jaddstr(reqjson,"method",method); //jdelete(reqjson,"method2"); //printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); - printf("BROADCASTED METHOD.%s\n",method); + //printf("BROADCASTED METHOD.%s\n",method); } argjson = reqjson; } @@ -305,7 +305,7 @@ trust(pubkey, trust)\n\ return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { - printf("UTXO.%s\n",method); + //printf("UTXO.%s\n",method); if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); @@ -373,7 +373,8 @@ trust(pubkey, trust)\n\ }*/ } } - printf("ERROR.(%s)\n",jprint(argjson,0)); + if ( retstr == 0 ) + printf("ERROR.(%s)\n",jprint(argjson,0)); if ( reqjson != 0 ) free_json(reqjson); if ( retstr != 0 ) From 9363d1bd224949c668b10fbe614d96cf21ed7760 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:22:34 +0300 Subject: [PATCH 132/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9c71c6070..03e1f5848 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -122,7 +122,7 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) crcs[i] = crcs[i >> 1]; crcs[i >> 1] = crc32; dup++; - printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); + //printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); } *duplicatep = 1; break; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 18b0d277e..ef3a90d53 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) + else if ( time(NULL) > ptr->starttime+2*LP_HTTP_TIMEOUT+1 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) From 335ec636b2df09c518d3ef534c0ec7fae11deeab Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:34:57 +0300 Subject: [PATCH 133/682] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 ++ iguana/exchanges/LP_utxos.c | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d607c0f6f..d3426aa87 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -184,7 +184,7 @@ struct iguana_info struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; }; -struct LP_utxostats { uint32_t lasttime,errors,swappending,spentflag,lastspentcheck,bestflag; }; +struct LP_utxostats { uint32_t sessionid,lasttime,errors,swappending,spentflag,lastspentcheck,bestflag; }; struct LP_utxobob { struct _LP_utxoinfo utxo,deposit; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 03e1f5848..3829b3653 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -48,6 +48,7 @@ int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; int32_t USERPASS_COUNTER,IAMLP = 0; +uint32_t LP_sessionid; double LP_profitratio = 1.; bits256 LP_mypub25519,LP_mypriv25519; @@ -558,6 +559,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); exit(-1); } + LP_sessionid = (uint32_t)time(NULL); IAMLP = !amclient; #ifndef __linux__ if ( IAMLP != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9da50666f..2f1a64367 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -234,6 +234,9 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; jaddstr(item,"method","utxo"); + if ( LP_ismine(utxo) > 0 ) + jaddnum(item,"session",LP_sessionid); + else jaddnum(item,"session",utxo->T.sessionid); if ( utxo == 0 ) return(item); if ( utxo->gui[0] != 0 ) @@ -495,7 +498,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) return(n);*/ } -struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui) +struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 ) @@ -610,7 +613,7 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson return(0); } portable_mutex_lock(&LP_UTXOmutex); - utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui")); + utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"sessionid")); portable_mutex_unlock(&LP_UTXOmutex); return(utxo); } @@ -809,13 +812,13 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_lock(&LP_UTXOmutex); if ( iambob != 0 ) { - if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui)) != 0 ) + if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) { } } else { - if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui)) != 0 ) + if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) { } } From 8a0aec8d38e5c8db4bf4d3a9dd2af3b685486046 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:42:05 +0300 Subject: [PATCH 134/682] Test --- iguana/exchanges/LP_network.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ef3a90d53..7686621fd 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -87,7 +87,7 @@ struct LP_queue uint32_t starttime,crc32; uint8_t msg[]; } *LP_Q; -int32_t LP_Qenqueued,LP_Qdequeued; +int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound; void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) { @@ -133,19 +133,20 @@ void queue_loop(void *ignore) LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { - printf("%d found crc32.%u\n",n,ptr->crc32); + //printf("%d found crc32.%u\n",n,ptr->crc32); + LP_Qfound++; flag = 1; } else { - printf("couldnt find.%u (%s)\n",ptr->crc32,(char *)ptr->msg); + printf("couldnt find.%u (%s) Q.%d err.%d match.%d\n",ptr->crc32,(char *)ptr->msg,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { printf("%d no more peers to try at peerind.%d %p Q_LP.%p\n",n,ptr->peerind,ptr,LP_Q); flag = 1; + LP_Qerrors++; } - flag = 1; } } if ( flag != 0 ) @@ -154,7 +155,6 @@ void queue_loop(void *ignore) portable_mutex_lock(&LP_networkmutex); DL_DELETE(LP_Q,ptr); portable_mutex_unlock(&LP_networkmutex); - LP_Qdequeued++; free(ptr); ptr = 0; } @@ -261,7 +261,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 LP_queuesend(crc32,pubsock,base,rel,msg,msglen); else LP_queuesend(crc32,-1,base,rel,msg,msglen); free(msg); - } else printf("no valid method in (%s)\n",msgstr); + } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); } From f6da2559daea54221a8c049d18e1ad8bfd66db57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:45:03 +0300 Subject: [PATCH 135/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2f1a64367..8e5cca2ce 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -613,7 +613,7 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson return(0); } portable_mutex_lock(&LP_UTXOmutex); - utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"sessionid")); + utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"session")); portable_mutex_unlock(&LP_UTXOmutex); return(utxo); } From 3b9e23bbe48931076a059c2015a742571096bdf8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:47:26 +0300 Subject: [PATCH 136/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7686621fd..bf3065c03 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -133,8 +133,8 @@ void queue_loop(void *ignore) LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { - //printf("%d found crc32.%u\n",n,ptr->crc32); LP_Qfound++; + printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } else From 708aa1c62a05113b3a7363b3301fb67fb9ba7ee0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:55:11 +0300 Subject: [PATCH 137/682] Test --- iguana/exchanges/LP_commands.c | 6 +++--- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_utxos.c | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 2492ba102..b8c727d37 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -366,11 +366,11 @@ trust(pubkey, trust)\n\ } else { - /*if ( strcmp(method,"register") == 0 ) + if ( strcmp(method,"psock") == 0 ) { //printf("nonLP got (%s)\n",jprint(argjson,0)); - retstr = clonestr("{\"result\":\"success\",\"register\":\"received\"}"); - }*/ + retstr = clonestr("{\"result\":\"success\"}"); + } } } if ( retstr == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index bf3065c03..12a3438b5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -139,7 +139,7 @@ void queue_loop(void *ignore) } else { - printf("couldnt find.%u (%s) Q.%d err.%d match.%d\n",ptr->crc32,(char *)ptr->msg,LP_Qenqueued,LP_Qerrors,LP_Qfound); + printf("couldnt find.%u (%s) peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,(char *)ptr->msg,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8e5cca2ce..5cb23a04a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -234,11 +234,14 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; jaddstr(item,"method","utxo"); + if ( utxo == 0 ) + return(item); if ( LP_ismine(utxo) > 0 ) + { jaddnum(item,"session",LP_sessionid); + printf("sessionid.%u\n",LP_sessionid); + } else jaddnum(item,"session",utxo->T.sessionid); - if ( utxo == 0 ) - return(item); if ( utxo->gui[0] != 0 ) jaddstr(item,"gui",utxo->gui); jaddstr(item,"coin",utxo->coin); From f363d8aa951cbbbb92e4dcac0182d5049e6f5dea Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:58:13 +0300 Subject: [PATCH 138/682] Test --- iguana/exchanges/LP_utxos.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5cb23a04a..ba55c2761 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -236,12 +236,6 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) jaddstr(item,"method","utxo"); if ( utxo == 0 ) return(item); - if ( LP_ismine(utxo) > 0 ) - { - jaddnum(item,"session",LP_sessionid); - printf("sessionid.%u\n",LP_sessionid); - } - else jaddnum(item,"session",utxo->T.sessionid); if ( utxo->gui[0] != 0 ) jaddstr(item,"gui",utxo->gui); jaddstr(item,"coin",utxo->coin); @@ -277,6 +271,12 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) jaddstr(item,"swap","in progress"); if ( utxo->T.spentflag != 0 ) jaddnum(item,"spent",utxo->T.spentflag); + if ( LP_ismine(utxo) > 0 ) + { + jaddnum(item,"session",LP_sessionid); + printf("sessionid.%u %s\n",LP_sessionid,jprint(item,0)); + } + else jaddnum(item,"session",utxo->T.sessionid); return(item); } @@ -588,6 +588,8 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } LP_utxosetkey(utxo->key,txid,vout); LP_utxosetkey(utxo->key2,txid2,vout2); + if ( LP_ismine(utxo) > 0 ) + utxo->T.sessionid = LP_sessionid; portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From c6b645da4167712e3bb237aaaa3f096b8e09ac11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 19:59:45 +0300 Subject: [PATCH 139/682] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_utxos.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 12a3438b5..da3e342ff 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+2*LP_HTTP_TIMEOUT+1 ) + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ba55c2761..220ae5401 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -274,9 +274,8 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) if ( LP_ismine(utxo) > 0 ) { jaddnum(item,"session",LP_sessionid); - printf("sessionid.%u %s\n",LP_sessionid,jprint(item,0)); - } - else jaddnum(item,"session",utxo->T.sessionid); + //printf("sessionid.%u %s\n",LP_sessionid,jprint(item,0)); + } else jaddnum(item,"session",utxo->T.sessionid); return(item); } From 9f5963c1328bbefcb5810add1c9e00d6c1e42c51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:00:57 +0300 Subject: [PATCH 140/682] Test --- iguana/exchanges/LP_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index da3e342ff..64d7ee750 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,13 +128,14 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT ) + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*2+1 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { LP_Qfound++; - printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); + if ( (LP_Qenqueued % 10) == 0 ) + printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } else From 36259d1ea777b893f2b496b5f5be6af5a12bef69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:14:14 +0300 Subject: [PATCH 141/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_peers.c | 10 +++++++--- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/LP_utxos.c | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b8c727d37..cebfb7e65 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -42,7 +42,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r peer->numutxos = othernumutxos; } //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); - } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos")); + } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos"),juint(argjson,"session")); } } if ( (method= jstr(argjson,"method")) == 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index d3426aa87..25ef0fe82 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -210,7 +210,7 @@ struct LP_peerinfo { UT_hash_handle hh; uint64_t ip_port; - uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos,lastpeers,diduquery,good; + uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos,lastpeers,diduquery,good,sessionid; int32_t pushsock,subsock; uint16_t port; char ipaddr[64]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3829b3653..bf6eacc2f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -516,7 +516,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint int32_t i,j; uint32_t r; if ( IAMLP != 0 ) { - LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,0); + LP_mypeer = mypeer = LP_addpeer(mypeer,pubsock,myipaddr,myport,0,0,0,0,LP_sessionid); if ( myipaddr == 0 || mypeer == 0 ) { printf("couldnt get myipaddr or null mypeer.%p\n",mypeer); diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 1b3f55083..f952989be 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -33,6 +33,9 @@ cJSON *LP_peerjson(struct LP_peerinfo *peer) cJSON *item = cJSON_CreateObject(); jaddstr(item,"ipaddr",peer->ipaddr); jaddnum(item,"port",peer->port); + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + jaddnum(item,"session",LP_sessionid); + else jaddnum(item,"session",peer->sessionid); //jaddnum(item,"profit",peer->profitmargin); return(item); } @@ -48,7 +51,7 @@ char *LP_peers() return(jprint(peersjson,1)); } -struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos) +struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; ipbits = (uint32_t)calc_ipbits(ipaddr); @@ -68,6 +71,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { printf("LPaddpeer %s\n",ipaddr); peer = calloc(1,sizeof(*peer)); + peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) @@ -186,7 +190,7 @@ int32_t LP_peersparse(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa argipbits = (uint32_t)calc_ipbits(argipaddr); if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) { - peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos")); + peer = LP_addpeer(mypeer,mypubsock,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( peer != 0 ) { @@ -220,7 +224,7 @@ void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr { printf("{%s:%u}.%d ",peer->ipaddr,peer->port,peer->lasttime - now); flag++; - if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,0)) != 0 ) + if ( (retstr= issue_LP_notify(destipaddr,destport,peer->ipaddr,peer->port,peer->numpeers,0,peer->sessionid)) != 0 ) free(retstr); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 83053fe62..1addc118f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -73,12 +73,12 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t //return(retstr); } -char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { char url[512],*retstr; if ( (retstr= LP_isitme(destip,destport)) != 0 ) return(retstr); - sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); + sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d&session=%u",destip,destport,ipaddr,port,numpeers,numutxos,sessionid); return(LP_issue_curl("notify",destip,destport,url)); //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 220ae5401..4cf847d4c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -641,7 +641,7 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n subport = argport + 2; argipbits = (uint32_t)calc_ipbits(argipaddr); if ( (peer= LP_peerfind(argipbits,argport)) == 0 ) - peer = LP_addpeer(0,-1,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos")); + peer = LP_addpeer(0,-1,argipaddr,argport,pushport,subport,jint(item,"numpeers"),jint(item,"numutxos"),juint(item,"session")); } if ( jobj(item,"txid") != 0 ) { From a96c054732be4fcc03fcd27295e5fbf791bd217a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:17:27 +0300 Subject: [PATCH 142/682] Test --- iguana/exchanges/LP_commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index cebfb7e65..defb9b597 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -41,6 +41,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); peer->numutxos = othernumutxos; } + if ( peer->sessionid == 0 ) + peer->sessionid = juint(argjson,"session"); //printf("peer.(%s) found (%d %d) (%d %d) (%s)\n",peer->ipaddr,peer->numpeers,peer->numutxos,otherpeers,othernumutxos,jprint(argjson,0)); } else LP_addpeer(LP_mypeer,LP_mypubsock,ipaddr,argport,pushport,subport,jint(argjson,"numpeers"),jint(argjson,"numutxos"),juint(argjson,"session")); } From fb4179c174b8d4bec9081e3a48d704ba08c8fab0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:24:54 +0300 Subject: [PATCH 143/682] Test --- iguana/exchanges/LP_peers.c | 4 +++- iguana/exchanges/LP_rpc.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index f952989be..cde113f83 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -71,7 +71,9 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { printf("LPaddpeer %s\n",ipaddr); peer = calloc(1,sizeof(*peer)); - peer->sessionid = sessionid; + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + peer->sessionid = LP_sessionid; + else peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1addc118f..5006f536a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -50,9 +50,11 @@ char *LP_isitme(char *destip,uint16_t destport) char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { - char url[512]; + char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); - return(LP_issue_curl("getpeers",destip,port,url)); + retstr = LP_issue_curl("getpeers",destip,port,url); + printf("getpeers.(%s)\n",retstr); + return(retstr); } char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) From c91bd24d40c4de8333d88639a423d6b871195603 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:28:42 +0300 Subject: [PATCH 144/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bf6eacc2f..88ff5c3c9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -365,9 +365,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int numpeers = LP_numpeers(); HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( peer->errors >= LP_MAXPEER_ERRORS ) + if ( IAMLP == 0 && peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 10000) == 0 ) + if ( (rand() % 5000) == 0 ) peer->errors--; else continue; } From 0ee6dfaebf620bae4d9c39bb7e42ffcabca35d53 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:33:02 +0300 Subject: [PATCH 145/682] Test --- iguana/exchanges/LP_nativeDEX.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 88ff5c3c9..66aab20c4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -345,8 +345,8 @@ void command_rpcloop(void *myipaddr) }*/ if ( LP_mypullsock >= 0 ) nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock); - if ( LP_mybussock >= 0 ) - nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); + //if ( LP_mybussock >= 0 ) + // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) usleep(10000); } @@ -365,11 +365,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int numpeers = LP_numpeers(); HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( IAMLP == 0 && peer->errors >= LP_MAXPEER_ERRORS ) + if ( peer->errors >= LP_MAXPEER_ERRORS ) { - if ( (rand() % 5000) == 0 ) + if ( (rand() % 10000) == 0 ) peer->errors--; - else continue; + if ( IAMLP == 0 ) + continue; } if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { @@ -526,8 +527,8 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint { for (i=0; i 25 ) - continue; + //if ( (rand() % 100) > 25 ) + // continue; LP_peersquery(mypeer,pubsock,default_LPnodes[i],myport,mypeer->ipaddr,myport); } } else LP_peersquery(mypeer,pubsock,seednode,myport,mypeer->ipaddr,myport); From 4911b6339eb1b2740db402be1751076c2f943a10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:36:40 +0300 Subject: [PATCH 146/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5006f536a..bb412c155 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); retstr = LP_issue_curl("getpeers",destip,port,url); - printf("getpeers.(%s)\n",retstr); + printf("%s -> getpeers.(%s)\n",destip,retstr); return(retstr); } From ade08d56bf1dc1276955d4ac70a0d7b22aff9d2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:40:40 +0300 Subject: [PATCH 147/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bb412c155..659dcd51d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); retstr = LP_issue_curl("getpeers",destip,port,url); - printf("%s -> getpeers.(%s)\n",destip,retstr); + //printf("%s -> getpeers.(%s)\n",destip,retstr); return(retstr); } From a9b02d6c53e2b7d6a18fcc0ecabad8aa39e74030 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:49:20 +0300 Subject: [PATCH 148/682] Test --- iguana/exchanges/message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/message b/iguana/exchanges/message index 595ce00ad..7da8ff309 100755 --- a/iguana/exchanges/message +++ b/iguana/exchanges/message @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"forward\",\"method2\":\"message\",\"message\":\"some sort of message\"}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"forward\",\"method2\":\"sendmessage\",\"message\":\"some sort of message\"}" From aa938ca6d8e304bbc672298e43b75df99817fb8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:51:32 +0300 Subject: [PATCH 149/682] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_network.c | 1 + 2 files changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index defb9b597..629c20e7b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -131,6 +131,7 @@ trust(pubkey, trust)\n\ { if ( (reqjson= LP_dereference(argjson,"sendmessage")) != 0 ) { + printf("broadcast message\n"); LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(reqjson,1)); return(clonestr("{\"result\":\"success\"}")); } else return(clonestr("{\"error\":\"couldnt dereference sendmessage\"}")); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 64d7ee750..47a3d905a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -237,6 +237,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = encoded; msglen += 2; encrypted = 1; + printf("msgstr.(%s)\n",msgstr); free(msgstr), msgstr = 0; } if ( encrypted == 0 ) From 3d6d3e5b9d17149eb183e26503836b068a24bfb4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:54:17 +0300 Subject: [PATCH 150/682] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/message | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 47a3d905a..c9e1b911d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); diff --git a/iguana/exchanges/message b/iguana/exchanges/message index 7da8ff309..881f46855 100755 --- a/iguana/exchanges/message +++ b/iguana/exchanges/message @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"forward\",\"method2\":\"sendmessage\",\"message\":\"some sort of message\"}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"broadcast\",\"method2\":\"sendmessage\",\"message\":\"some sort of message\"}" From 92c181106071f6827c5ee82fe2b8c4ec90c6013f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:59:45 +0300 Subject: [PATCH 151/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/LP_utxos.c | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 66aab20c4..8ea08666d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -560,7 +560,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); exit(-1); } - LP_sessionid = (uint32_t)time(NULL); IAMLP = !amclient; #ifndef __linux__ if ( IAMLP != 0 ) @@ -608,7 +607,8 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_psockmutex); portable_mutex_init(&LP_coinmutex); portable_mutex_init(&LP_pubkeymutex); - printf("getting myipaddr\n"); + LP_sessionid = (uint32_t)time(NULL); + printf("getting myipaddr sessionid.%u\n",LP_sessionid); if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) { if ( (myipaddr= OS_filestr(&filesize,"/tmp/myipaddr")) != 0 && myipaddr[0] != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4cf847d4c..42a50d588 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -271,11 +271,7 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) jaddstr(item,"swap","in progress"); if ( utxo->T.spentflag != 0 ) jaddnum(item,"spent",utxo->T.spentflag); - if ( LP_ismine(utxo) > 0 ) - { - jaddnum(item,"session",LP_sessionid); - //printf("sessionid.%u %s\n",LP_sessionid,jprint(item,0)); - } else jaddnum(item,"session",utxo->T.sessionid); + jaddnum(item,"session",utxo->T.sessionid); return(item); } @@ -589,6 +585,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit LP_utxosetkey(utxo->key2,txid2,vout2); if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; + else utxo->T.sessionid = sessionid; portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From 6d6c58e46ce7503ade7b14a31d4715cf17a2cc04 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:00:55 +0300 Subject: [PATCH 152/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index c9e1b911d..47a3d905a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 1814129ec4f1a3e573a6e920f8d2afd9a413ae8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:05:03 +0300 Subject: [PATCH 153/682] Test --- iguana/exchanges/message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/message b/iguana/exchanges/message index 881f46855..701f63049 100755 --- a/iguana/exchanges/message +++ b/iguana/exchanges/message @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"broadcast\",\"method2\":\"sendmessage\",\"message\":\"some sort of message\"}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"$1\",\"method\":\"sendmessage\",\"message\":\"some sort of message\"}" From 7ec051840d7b5e3d0f9c0256051217f00f969c7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:06:13 +0300 Subject: [PATCH 154/682] Test --- iguana/exchanges/LP_commands.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 629c20e7b..0aa89ff1e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -129,12 +129,9 @@ trust(pubkey, trust)\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { - if ( (reqjson= LP_dereference(argjson,"sendmessage")) != 0 ) - { - printf("broadcast message\n"); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(reqjson,1)); - return(clonestr("{\"result\":\"success\"}")); - } else return(clonestr("{\"error\":\"couldnt dereference sendmessage\"}")); + printf("broadcast message\n"); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); + return(clonestr("{\"result\":\"success\"}")); } if ( base != 0 && rel != 0 ) { From 32b981065becd7999dc9f331b4debe39f285c5b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:13:47 +0300 Subject: [PATCH 155/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 47a3d905a..19787c694 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*2+1 ) + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*3+2 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) From 796174494d1dce0b7a798c64de6df939a8db842e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:16:24 +0300 Subject: [PATCH 156/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8ea08666d..1b93ce6f0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - //printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); + printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 19787c694..19e038dd5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -134,7 +134,7 @@ void queue_loop(void *ignore) if ( duplicate > 0 ) { LP_Qfound++; - if ( (LP_Qenqueued % 10) == 0 ) + //if ( (LP_Qenqueued % 10) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 8dd8911ab3fb6720e9e20b6752f406f840cce427 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:21:56 +0300 Subject: [PATCH 157/682] Test --- iguana/exchanges/LP_utxos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 42a50d588..26351820b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -553,6 +553,8 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit utxo = 0; } } + if ( utxo->T.sessionid == 0 ) + utxo->T.sessionid = sessionid; //else if ( profitmargin > SMALLVAL ) // utxo->S.profitmargin = profitmargin; if ( utxo != 0 ) From 8986694be193f33ff947ebaa0c7d396fe2ea8f87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:24:31 +0300 Subject: [PATCH 158/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1b93ce6f0..8ea08666d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); + //printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 19e038dd5..47a3d905a 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,13 +128,13 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*3+2 ) + else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*2+1 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { LP_Qfound++; - //if ( (LP_Qenqueued % 10) == 0 ) + if ( (LP_Qenqueued % 10) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From b9b3c981f44b7cfd05445b2114866b0513692c4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:26:14 +0300 Subject: [PATCH 159/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 47a3d905a..20d37cf61 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+LP_HTTP_TIMEOUT*2+1 ) + else if ( time(NULL) > ptr->starttime+30 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) From 36ca7470afafbbc35603fea19c9b9b51841fc7ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:35:49 +0300 Subject: [PATCH 160/682] Test --- iguana/exchanges/LP_commands.c | 4 +-- iguana/exchanges/LP_nativeDEX.c | 47 +++++---------------------------- 2 files changed, 8 insertions(+), 43 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0aa89ff1e..84e80801d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -331,14 +331,14 @@ trust(pubkey, trust)\n\ bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { - if ( (cipherstr= jstr(reqjson,"cipherstr")) != 0 ) + if ( (cipherstr= jstr(reqjson,"cipher")) != 0 ) { cipherlen = (int32_t)strlen(cipherstr) >> 1; if ( cipherlen <= sizeof(cipher) ) { decode_hex(cipher,cipherlen,cipherstr); LP_queuesend(calc_crc32(0,&cipher[2],cipherlen-2),LP_mypubsock,base,rel,cipher,cipherlen); - } else retstr = clonestr("{\"error\":\"cipherstr too big\"}"); + } else retstr = clonestr("{\"error\":\"cipher too big\"}"); } else { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8ea08666d..58170e076 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,8 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - //printf("%s encrypted.%d recv.%u (%s)\n",typestr,encrypted,crc32,(char *)ptr); - portable_mutex_lock(&LP_commandmutex); + printf("%s encrypted.%d recv.%u %02x %02x vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) { @@ -184,48 +183,14 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - /*if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"forwardhex") == 0 ) - { - //printf("got forwardhex\n"); - if ( (retstr= LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 ) - { - } - } - else if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"publish") == 0 ) - { - printf("got publish\n"); - if ( jobj(argjson,"method2") != 0 ) - jdelete(argjson,"method2"); - jaddstr(argjson,"method2","broadcast"); - if ( pubsock >= 0 && (reqjson= LP_dereference(argjson,"publish")) != 0 ) - { - msg = jprint(reqjson,1); - /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); - } - } - else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) - { - } - /*if ( LP_COMMAND_RECVSOCK == NN_REP ) - { - if ( retstr != 0 ) - { - if ( strcmp("PULL",typestr) == 0 ) - { - printf("%d got REQ.(%s) -> (%s)\n",recvsock,jprint(argjson,0),retstr); - /LP_send(recvsock,retstr,(int32_t)strlen(retstr)+1,0); - } - } - else if ( strcmp("PULL",typestr) == 0 ) - { - printf("%d got REQ.(%s) -> null\n",recvsock,jprint(argjson,0)); - /LP_send(recvsock,"{\"result\":null}",(int32_t)strlen("{\"result\":null}")+1,0); - } - }*/ + portable_mutex_lock(&LP_commandmutex); + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } + portable_mutex_unlock(&LP_commandmutex); free_json(argjson); } else printf("error parsing(%s)\n",jsonstr); } //else printf("DUPLICATE.(%s)\n",(char *)ptr); - portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); if ( ptr != 0 ) From a4626cf0c546f3cc4dc4a25c65fe59eb31921594 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:37:49 +0300 Subject: [PATCH 161/682] Test --- iguana/exchanges/LP_nativeDEX.c | 47 ++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 58170e076..0d286a425 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s encrypted.%d recv.%u %02x %02x vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + printf("%s encrypted.%d recv.%u %02x %02x vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)); + portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) { @@ -183,14 +184,48 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - portable_mutex_lock(&LP_commandmutex); - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) - { - } - portable_mutex_unlock(&LP_commandmutex); + /*if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"forwardhex") == 0 ) + { + //printf("got forwardhex\n"); + if ( (retstr= LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 ) + { + } + } + else if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"publish") == 0 ) + { + printf("got publish\n"); + if ( jobj(argjson,"method2") != 0 ) + jdelete(argjson,"method2"); + jaddstr(argjson,"method2","broadcast"); + if ( pubsock >= 0 && (reqjson= LP_dereference(argjson,"publish")) != 0 ) + { + msg = jprint(reqjson,1); + /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); + } + } + else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } + /*if ( LP_COMMAND_RECVSOCK == NN_REP ) + { + if ( retstr != 0 ) + { + if ( strcmp("PULL",typestr) == 0 ) + { + printf("%d got REQ.(%s) -> (%s)\n",recvsock,jprint(argjson,0),retstr); + /LP_send(recvsock,retstr,(int32_t)strlen(retstr)+1,0); + } + } + else if ( strcmp("PULL",typestr) == 0 ) + { + printf("%d got REQ.(%s) -> null\n",recvsock,jprint(argjson,0)); + /LP_send(recvsock,"{\"result\":null}",(int32_t)strlen("{\"result\":null}")+1,0); + } + }*/ free_json(argjson); } else printf("error parsing(%s)\n",jsonstr); } //else printf("DUPLICATE.(%s)\n",(char *)ptr); + portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); if ( ptr != 0 ) From 16e15a72f8ef5ab2b9bb3c7a34fb9ee4b8ecf45a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:49:07 +0300 Subject: [PATCH 162/682] Test --- iguana/exchanges/LP_nativeDEX.c | 45 ++++----------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0d286a425..072a28326 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s encrypted.%d recv.%u %02x %02x vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)); + printf("%s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) @@ -184,46 +184,11 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { len = (int32_t)strlen(jsonstr) + 1; - /*if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"forwardhex") == 0 ) - { - //printf("got forwardhex\n"); - if ( (retstr= LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 ) - { - } - } - else if ( jstr(argjson,"method") != 0 && strcmp(jstr(argjson,"method"),"publish") == 0 ) - { - printf("got publish\n"); - if ( jobj(argjson,"method2") != 0 ) - jdelete(argjson,"method2"); - jaddstr(argjson,"method2","broadcast"); - if ( pubsock >= 0 && (reqjson= LP_dereference(argjson,"publish")) != 0 ) - { - msg = jprint(reqjson,1); - /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); - } - } - else*/ if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) - { - } - /*if ( LP_COMMAND_RECVSOCK == NN_REP ) - { - if ( retstr != 0 ) - { - if ( strcmp("PULL",typestr) == 0 ) - { - printf("%d got REQ.(%s) -> (%s)\n",recvsock,jprint(argjson,0),retstr); - /LP_send(recvsock,retstr,(int32_t)strlen(retstr)+1,0); - } - } - else if ( strcmp("PULL",typestr) == 0 ) - { - printf("%d got REQ.(%s) -> null\n",recvsock,jprint(argjson,0)); - /LP_send(recvsock,"{\"result\":null}",(int32_t)strlen("{\"result\":null}")+1,0); - } - }*/ + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } free_json(argjson); - } else printf("error parsing(%s)\n",jsonstr); + } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) From f9e2c88188d462cfc479ea828679fa329036119c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 21:51:52 +0300 Subject: [PATCH 163/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 072a28326..359ceaff4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) From 9ba03c20885271f5b2d2b7adea73f5e55bf385e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:01:09 +0300 Subject: [PATCH 164/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 359ceaff4..f017db930 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + //printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 20d37cf61..2f2e1e703 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 6c10eea5d59dfe04134388a55cf10a6aae06b56b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:09:44 +0300 Subject: [PATCH 165/682] Test --- iguana/exchanges/LP_network.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2f2e1e703..880cf3e6e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,13 +128,13 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+30 ) + else if ( time(NULL) > ptr->starttime+10 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) { LP_Qfound++; - if ( (LP_Qenqueued % 10) == 0 ) + //if ( (LP_Qenqueued % 10) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From a2a26a48faf9e9314ebde745dd8ce39b3d26e7ee Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:19:52 +0300 Subject: [PATCH 166/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f017db930..359ceaff4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - //printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); if ( duplicate == 0 ) From 4a1a50e6f8103c1ee2a9255409bbbaed4eaeda57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:29:17 +0300 Subject: [PATCH 167/682] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 359ceaff4..9553f6197 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,9 +148,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; - printf("%s %s encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); + printf("%s %s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); @@ -260,16 +260,16 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) { - int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; //struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < 1000 && recvlen > 0 ) { - memset(&pfd,0,sizeof(pfd)); + /*memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) - break; + break;*/ if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { nonz++; From 305a25e5807526b1257b3279953bf54acbaa7de3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:30:38 +0300 Subject: [PATCH 168/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 880cf3e6e..176b58168 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 5c041f210cceeb9b894abd8acb1506915330ad20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:33:39 +0300 Subject: [PATCH 169/682] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 26351820b..8717b29ee 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -588,6 +588,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; + printf("addutxo.%d pubkey.%s session.%u\n",LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From 65b5205448c0066026ac9cded7e0fb0f0c52bb98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:42:23 +0300 Subject: [PATCH 170/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8717b29ee..8aeae6452 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -257,13 +257,13 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) jaddnum(item,"pending",utxo->T.swappending); if ( utxo->iambob != 0 ) { - jaddbits256(item,"srchash",LP_mypub25519); + jaddbits256(item,"srchash",utxo->pubkey);//LP_mypub25519); if ( bits256_nonz(utxo->S.otherpubkey) != 0 ) jaddbits256(item,"desthash",utxo->S.otherpubkey); } else { - jaddbits256(item,"desthash",LP_mypub25519); + jaddbits256(item,"desthash",utxo->pubkey);//LP_mypub25519); if ( bits256_nonz(utxo->S.otherpubkey) != 0 ) jaddbits256(item,"srchash",utxo->S.otherpubkey); } From 0da96b63e880de38243397f70a54a10a94ec2852 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:46:53 +0300 Subject: [PATCH 171/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 176b58168..ae77edece 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+10 ) + else if ( time(NULL) > ptr->starttime+30 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) @@ -255,7 +255,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 1ce8f324c6960182a27b3e55605521e3b5bbcb6c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:51:04 +0300 Subject: [PATCH 172/682] Test --- iguana/exchanges/LP_network.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ae77edece..ee3a00f5f 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -121,7 +121,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - //else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -176,7 +176,11 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 { if ( (sentbytes= nn_send(sock0,msg,msglen,0)) != msglen ) printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); - else sock0 = -1; + else + { + printf("Q sent %u\n",crc32); + sock0 = -1; + } } if ( sock1 >= 0 && LP_sockcheck(sock1) > 0 ) { From dbed9d678a21a12314a8f39194a22d4715b25266 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 22:58:07 +0300 Subject: [PATCH 173/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ee3a00f5f..ffefddb5e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+30 ) + else if ( time(NULL) > ptr->starttime+3 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) From 3146ea066832b7592be5cbfb788240baaebc5fa3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:02:38 +0300 Subject: [PATCH 174/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ffefddb5e..a587e580e 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -259,7 +259,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From fa835a6f32f739308952b274ccd861ade67de0a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:07:47 +0300 Subject: [PATCH 175/682] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_network.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 25ef0fe82..a8566530a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -28,7 +28,7 @@ #define LP_MAXPUBKEY_ERRORS 3 #define PSOCK_KEEPALIVE 3600 -#define MAINLOOP_PERSEC 10 +#define MAINLOOP_PERSEC 100 #define MAX_PSOCK_PORT 60000 #define MIN_PSOCK_PORT 10000 #define LP_MEMPOOL_TIMEINCR 10 diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index a587e580e..742f29321 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -128,7 +128,7 @@ void queue_loop(void *ignore) else flag = 1; } } - else if ( time(NULL) > ptr->starttime+3 ) + else if ( time(NULL) > ptr->starttime+13 ) { LP_crc32find(&duplicate,-1,ptr->crc32); if ( duplicate > 0 ) @@ -259,7 +259,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From 718d783b5cb6ddee37a43e444de3aa847fb88706 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:21:26 +0300 Subject: [PATCH 176/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9553f6197..839f3a727 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -376,7 +376,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { LP_utxo_spentcheck(pubsock,utxo); if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 ) + { + char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); LP_utxo_clientpublish(utxo); + } } } //if ( IAMLP != 0 && (counter % 600) == 42 ) From 317206b5a6797fb3f22d0e895db891b6843a0161 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:25:26 +0300 Subject: [PATCH 177/682] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 839f3a727..e34f64ec0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -190,6 +190,17 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, free_json(argjson); } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); + else if ( encrypted == 0 ) + { + if ( (argjson= cJSON_Parse((char *)ptr)) != 0 ) + { + len = (int32_t)strlen((char *)ptr) + 1; + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } + free_json(argjson); + } + } portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); From a23be2f72e5e6504b5d6864bf7d03272f74cac05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:27:38 +0300 Subject: [PATCH 178/682] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ----------- iguana/exchanges/LP_utxos.c | 2 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e34f64ec0..839f3a727 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -190,17 +190,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, free_json(argjson); } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); - else if ( encrypted == 0 ) - { - if ( (argjson= cJSON_Parse((char *)ptr)) != 0 ) - { - len = (int32_t)strlen((char *)ptr) + 1; - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) - { - } - free_json(argjson); - } - } portable_mutex_unlock(&LP_commandmutex); if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) free(jsonstr); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8aeae6452..7e515cee5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -618,6 +618,8 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson } portable_mutex_lock(&LP_UTXOmutex); utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"session")); + if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) + utxo->T.lasttime = (uint32_t)time(NULL); portable_mutex_unlock(&LP_UTXOmutex); return(utxo); } From 55bc95d0c14f61dbe277d4f8da7ca8644acfa4d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 23:29:02 +0300 Subject: [PATCH 179/682] Test --- iguana/exchanges/LP_utxos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 7e515cee5..cc5abb1d6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -619,7 +619,10 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson portable_mutex_lock(&LP_UTXOmutex); utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"session")); if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) + { utxo->T.lasttime = (uint32_t)time(NULL); + printf("set lasttime!\n"); + } portable_mutex_unlock(&LP_UTXOmutex); return(utxo); } From 257e65f2c4514d49c3e3dede4eb774fa36593382 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 11:49:03 +0300 Subject: [PATCH 180/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 839f3a727..61dba7f34 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -151,6 +151,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); printf("%s %s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); +duplicate = 0; if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); From 51cd4518e89acad318f2f5d719dd7fcaf9d2404d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 11:55:59 +0300 Subject: [PATCH 181/682] Test --- iguana/exchanges/LP_utxos.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index cc5abb1d6..e43319bdb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -553,12 +553,15 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit utxo = 0; } } - if ( utxo->T.sessionid == 0 ) - utxo->T.sessionid = sessionid; - //else if ( profitmargin > SMALLVAL ) - // utxo->S.profitmargin = profitmargin; if ( utxo != 0 ) + { + if ( utxo->T.sessionid == 0 ) + utxo->T.sessionid = sessionid; + //else if ( profitmargin > SMALLVAL ) + // utxo->S.profitmargin = profitmargin; + utxo->T.lasttime = (uint32_t)time(NULL); return(utxo); + } } utxo = calloc(1,sizeof(*utxo)); //utxo->S.profitmargin = profitmargin; From 03be9eb01329841493b4107cd78352ab23785615 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 11:58:22 +0300 Subject: [PATCH 182/682] Test --- iguana/exchanges/LP_utxos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e43319bdb..f8d6db11d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -606,7 +606,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } else LP_utxo_clientpublish(utxo);*/ LP_utxo_clientpublish(utxo); if ( LP_mypeer != 0 && LP_ismine(utxo) > 0 ) + { LP_mypeer->numutxos++; + utxo->T.lasttime = (uint32_t)time(NULL); + } } return(utxo); } From 256c5c80b0a9d6bc41d9252789aff78fe1d7c9db Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 12:04:40 +0300 Subject: [PATCH 183/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 61dba7f34..333aae2a9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -151,7 +151,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); printf("%s %s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); -duplicate = 0; +//duplicate = 0; if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); From 5e0f5cc2fa5c7bcc9da991b2210cb5b9b2c46759 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 12:11:26 +0300 Subject: [PATCH 184/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f8d6db11d..aa7bdb934 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -499,9 +499,9 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; - if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 ) + if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { - printf("malformed addutxo %d %d %d %d %d %d %d %d %d\n", symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); + printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) From d17f35a6fe1403a7600c75b969ca7a873c846d60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 12:45:13 +0300 Subject: [PATCH 185/682] test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 333aae2a9..1902597a1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -376,7 +376,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) { LP_utxo_spentcheck(pubsock,utxo); - if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 ) + if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) { char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); LP_utxo_clientpublish(utxo); From 371b0e4ac8452cc675c2ba48c6189a0ded56869a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 12:54:53 +0300 Subject: [PATCH 186/682] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1902597a1..80c079c49 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -340,11 +340,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { - if ( IAMLP != 0 ) - printf("numpeers.%d updatepeer.%s lag.%d\n",numpeers,peer->ipaddr,now-peer->lastpeers); + //if ( IAMLP != 0 ) + // printf("numpeers.%d updatepeer.%s lag.%d\n",numpeers,peer->ipaddr,now-peer->lastpeers); peer->lastpeers = now; - if ( IAMLP != 0 && peer->numpeers != numpeers ) - printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); + //if ( IAMLP != 0 && peer->numpeers != numpeers ) + // printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); } From 100e147b7d982e032546864df378e0f8d34f0072 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:05:48 +0300 Subject: [PATCH 187/682] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 80c079c49..055b4a49c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -150,8 +150,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, encrypted = 1; portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); - printf("%s %s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,(char *)ptr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); -//duplicate = 0; + printf("%s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); +if ( IAMLP != 0 ) + duplicate = 0; if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); From 7fd7cafebba39844aedcf3bbacb8f6c6d1ea661a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:07:36 +0300 Subject: [PATCH 188/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 055b4a49c..de96f5e73 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -151,8 +151,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); printf("%s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); -if ( IAMLP != 0 ) - duplicate = 0; if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); From 809b9b21c8343e529d8f5ec1adfc0204bb5dbc80 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:10:35 +0300 Subject: [PATCH 189/682] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index de96f5e73..deab22ed0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -144,13 +144,17 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,uint8_t *ptr,int32_t recvlen,int32_t recvsock) { + static uint32_t dup,uniq; int32_t i,len,datalen=0,duplicate=0,encrypted=0; char *retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; portable_mutex_lock(&LP_commandmutex); i = LP_crc32find(&duplicate,-1,crc32); - printf("%s dup.%d encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + if ( duplicate != 0 ) + dup++; + else uniq++; + printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); From 54938eac58ca9fb35dd59d389b9762d35647dbcd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:11:43 +0300 Subject: [PATCH 190/682] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index deab22ed0..0914b9503 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -264,16 +264,16 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) { - int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; //struct nn_pollfd pfd; + int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; if ( sock >= 0 ) { while ( nonz < 1000 && recvlen > 0 ) { - /*memset(&pfd,0,sizeof(pfd)); + memset(&pfd,0,sizeof(pfd)); pfd.fd = sock; pfd.events = NN_POLLIN; if ( nn_poll(&pfd,1,1) != 1 ) - break;*/ + break; if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) { nonz++; From cd4829da4a0a2e46c28df5d39c0d29aaf20109fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:17:48 +0300 Subject: [PATCH 191/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_utxos.c | 20 +++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0914b9503..d49fb01d7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -379,7 +379,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp) { LP_utxo_spentcheck(pubsock,utxo); - if ( utxo->T.spentflag == 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) + if ( LP_isunspent(utxo) > 0 && utxo->T.lasttime == 0 && LP_ismine(utxo) > 0 ) { char str[65]; printf("publish mybob %s\n",bits256_str(str,utxo->payment.txid)); LP_utxo_clientpublish(utxo); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1fd2fd4ed..ce0146e67 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -542,7 +542,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * { *arrayp = realloc(*arrayp,sizeof(*(*arrayp)) * (num+1)); (*arrayp)[num++] = op; - if ( bits256_cmp(utxo->pubkey,LP_mypub25519) == 0 && utxo->T.lasttime == 0 ) + if ( LP_ismine(utxo) > 0 && utxo->T.lasttime == 0 ) LP_utxo_clientpublish(utxo); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index aa7bdb934..abd88f3ef 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -471,9 +471,12 @@ char *LP_spentcheck(cJSON *argjson) void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) { bits256 zero; char *msg; - memset(zero.bytes,0,sizeof(zero)); - msg = jprint(LP_utxojson(utxo),1); - LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); + if ( LP_isunspent(utxo) > 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + msg = jprint(LP_utxojson(utxo),1); + LP_broadcast_message(LP_mypubsock,utxo->coin,"",zero,msg); + } /*struct LP_peerinfo *peer,*tmp; cJSON *retjson; char *retstr; int32_t n = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { @@ -604,11 +607,14 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit msg = jprint(LP_utxojson(utxo),1); /LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); } else LP_utxo_clientpublish(utxo);*/ - LP_utxo_clientpublish(utxo); - if ( LP_mypeer != 0 && LP_ismine(utxo) > 0 ) + if ( LP_ismine(utxo) > 0 ) { - LP_mypeer->numutxos++; - utxo->T.lasttime = (uint32_t)time(NULL); + LP_utxo_clientpublish(utxo); + if ( LP_mypeer != 0 ) + { + LP_mypeer->numutxos++; + utxo->T.lasttime = (uint32_t)time(NULL); + } } } return(utxo); From a3acf4d2e5eb6baf735eb74b31b62048e78ab7f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:21:19 +0300 Subject: [PATCH 192/682] 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 44cf4f5f0..bd52c484f 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -791,7 +791,7 @@ void LP_main(void *ptr) { profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; - LPinit(7779,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(8779,8780,8781,8782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 7f068e401e1a839ee9e37705041797547139fb06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:23:33 +0300 Subject: [PATCH 193/682] Test --- iguana/exchanges/LP_peers.c | 2 ++ iguana/exchanges/mm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index cde113f83..db0401b1e 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -54,6 +54,8 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; +if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) + return(0); ipbits = (uint32_t)calc_ipbits(ipaddr); expand_ipbits(checkip,ipbits); if ( strcmp(checkip,ipaddr) == 0 ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index bd52c484f..44cf4f5f0 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -791,7 +791,7 @@ void LP_main(void *ptr) { profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; - LPinit(8779,8780,8781,8782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + LPinit(7779,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 4bbdc13965d20cea222c2787fa6ea98666c1226a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:38:04 +0300 Subject: [PATCH 194/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index abd88f3ef..c1fbe9081 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -526,7 +526,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); return(0); } - if ( dispflag != 0 ) + //if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) From 5209e2dcf181aea659047bbf3b4e75f45ff8d6af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:41:28 +0300 Subject: [PATCH 195/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 84e80801d..49d55f6d8 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -22,7 +22,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - //printf("stats_JSON(%s)\n",jprint(argjson,0)); + printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) @@ -305,7 +305,7 @@ trust(pubkey, trust)\n\ return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { - //printf("UTXO.%s\n",method); + printf("UTXO.%s\n",method); if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); From 25e8c7b5e2f2de005478d026b9a8bcbff61c84e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:46:20 +0300 Subject: [PATCH 196/682] Test --- iguana/exchanges/LP_network.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 742f29321..0c1aa9cc2 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -251,11 +251,14 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( (methodstr= jstr(argjson,"method")) != 0 && strlen(methodstr) <= sizeof(method) ) { strcpy(method,methodstr); - jdelete(argjson,"method"); - if ( jobj(argjson,"method2") != 0 ) - jdelete(argjson,"method2"); - jaddstr(argjson,"method2",method); - jaddstr(argjson,"method","broadcast"); + if ( IAMLP == 0 ) + { + jdelete(argjson,"method"); + if ( jobj(argjson,"method2") != 0 ) + jdelete(argjson,"method2"); + jaddstr(argjson,"method2",method); + jaddstr(argjson,"method","broadcast"); + } msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); From c121b6278f06cd2e9f81d2cb9b0b8a84487968d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:50:47 +0300 Subject: [PATCH 197/682] Test --- iguana/exchanges/LP_network.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0c1aa9cc2..dc057b378 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -251,6 +251,11 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( (methodstr= jstr(argjson,"method")) != 0 && strlen(methodstr) <= sizeof(method) ) { strcpy(method,methodstr); + jdelete(argjson,"method"); + jaddstr(argjson,"method",method); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + crc32 = calc_crc32(0,&msg[2],msglen - 2); if ( IAMLP == 0 ) { jdelete(argjson,"method"); @@ -259,9 +264,6 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"method2",method); jaddstr(argjson,"method","broadcast"); } - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - crc32 = calc_crc32(0,&msg[2],msglen - 2); //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); From ea55b1c7025b2dbbbff15c1d848f32ac8be536e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:52:55 +0300 Subject: [PATCH 198/682] Test --- iguana/exchanges/LP_network.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index dc057b378..ee6fe6e1c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -256,15 +256,18 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); if ( IAMLP == 0 ) { + free(msg); jdelete(argjson,"method"); if ( jobj(argjson,"method2") != 0 ) jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; } - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); //jdelete(argjson,"method"); //jaddstr(argjson,"method","broadcast"); //msg = (void *)jprint(argjson,0); From c4344cc87650e0470d2ab4a8e2da5302d33bf39b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:55:54 +0300 Subject: [PATCH 199/682] Test --- iguana/exchanges/LP_network.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ee6fe6e1c..3c50b617d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -256,7 +256,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); if ( IAMLP == 0 ) { free(msg); @@ -267,13 +267,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"method","broadcast"); msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; - } - //jdelete(argjson,"method"); - //jaddstr(argjson,"method","broadcast"); - //msg = (void *)jprint(argjson,0); - if ( IAMLP != 0 ) - LP_queuesend(crc32,pubsock,base,rel,msg,msglen); - else LP_queuesend(crc32,-1,base,rel,msg,msglen); + LP_queuesend(crc32,-1,base,rel,msg,msglen); + } else LP_queuesend(crc32,pubsock,base,rel,msg,msglen); free(msg); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); From 86fe7f052fa7918b487988e9533f7b2e6fe37be1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 13:59:36 +0300 Subject: [PATCH 200/682] Test --- iguana/exchanges/LP_network.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 3c50b617d..ce4922ce4 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -252,6 +252,9 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 { strcpy(method,methodstr); jdelete(argjson,"method"); + if ( jobj(argjson,"method2") != 0 ) + jdelete(argjson,"method2"); + jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; @@ -261,9 +264,6 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 { free(msg); jdelete(argjson,"method"); - if ( jobj(argjson,"method2") != 0 ) - jdelete(argjson,"method2"); - jaddstr(argjson,"method2",method); jaddstr(argjson,"method","broadcast"); msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; From 3f7ec224cbc12fde6bff0d7e65953ac601f432d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:02:12 +0300 Subject: [PATCH 201/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 49d55f6d8..39362b627 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -22,7 +22,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - printf("stats_JSON(%s)\n",jprint(argjson,0)); + //printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index ce4922ce4..b156442ec 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -259,7 +259,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; crc32 = calc_crc32(0,&msg[2],msglen - 2); - printf("CRC32.%u (%s)\n",crc32,(char *)msg); + //printf("CRC32.%u (%s)\n",crc32,(char *)msg); if ( IAMLP == 0 ) { free(msg); From 27d6452bf5ac1ff78129db56e140a2ad19875097 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:06:20 +0300 Subject: [PATCH 202/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxos.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 39362b627..84e80801d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -305,7 +305,7 @@ trust(pubkey, trust)\n\ return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { - printf("UTXO.%s\n",method); + //printf("UTXO.%s\n",method); if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d49fb01d7..670b32a38 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -154,7 +154,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( duplicate != 0 ) dup++; else uniq++; - printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); + printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( duplicate == 0 ) { LP_crc32find(&duplicate,i,crc32); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c1fbe9081..6a4ba2eed 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -602,6 +602,8 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit portable_mutex_unlock(&LP_utxomutex); if ( iambob != 0 ) { + if ( LP_mypeer != 0 ) + LP_mypeer->numutxos++; /*if ( mypubsock >= 0 ) { msg = jprint(LP_utxojson(utxo),1); @@ -611,10 +613,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit { LP_utxo_clientpublish(utxo); if ( LP_mypeer != 0 ) - { - LP_mypeer->numutxos++; utxo->T.lasttime = (uint32_t)time(NULL); - } } } return(utxo); From defca0aa9006181d21cb8c12c5607eb4ad815ed3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:24:45 +0300 Subject: [PATCH 203/682] Test --- iguana/exchanges/LP_nativeDEX.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 670b32a38..b8bb5410c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -202,21 +202,6 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, return(retstr); } -/*int32_t LP_pullsock_check(void *ctx,char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock) -{ - void *ptr; int32_t recvlen=-1,nonz = 0; - *retstrp = 0; - if ( pullsock >= 0 ) - { - while ( (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) > 0 ) - { - nonz++; - *retstrp = LP_process_message(ctx,"PULL",myipaddr,pubsock,ptr,recvlen,pullsock); - } - } - return(nonz); -}*/ - void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) { struct _LP_utxoinfo u; char str[65]; uint32_t now = (uint32_t)time(NULL); @@ -324,7 +309,7 @@ void command_rpcloop(void *myipaddr) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) { static uint32_t counter,numpeers; //lastforward - struct LP_utxoinfo *utxo,*utmp; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; int32_t nonz = 0,n=0,lastn=-1; + struct LP_utxoinfo *utxo,*utmp; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t now; int32_t mostutxos,nonz = 0,n=0,lastn=-1; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -332,6 +317,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int myipaddr = "127.0.0.1"; //if ( LP_canbind == 0 ) printf("counter.%d canbind.%d peers\n",counter,LP_canbind); numpeers = LP_numpeers(); + mostutxos = 0; + mostpeer = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { if ( peer->errors >= LP_MAXPEER_ERRORS ) @@ -341,6 +328,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } + if ( peer->numutxos > mostutxos ) + { + mostutxos = peer->numutxos; + mostpeer = peer; + } if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { //if ( IAMLP != 0 ) @@ -362,6 +354,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int peer->diduquery = now; } } + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) + { + LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60); + LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); + + } if ( (counter % 600) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase); From 0125242b5370c4bee14fd022748d2c4680fbf0dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:28:47 +0300 Subject: [PATCH 204/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b8bb5410c..8b9aa05c4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -356,6 +356,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { + printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60); LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); From c97a2396c960f32be43ba20eeb13581c19ef1dd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:32:00 +0300 Subject: [PATCH 205/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6a4ba2eed..507c12ab6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -594,7 +594,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; - printf("addutxo.%d pubkey.%s session.%u\n",LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); + printf("U.%d addutxo.%d pubkey.%s session.%u\n",LP_mypeer!=0?LP_mypeer->numutxos:-1,LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From d1542798f181c2d39e48328080bac812cf9c50c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:36:56 +0300 Subject: [PATCH 206/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8b9aa05c4..9907034da 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -321,6 +321,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int mostpeer = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { + printf("%d ",peer->numutxos); if ( peer->errors >= LP_MAXPEER_ERRORS ) { if ( (rand() % 10000) == 0 ) @@ -354,6 +355,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int peer->diduquery = now; } } + printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); From 15dab6f052b989c393e49e550b365102b869de22 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:39:37 +0300 Subject: [PATCH 207/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9907034da..31968a2a5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -321,7 +321,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int mostpeer = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { - printf("%d ",peer->numutxos); if ( peer->errors >= LP_MAXPEER_ERRORS ) { if ( (rand() % 10000) == 0 ) @@ -329,6 +328,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } + if ( IAMLP != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) + LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + printf("%d ",peer->numutxos); if ( peer->numutxos > mostutxos ) { mostutxos = peer->numutxos; From 478dea4412f3bf81c83a54a07503990f3ef85f08 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:42:34 +0300 Subject: [PATCH 208/682] Test --- iguana/exchanges/LP_peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index db0401b1e..c43264df9 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -216,7 +216,7 @@ void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0,mypeer!=0?mypeer->numutxos:0)) != 0 ) { - //printf("got.(%s)\n",retstr); + printf("got.(%s)\n",retstr); now = (uint32_t)time(NULL); LP_peersparse(mypeer,mypubsock,destipaddr,destport,retstr,now); free(retstr); From 6a370da408b9f63cdae3bd4479d0caff69f6249b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 14:45:45 +0300 Subject: [PATCH 209/682] Test --- iguana/exchanges/LP_peers.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index c43264df9..96d677561 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -34,8 +34,11 @@ cJSON *LP_peerjson(struct LP_peerinfo *peer) jaddstr(item,"ipaddr",peer->ipaddr); jaddnum(item,"port",peer->port); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + { jaddnum(item,"session",LP_sessionid); - else jaddnum(item,"session",peer->sessionid); + if ( LP_mypeer != 0 ) + jaddnum(item,"numutxos",LP_mypeer->numutxos); + } else jaddnum(item,"session",peer->sessionid); //jaddnum(item,"profit",peer->profitmargin); return(item); } @@ -68,6 +71,8 @@ if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) peer->numpeers = numpeers; if ( numutxos > peer->numutxos ) peer->numutxos = numutxos; + if ( peer->sessionid == 0 ) + peer->sessionid = sessionid; } else { From b73ae9a0ea10be7db7c61765cb8c792d627662a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:00:58 +0300 Subject: [PATCH 210/682] Test --- iguana/exchanges/LP_commands.c | 13 +++++++++++++ iguana/exchanges/LP_nativeDEX.c | 23 ++++++++++++++++++++--- iguana/exchanges/LP_peers.c | 9 +++------ iguana/exchanges/LP_rpc.c | 9 +++++++++ 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 84e80801d..0e9b02cdc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -18,6 +18,17 @@ // marketmaker // +char *LP_numutxos() +{ + cJSON *retjson = cJSON_CreateObject(); + if ( LP_mypeer != 0 ) + { + jaddnum(retjson,"numutxos",LP_mypeer->numutxos); + jaddnum(retjson,"numpeers",LP_mypeer->numpeers); + jaddnum(retjson,"session",LP_sessionid); + } jaddstr(retjson,"error","client node"); + return(jprint(retjson,1)); +} char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { @@ -266,6 +277,8 @@ trust(pubkey, trust)\n\ retstr = LP_spentcheck(argjson); else if ( strcmp(method,"getcoins") == 0 ) return(jprint(LP_coinsjson(),1)); + else if ( strcmp(method,"numutxos") == 0 ) + return(LP_numutxos()); else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); //else if ( strcmp(method,"broadcast") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 31968a2a5..d8d6bd730 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -309,7 +309,7 @@ void command_rpcloop(void *myipaddr) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) { static uint32_t counter,numpeers; //lastforward - struct LP_utxoinfo *utxo,*utmp; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t now; int32_t mostutxos,nonz = 0,n=0,lastn=-1; + struct LP_utxoinfo *utxo,*utmp; cJSON *retjson; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t id,now; int32_t mostutxos,nonz = 0,n=0,num,lastn=-1; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -328,8 +328,25 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( IAMLP != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) - LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + if ( IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) + { + if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) + { + printf("%s\n",retstr); + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) + peer->numutxos = num; + if ( (num= jint(retjson,"numpeers")) > peer->numpeers ) + peer->numpeers = num; + if ( (id= juint(retjson,"session")) != 0 ) + peer->sessionid = id; + free_json(retjson); + } + free(retstr); + retstr = 0; + } + } printf("%d ",peer->numutxos); if ( peer->numutxos > mostutxos ) { diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 96d677561..4828f6153 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -65,18 +65,15 @@ if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) { if ( (peer= LP_peerfind(ipbits,port)) != 0 ) { - //if ( profitmargin != 0. ) - // peer->profitmargin = profitmargin; - if ( numpeers > peer->numpeers ) + /*if ( numpeers > peer->numpeers ) peer->numpeers = numpeers; if ( numutxos > peer->numutxos ) peer->numutxos = numutxos; if ( peer->sessionid == 0 ) - peer->sessionid = sessionid; + peer->sessionid = sessionid;*/ } else { - printf("LPaddpeer %s\n",ipaddr); peer = calloc(1,sizeof(*peer)); if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) peer->sessionid = LP_sessionid; @@ -221,7 +218,7 @@ void LP_peersquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); if ( (retstr= issue_LP_getpeers(destipaddr,destport,myipaddr,myport,mypeer!=0?mypeer->numpeers:0,mypeer!=0?mypeer->numutxos:0)) != 0 ) { - printf("got.(%s)\n",retstr); + //printf("got.(%s)\n",retstr); now = (uint32_t)time(NULL); LP_peersparse(mypeer,mypubsock,destipaddr,destport,retstr,now); free(retstr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 659dcd51d..0725c97ed 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -57,6 +57,15 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por return(retstr); } +char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) +{ + char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); + retstr = LP_issue_curl("numutxos",destip,port,url); + //printf("%s -> getpeers.(%s)\n",destip,retstr); + return(retstr); +} + char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { char url[512]; From 9f24a3cb539e761e37b0e0cc1cfa2fa78a492beb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:03:43 +0300 Subject: [PATCH 211/682] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_nativeDEX.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0e9b02cdc..051597b3a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -23,10 +23,12 @@ char *LP_numutxos() cJSON *retjson = cJSON_CreateObject(); if ( LP_mypeer != 0 ) { + jaddstr(retjson,"ipaddr",LP_mypeer->ipaddr); + jaddnum(retjson,"port",LP_mypeer->port); jaddnum(retjson,"numutxos",LP_mypeer->numutxos); jaddnum(retjson,"numpeers",LP_mypeer->numpeers); jaddnum(retjson,"session",LP_sessionid); - } jaddstr(retjson,"error","client node"); + } else jaddstr(retjson,"error","client node"); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d8d6bd730..e61718f2e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -332,7 +332,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) { - printf("%s\n",retstr); + //printf("%s\n",retstr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) From 0220e21d31f08cd13b82b2f2999b5e65d382e0de Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:08:17 +0300 Subject: [PATCH 212/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e61718f2e..c498966b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -332,7 +332,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) { - //printf("%s\n",retstr); + printf("%d <- (%s)\n",peer->numutxos,retstr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) @@ -347,7 +347,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int retstr = 0; } } - printf("%d ",peer->numutxos); if ( peer->numutxos > mostutxos ) { mostutxos = peer->numutxos; From 61488b4f10e35071680dd3ea6c7fb8537d2aeee2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:11:27 +0300 Subject: [PATCH 213/682] Test --- iguana/exchanges/LP_nativeDEX.c | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c498966b5..795a84dd1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -328,30 +328,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( IAMLP == 0 ) continue; } - if ( IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) - { - if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) - { - printf("%d <- (%s)\n",peer->numutxos,retstr); - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) - peer->numutxos = num; - if ( (num= jint(retjson,"numpeers")) > peer->numpeers ) - peer->numpeers = num; - if ( (id= juint(retjson,"session")) != 0 ) - peer->sessionid = id; - free_json(retjson); - } - free(retstr); - retstr = 0; - } - } - if ( peer->numutxos > mostutxos ) - { - mostutxos = peer->numutxos; - mostpeer = peer; - } if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 10000) == 0) ) { //if ( IAMLP != 0 ) @@ -361,6 +337,25 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int // printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,numpeers); if ( strcmp(peer->ipaddr,myipaddr) != 0 ) LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport); + if ( IAMLP != 0 && LP_mypeer != 0 && strcmp(peer->ipaddr,myipaddr) != 0 ) + { + if ( (retstr= issue_LP_numutxos(peer->ipaddr,peer->port,LP_mypeer->ipaddr,LP_mypeer->port,LP_mypeer->numpeers,LP_mypeer->numutxos)) != 0 ) + { + //printf("%d <- (%s)\n",peer->numutxos,retstr); + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (num= jint(retjson,"numutxos")) > peer->numutxos ) + peer->numutxos = num; + if ( (num= jint(retjson,"numpeers")) > peer->numpeers ) + peer->numpeers = num; + if ( (id= juint(retjson,"session")) != 0 ) + peer->sessionid = id; + free_json(retjson); + } + free(retstr); + retstr = 0; + } + } } if ( peer->diduquery == 0 ) { @@ -372,8 +367,13 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int LP_peer_pricesquery(peer->ipaddr,peer->port); peer->diduquery = now; } + if ( peer->numutxos > mostutxos ) + { + mostutxos = peer->numutxos; + mostpeer = peer; + } } - printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); + //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); From e158e850670fe57a882281a7e97c71426e72471d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:16:54 +0300 Subject: [PATCH 214/682] Test --- iguana/exchanges/numutxos | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/numutxos diff --git a/iguana/exchanges/numutxos b/iguana/exchanges/numutxos new file mode 100755 index 000000000..b20de95fc --- /dev/null +++ b/iguana/exchanges/numutxos @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"numutxos\"}" From 9121b05c6016c2e3e88293bea4f319f20233574e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:33:11 +0300 Subject: [PATCH 215/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 795a84dd1..66d0e208a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,7 +18,6 @@ // marketmaker // // swap cancel should cleanly cancel -// as much as possible on a unidirectional basis // stats // auto-utxo creation // multiple smartaddresses? enable/disable causes? 250 KMD bounty @@ -195,7 +194,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); - if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && (void *)jsonstr != (void *)decoded ) + if ( jsonstr != 0 && (void *)jsonstr != (void *)ptr && encrypted == 0 ) free(jsonstr); if ( ptr != 0 ) nn_freemsg(ptr), ptr = 0; From d6a796b9f82ee812566ef5551eadf0d67bd0f739 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:44:13 +0300 Subject: [PATCH 216/682] Test --- iguana/exchanges/LP_network.c | 44 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index b156442ec..6dfed1824 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -223,6 +223,24 @@ void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *m // first 2 bytes == (crc32 & 0xffff) if encrypted, then nonce is next crypto_box_NONCEBYTES // GENESIS_PRIVKEY is always the sender +void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON *argjson) +{ + int32_t msglen; uint32_t crc32; + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + crc32 = calc_crc32(0,&msg[2],msglen - 2); + if ( IAMLP == 0 ) + { + free(msg); + jdelete(argjson,"method"); + jaddstr(argjson,"method","broadcast"); + msg = (void *)jprint(argjson,0); + msglen = (int32_t)strlen((char *)msg) + 1; + LP_queuesend(crc32,-1,base,rel,msg,msglen); + } else LP_queuesend(crc32,pubsock,base,rel,msg,msglen); + free(msg); +} + void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25519,char *msgstr) { uint8_t encoded[LP_ENCRYPTED_MAXSIZE],space[sizeof(encoded)],*msg,*nonce,*cipher; int32_t encrypted=0,msglen; uint32_t crc32=0; cJSON *argjson; char *methodstr,method[64],cipherstr[LP_ENCRYPTED_MAXSIZE*2+1]; @@ -256,20 +274,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - crc32 = calc_crc32(0,&msg[2],msglen - 2); //printf("CRC32.%u (%s)\n",crc32,(char *)msg); - if ( IAMLP == 0 ) - { - free(msg); - jdelete(argjson,"method"); - jaddstr(argjson,"method","broadcast"); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - LP_queuesend(crc32,-1,base,rel,msg,msglen); - } else LP_queuesend(crc32,pubsock,base,rel,msg,msglen); - free(msg); + LP_broadcast_finish(pubsock,base,rel,msg,argjson); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); @@ -281,16 +287,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"cipher",cipherstr); jaddstr(argjson,"method2","encrypted"); jaddstr(argjson,"method","encrypted"); - msg = (void *)jprint(argjson,0); - crc32 = calc_crc32(0,&msg[2],(int32_t)strlen((char *)msg)+1-2); - jdelete(argjson,"method"); - jaddstr(argjson,"method","broadcast"); - msg = (void *)jprint(argjson,0); - msglen = (int32_t)strlen((char *)msg) + 1; - if ( IAMLP != 0 ) - LP_queuesend(crc32,pubsock,base,rel,msg,msglen); - else LP_queuesend(crc32,-1,base,rel,msg,msglen); - free(msg); + LP_broadcast_finish(pubsock,base,rel,msg,argjson); + free_json(argjson); } if ( msgstr != 0 ) free(msgstr); From cc7071451e42aae056a2493198c288096c762c3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:57:09 +0300 Subject: [PATCH 217/682] Test --- iguana/exchanges/LP_nativeDEX.c | 60 ++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 66d0e208a..cd5e841cc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -141,10 +141,33 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) } } +char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) +{ + uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES],*nonce,*cipher; int32_t recvlen,cipherlen; char *jsonstr = 0; + recvlen = *recvlenp; + nonce = &ptr[2]; + cipher = &ptr[2 + crypto_box_NONCEBYTES]; + cipherlen = recvlen - (2 + crypto_box_NONCEBYTES); + if ( cipherlen > 0 && cipherlen < sizeof(decoded) ) + { + if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,LP_mypriv25519)) != 0 ) + { + recvlen = (cipherlen - crypto_box_ZEROBYTES); + if ( strlen(jsonstr)+1 != recvlen ) + { + printf("unexpected len %d vs recvlen.%d\n",(int32_t)strlen(jsonstr)+1,recvlen); + jsonstr = 0; + } else printf("decrypted (%s)\n",jsonstr); + } + } else printf("cipher.%d too big for %d\n",cipherlen,(int32_t)sizeof(decoded)); + *recvlenp = recvlen; + return(jsonstr); +} + char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,uint8_t *ptr,int32_t recvlen,int32_t recvsock) { static uint32_t dup,uniq; - int32_t i,len,datalen=0,duplicate=0,encrypted=0; char *retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; + int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; @@ -158,24 +181,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { LP_crc32find(&duplicate,i,crc32); if ( encrypted != 0 ) - { - uint8_t *nonce,*cipher; int32_t cipherlen; - nonce = &ptr[2]; - cipher = &ptr[2 + crypto_box_NONCEBYTES]; - cipherlen = recvlen - (2 + crypto_box_NONCEBYTES); - if ( cipherlen > 0 && cipherlen < sizeof(decoded) ) - { - if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,LP_mypriv25519)) != 0 ) - { - recvlen = (cipherlen - crypto_box_ZEROBYTES); - if ( strlen(jsonstr)+1 != recvlen ) - { - printf("unexpected len %d vs recvlen.%d\n",(int32_t)strlen(jsonstr)+1,recvlen); - jsonstr = 0; - } else printf("decrypted (%s)\n",jsonstr); - } - } else printf("cipher.%d too big for %d\n",cipherlen,(int32_t)sizeof(decoded)); - } + jsonstr = LP_decrypt(ptr,&recvlen); else if ( (datalen= is_hexstr((char *)ptr,0)) > 0 ) { datalen >>= 1; @@ -186,6 +192,22 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, // "encrypted" "cipherstr" case! if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { + uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; + if ( (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) + { + if ( (method= jstr(argjson,"method")) != 0 && strcmp(method,"encrypted") == 0 ) + { + cipherlen >>= 1; + decode_hex(decoded,cipherlen,cipherstr); + crc32 = calc_crc32(0,&decoded[2],cipherlen-2); + if ( (jsonstr= LP_decrypt(ptr,&recvlen)) != 0 ) + { + free_json(argjson); + argjson = cJSON_Parse(jsonstr); + printf("%02x %02x %08x decrypted.(%s)\n",decoded[0],decoded[1],crc32,jsonstr); + } + } + } len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { From 7adfce2b7512408ccdbb8ec063fb0a67b876fba3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 15:59:14 +0300 Subject: [PATCH 218/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cd5e841cc..6cf0ebed4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -193,6 +193,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; + printf("[%s]\n",jsonstr); + cipherlen = 0; if ( (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) { if ( (method= jstr(argjson,"method")) != 0 && strcmp(method,"encrypted") == 0 ) @@ -207,7 +209,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, printf("%02x %02x %08x decrypted.(%s)\n",decoded[0],decoded[1],crc32,jsonstr); } } - } + } else printf("cipherlen.%d\n",cipherlen); len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { From 3cd67ceccc19700b29fc4920e8657a47096c212c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:02:24 +0300 Subject: [PATCH 219/682] Test --- iguana/exchanges/DB/.tmpmarker | 0 iguana/exchanges/DB/ECB/.tmpmarker | 0 iguana/exchanges/DB/SWAPS/.tmpmarker | 0 iguana/exchanges/DB/TRANSACTIONS/.tmpmarker | 0 iguana/exchanges/DB/purgeable/.tmpmarker | 0 iguana/exchanges/DB/purgeable/BTC/.tmpmarker | 0 iguana/exchanges/DB/purgeable/BTCD/.tmpmarker | 0 iguana/exchanges/LP_nativeDEX.c | 6 +++--- iguana/exchanges/SVM/.tmpmarker | 0 iguana/exchanges/SVM/models/.tmpmarker | 0 iguana/exchanges/SVM/rawfeatures/.tmpmarker | 0 iguana/exchanges/confs/.tmpmarker | 0 iguana/exchanges/genesis/.tmpmarker | 0 iguana/exchanges/tmp/.tmpmarker | 0 14 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 iguana/exchanges/DB/.tmpmarker create mode 100644 iguana/exchanges/DB/ECB/.tmpmarker create mode 100644 iguana/exchanges/DB/SWAPS/.tmpmarker create mode 100644 iguana/exchanges/DB/TRANSACTIONS/.tmpmarker create mode 100644 iguana/exchanges/DB/purgeable/.tmpmarker create mode 100644 iguana/exchanges/DB/purgeable/BTC/.tmpmarker create mode 100644 iguana/exchanges/DB/purgeable/BTCD/.tmpmarker create mode 100644 iguana/exchanges/SVM/.tmpmarker create mode 100644 iguana/exchanges/SVM/models/.tmpmarker create mode 100644 iguana/exchanges/SVM/rawfeatures/.tmpmarker create mode 100644 iguana/exchanges/confs/.tmpmarker create mode 100644 iguana/exchanges/genesis/.tmpmarker create mode 100644 iguana/exchanges/tmp/.tmpmarker diff --git a/iguana/exchanges/DB/.tmpmarker b/iguana/exchanges/DB/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/ECB/.tmpmarker b/iguana/exchanges/DB/ECB/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/SWAPS/.tmpmarker b/iguana/exchanges/DB/SWAPS/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/TRANSACTIONS/.tmpmarker b/iguana/exchanges/DB/TRANSACTIONS/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/purgeable/.tmpmarker b/iguana/exchanges/DB/purgeable/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/purgeable/BTC/.tmpmarker b/iguana/exchanges/DB/purgeable/BTC/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/DB/purgeable/BTCD/.tmpmarker b/iguana/exchanges/DB/purgeable/BTCD/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6cf0ebed4..f45e06535 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -207,9 +207,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, free_json(argjson); argjson = cJSON_Parse(jsonstr); printf("%02x %02x %08x decrypted.(%s)\n",decoded[0],decoded[1],crc32,jsonstr); - } - } - } else printf("cipherlen.%d\n",cipherlen); + } else printf("error null jsonstr\n"); + } else printf("error method is %s\n",method); + } else printf("error cipherlen.%d\n",cipherlen); len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { diff --git a/iguana/exchanges/SVM/.tmpmarker b/iguana/exchanges/SVM/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/SVM/models/.tmpmarker b/iguana/exchanges/SVM/models/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/SVM/rawfeatures/.tmpmarker b/iguana/exchanges/SVM/rawfeatures/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/confs/.tmpmarker b/iguana/exchanges/confs/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/genesis/.tmpmarker b/iguana/exchanges/genesis/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/exchanges/tmp/.tmpmarker b/iguana/exchanges/tmp/.tmpmarker new file mode 100644 index 000000000..e69de29bb From 9057ccbef247d4537c6dd97afef16443aefd4b5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:07:10 +0300 Subject: [PATCH 220/682] Test --- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_network.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f45e06535..2220a53cb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -148,7 +148,7 @@ char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) nonce = &ptr[2]; cipher = &ptr[2 + crypto_box_NONCEBYTES]; cipherlen = recvlen - (2 + crypto_box_NONCEBYTES); - if ( cipherlen > 0 && cipherlen < sizeof(decoded) ) + if ( cipherlen > 0 && cipherlen <= sizeof(decoded) ) { if ( (jsonstr= (char *)_SuperNET_decipher(nonce,cipher,decoded,cipherlen,GENESIS_PUBKEY,LP_mypriv25519)) != 0 ) { @@ -202,10 +202,11 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, cipherlen >>= 1; decode_hex(decoded,cipherlen,cipherstr); crc32 = calc_crc32(0,&decoded[2],cipherlen-2); - if ( (jsonstr= LP_decrypt(ptr,&recvlen)) != 0 ) + if ( (jsonstr= LP_decrypt(decoded,&cipherlen)) != 0 ) { free_json(argjson); argjson = cJSON_Parse(jsonstr); + recvlen = cipherlen; printf("%02x %02x %08x decrypted.(%s)\n",decoded[0],decoded[1],crc32,jsonstr); } else printf("error null jsonstr\n"); } else printf("error method is %s\n",method); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 6dfed1824..0f8024495 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -259,7 +259,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 msg = encoded; msglen += 2; encrypted = 1; - printf("msgstr.(%s)\n",msgstr); + //printf("msgstr.(%s)\n",msgstr); free(msgstr), msgstr = 0; } if ( encrypted == 0 ) From 9fa22dedfc72107b1c53ea0386791e2a75e0ab16 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:13:00 +0300 Subject: [PATCH 221/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 051597b3a..a9d38a167 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -71,7 +71,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else*/ if ( strcmp(method,"message") == 0 ) + else*/ if ( strcmp(method,"sendmessage") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2220a53cb..e4ee24e80 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -179,7 +179,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( duplicate == 0 ) { - LP_crc32find(&duplicate,i,crc32); + if ( i >= 0 ) + LP_crc32find(&duplicate,i,crc32); if ( encrypted != 0 ) jsonstr = LP_decrypt(ptr,&recvlen); else if ( (datalen= is_hexstr((char *)ptr,0)) > 0 ) @@ -207,7 +208,14 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, free_json(argjson); argjson = cJSON_Parse(jsonstr); recvlen = cipherlen; - printf("%02x %02x %08x decrypted.(%s)\n",decoded[0],decoded[1],crc32,jsonstr); + encrypted = 1; + if ( (crc32 & 0xff) == decoded[0] && ((crc32>>8) & 0xff) == decoded[1] ) + { + i = LP_crc32find(&duplicate,-1,crc32); + if ( duplicate == 0 && i >= 0 ) + LP_crc32find(&duplicate,i,crc32); + } + printf("%02x %02x %08x duplicate.%d decrypted.(%s)\n",decoded[0],decoded[1],crc32,duplicate,jsonstr); } else printf("error null jsonstr\n"); } else printf("error method is %s\n",method); } else printf("error cipherlen.%d\n",cipherlen); From e87a74e125355ecc7411937301237e5a9564d09b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:15:03 +0300 Subject: [PATCH 222/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e4ee24e80..6a9cbfca1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -190,11 +190,10 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, decode_hex((void *)jsonstr,datalen,(char *)ptr); jsonstr[datalen] = 0; } else jsonstr = (char *)ptr; - // "encrypted" "cipherstr" case! if ( jsonstr != 0 && (argjson= cJSON_Parse(jsonstr)) != 0 ) { uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES]; - printf("[%s]\n",jsonstr); + //printf("[%s]\n",jsonstr); cipherlen = 0; if ( (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) { From 728d8c9ca9e24dc370f850ab29c7d952657a2321 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:19:59 +0300 Subject: [PATCH 223/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6a9cbfca1..e1ff04975 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -217,7 +217,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, printf("%02x %02x %08x duplicate.%d decrypted.(%s)\n",decoded[0],decoded[1],crc32,duplicate,jsonstr); } else printf("error null jsonstr\n"); } else printf("error method is %s\n",method); - } else printf("error cipherlen.%d\n",cipherlen); + } //else printf("error cipherlen.%d\n",cipherlen); len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { From 562342d7fa98e3922407f349361f3de6db137434 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:42:34 +0300 Subject: [PATCH 224/682] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++++++----- iguana/exchanges/LP_ordermatch.c | 9 +++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e1ff04975..7661afabc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -199,12 +199,13 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { if ( (method= jstr(argjson,"method")) != 0 && strcmp(method,"encrypted") == 0 ) { + free_json(argjson); + argjson = 0; cipherlen >>= 1; decode_hex(decoded,cipherlen,cipherstr); crc32 = calc_crc32(0,&decoded[2],cipherlen-2); if ( (jsonstr= LP_decrypt(decoded,&cipherlen)) != 0 ) { - free_json(argjson); argjson = cJSON_Parse(jsonstr); recvlen = cipherlen; encrypted = 1; @@ -215,14 +216,21 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, LP_crc32find(&duplicate,i,crc32); } printf("%02x %02x %08x duplicate.%d decrypted.(%s)\n",decoded[0],decoded[1],crc32,duplicate,jsonstr); - } else printf("error null jsonstr\n"); + } + else + { + printf("packet not for this node\n"); + } } else printf("error method is %s\n",method); } //else printf("error cipherlen.%d\n",cipherlen); - len = (int32_t)strlen(jsonstr) + 1; - if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + if ( jsonstr != 0 ) { + len = (int32_t)strlen(jsonstr) + 1; + if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) + { + } + free_json(argjson); } - free_json(argjson); } } //else printf("DUPLICATE.(%s)\n",(char *)ptr); portable_mutex_unlock(&LP_commandmutex); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 009499ec0..a7a51db55 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -314,7 +314,6 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L reqjson = LP_quotejson(qp); if ( bits256_nonz(qp->desthash) != 0 ) flag = 1; - //printf("QUERY.(%s)\n",jprint(reqjson,0)); /*if ( IAMLP != 0 ) { jaddstr(reqjson,"method",method); @@ -328,8 +327,10 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L jaddbits256(reqjson,"pubkey",qp->srchash); /LP_forward(ctx,myipaddr,mypubsock,qp->srchash,jprint(reqjson,1),1); }*/ + jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); + printf("QUERY.(%s)\n",msg); LP_broadcast_message(LP_mypubsock,qp->srccoin,qp->destcoin,qp->srchash,msg); for (i=0; i<30; i++) { @@ -337,7 +338,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L { if ( flag == 0 || bits256_nonz(qp->desthash) != 0 ) { - //printf("break out of loop.%d price %.8f\n",i,price); + printf("break out of loop.%d price %.8f %s/%s\n",i,price,qp->srccoin,qp->destcoin); break; } } @@ -508,7 +509,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo *autxo,*butxo; int32_t retval = -1; struct LP_quoteinfo Q; if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) { - //printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); + printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); retval = 1; if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) { @@ -553,9 +554,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddstr(retjson,"method","forward"); /LP_forward(ctx,myipaddr,pubsock,butxo->S.otherpubkey,jprint(retjson,1),1);*/ msg = jprint(retjson,1); + printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)",butxo->T.swappending,qprice,price,msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); butxo->T.lasttime = (uint32_t)time(NULL); - printf("set swappending.%u accept qprice %.8f, min %.8f\n",butxo->T.swappending,qprice,price); } else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); } else if ( strcmp(method,"connect") == 0 ) // bob From 18b4a800be1aab14fd53a487a085e1b7e4c1f80e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:47:48 +0300 Subject: [PATCH 225/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7661afabc..7a17befaf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -221,7 +221,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { printf("packet not for this node\n"); } - } else printf("error method is %s\n",method); + } else printf("error (%s) method is %s\n",jsonstr,method); } //else printf("error cipherlen.%d\n",cipherlen); if ( jsonstr != 0 ) { From 1abb4346de0451aa8a631f62a50171eb3a8849a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 16:58:54 +0300 Subject: [PATCH 226/682] Test --- iguana/exchanges/LP_nativeDEX.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7a17befaf..6feb86da5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -167,7 +167,7 @@ char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,uint8_t *ptr,int32_t recvlen,int32_t recvsock) { static uint32_t dup,uniq; - int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; + int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*method2,*tmp,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; @@ -197,15 +197,16 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, cipherlen = 0; if ( (cipherstr= jstr(argjson,"cipher")) != 0 && (cipherlen= is_hexstr(cipherstr,0)) > 32 && cipherlen <= sizeof(decoded)*2 ) { - if ( (method= jstr(argjson,"method")) != 0 && strcmp(method,"encrypted") == 0 ) + method2 = jstr(argjson,"method2"); + if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"encrypted") == 0 ||(method2 != 0 && strcmp(method2,"encrypted") == 0)) ) { - free_json(argjson); - argjson = 0; cipherlen >>= 1; decode_hex(decoded,cipherlen,cipherstr); crc32 = calc_crc32(0,&decoded[2],cipherlen-2); - if ( (jsonstr= LP_decrypt(decoded,&cipherlen)) != 0 ) + if ( (tmp= LP_decrypt(decoded,&cipherlen)) != 0 ) { + jsonstr = tmp; + free_json(argjson); argjson = cJSON_Parse(jsonstr); recvlen = cipherlen; encrypted = 1; @@ -222,7 +223,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, printf("packet not for this node\n"); } } else printf("error (%s) method is %s\n",jsonstr,method); - } //else printf("error cipherlen.%d\n",cipherlen); + } if ( jsonstr != 0 ) { len = (int32_t)strlen(jsonstr) + 1; From d8303ddeb7d96365e38e703fc43cade01c7d6f0d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 17:20:08 +0300 Subject: [PATCH 227/682] Test --- iguana/exchanges/LP_network.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 0f8024495..7acda1a6c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -223,12 +223,13 @@ void LP_queuesend(uint32_t crc32,int32_t pubsock,char *base,char *rel,uint8_t *m // first 2 bytes == (crc32 & 0xffff) if encrypted, then nonce is next crypto_box_NONCEBYTES // GENESIS_PRIVKEY is always the sender -void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON *argjson) +void LP_broadcast_finish(int32_t pubsock,char *base,char *rel,uint8_t *msg,cJSON *argjson,uint32_t crc32) { - int32_t msglen; uint32_t crc32; + int32_t msglen; msg = (void *)jprint(argjson,0); msglen = (int32_t)strlen((char *)msg) + 1; - crc32 = calc_crc32(0,&msg[2],msglen - 2); + if ( crc32 == 0 ) + crc32 = calc_crc32(0,&msg[2],msglen - 2); if ( IAMLP == 0 ) { free(msg); @@ -275,7 +276,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); //printf("CRC32.%u (%s)\n",crc32,(char *)msg); - LP_broadcast_finish(pubsock,base,rel,msg,argjson); + LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); @@ -287,7 +288,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jaddstr(argjson,"cipher",cipherstr); jaddstr(argjson,"method2","encrypted"); jaddstr(argjson,"method","encrypted"); - LP_broadcast_finish(pubsock,base,rel,msg,argjson); + LP_broadcast_finish(pubsock,base,rel,msg,argjson,crc32); free_json(argjson); } if ( msgstr != 0 ) From 45233834b09e886d6a1dd4c168fb920377ff552d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 17:26:38 +0300 Subject: [PATCH 228/682] Test --- iguana/exchanges/LP_swap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 2c4bf5f34..d1f4a1f66 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -417,10 +417,10 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i return(retval); } -int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags) +int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags,int32_t timeout) { struct nn_pollfd pfd; int32_t i; - for (i=0; i<3000; i++) + for (i=0; i 0 ) { - if ( (sendlen= swap_nn_send(pairsock,data,datalen,0)) == datalen ) + if ( (sendlen= swap_nn_send(pairsock,data,datalen,0,timeout)) == datalen ) { printf("sent.%d after waitfor.%s\n",sendlen,statename); retval = 0; @@ -454,19 +454,19 @@ int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basi int32_t LP_sendwait(char *statename,int32_t timeout,int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen),int32_t (*datagen)(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)) { int32_t datalen,sendlen,retval = -1; - //printf("sendwait.%s\n",statename); + printf("sendwait.%s\n",statename); if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { - //printf("generated %d for %s\n",datalen,statename); - if ( (sendlen= swap_nn_send(pairsock,data,datalen,0)) == datalen ) + printf("generated %d for %s\n",datalen,statename); + if ( (sendlen= swap_nn_send(pairsock,data,datalen,0,timeout)) == datalen ) { - //printf("sendwait.%s sent %d\n",statename,sendlen); + printf("sendwait.%s sent %d\n",statename,sendlen); if ( LP_waitfor(pairsock,swap,timeout,verify) == 0 ) { //printf("waited! sendwait.%s sent %d\n",statename,sendlen); retval = 0; } else printf("didnt get %s\n",statename); - } else printf("send pubkeys error\n"); + } else printf("send %s error\n",statename); } else printf("no datagen for %s\n",statename); return(retval); } From eb2ffdece9a4881d8adf64f725526918cb00bae9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 17:39:49 +0300 Subject: [PATCH 229/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_swap.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index a9d38a167..96abba443 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -84,9 +84,9 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r if ( laststr != 0 ) free(laststr); laststr = newstr; + retstr = laststr; } } - return(0); } //else if ( strcmp(method,"nn_tests") == 0 ) // return(clonestr("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a7a51db55..b72fb28c3 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -365,7 +365,7 @@ int32_t LP_nanobind(void *ctx,char *pairstr) nanomsg_transportname(1,bindaddr,LP_myipaddr,r); if ( nn_bind(pairsock,bindaddr) >= 0 ) { - timeout = 100; + timeout = 1; nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); printf("nanobind %s to %d\n",pairstr,pairsock); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index d1f4a1f66..45c54b76e 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -435,7 +435,7 @@ int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags,i int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen),int32_t (*datagen)(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)) { int32_t datalen,sendlen,retval = -1; - printf("waitsend.%s\n",statename); + printf("waitsend.%s timeout.%d\n",statename,timeout); if ( LP_waitfor(pairsock,swap,timeout,verify) == 0 ) { printf("waited for %s\n",statename); @@ -457,7 +457,7 @@ int32_t LP_sendwait(char *statename,int32_t timeout,int32_t pairsock,struct basi printf("sendwait.%s\n",statename); if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { - printf("generated %d for %s\n",datalen,statename); + printf("generated %d for %s, timeout.%d\n",datalen,statename,timeout); if ( (sendlen= swap_nn_send(pairsock,data,datalen,0,timeout)) == datalen ) { printf("sendwait.%s sent %d\n",statename,sendlen); From 88ddd132ceaccee0bb5a1c7619f3bbde16c30545 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 17:56:47 +0300 Subject: [PATCH 230/682] Test --- iguana/exchanges/LP_ordermatch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b72fb28c3..a58b9f403 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -365,9 +365,9 @@ int32_t LP_nanobind(void *ctx,char *pairstr) nanomsg_transportname(1,bindaddr,LP_myipaddr,r); if ( nn_bind(pairsock,bindaddr) >= 0 ) { - timeout = 1; - nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); + //timeout = 1; + //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); printf("nanobind %s to %d\n",pairstr,pairsock); return(pairsock); } else printf("error binding to %s for %s\n",bindaddr,pairstr); @@ -474,9 +474,9 @@ char *LP_connectedalice(cJSON *argjson) // alice jaddstr(retjson,"error","couldnt create pairsock"); else if ( nn_connect(pairsock,pairstr) >= 0 ) { - timeout = 100; - nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); + //timeout = 1; + //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis,Q.destcoin,Q.destsatoshis,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->N.pair = pairsock; From dd750dce147b1ee9d740bfdfd1bf532856221066 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 18:07:07 +0300 Subject: [PATCH 231/682] Test --- iguana/exchanges/LP_commands.c | 2 ++ iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 96abba443..2c6c4ba1e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -283,6 +283,8 @@ trust(pubkey, trust)\n\ return(LP_numutxos()); else if ( strcmp(method,"postprice") == 0 ) retstr = LP_postedprice(argjson); + else if ( strcmp(method,"encrypted") == 0 ) + retstr = clonestr("{\"result\":\"success\"}"); //else if ( strcmp(method,"broadcast") == 0 ) // retstr = LP_broadcasted(argjson); else if ( strcmp(method,"getprices") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a58b9f403..04c0e09da 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -406,7 +406,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddstr(retjson,"pair",pairstr); jaddnum(retjson,"requestid",qp->R.requestid); jaddnum(retjson,"quoteid",qp->R.quoteid); - char str[65]; printf("BOB pubsock.%d sends to (%s)\n",pubsock,bits256_str(str,utxo->S.otherpubkey)); + char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); /*if ( pubsock >= 0 ) { msg = jprint(retjson,0); From 135ddca9e3c8df623987a50b87eea84ca1ea2e0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 18:22:46 +0300 Subject: [PATCH 232/682] Test --- iguana/exchanges/LP_commands.c | 34 -------------------------------- iguana/exchanges/LP_ordermatch.c | 9 --------- iguana/exchanges/LP_swap.c | 6 +++--- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 2c6c4ba1e..3557a70bc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -260,9 +260,6 @@ trust(pubkey, trust)\n\ jdelete(reqjson,"method"); method = jstr(reqjson,"method2"); jaddstr(reqjson,"method",method); - //jdelete(reqjson,"method2"); - //printf("BROADCASTED.(%s)\n",jprint(reqjson,0)); - //printf("BROADCASTED METHOD.%s\n",method); } argjson = reqjson; } @@ -285,44 +282,22 @@ trust(pubkey, trust)\n\ retstr = LP_postedprice(argjson); else if ( strcmp(method,"encrypted") == 0 ) retstr = clonestr("{\"result\":\"success\"}"); - //else if ( strcmp(method,"broadcast") == 0 ) - // retstr = LP_broadcasted(argjson); else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); else if ( strcmp(method,"orderbook") == 0 ) return(LP_orderbook(base,rel,jint(argjson,"duration"))); else if ( strcmp(method,"registerall") == 0 ) - { return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - //return(LP_registerall(jint(argjson,"numnodes"))); - } else if ( strcmp(method,"forward") == 0 ) - { return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - /*cJSON *reqjson; - if ( (reqjson= LP_dereference(argjson,"forward")) != 0 ) - { - //printf("FORWARDED.(%s)\n",jprint(argjson,0)); - if ( LP_forward(ctx,myipaddr,pubsock,jbits256(argjson,"pubkey"),jprint(reqjson,1),1) > 0 ) - retstr = clonestr("{\"result\":\"success\"}"); - else retstr = clonestr("{\"result\":\"error forwarding\"}"); - } else retstr = clonestr("{\"result\":\"cant recurse forwards\"}"); - return(retstr);*/ - } else if ( strcmp(method,"keepalive") == 0 ) - { return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - /*printf("got keepalive lag.%d switch.%u\n",(int32_t)time(NULL) - LP_deadman_switch,LP_deadman_switch); - LP_deadman_switch = (uint32_t)time(NULL); - return(clonestr("{\"result\":\"success\"}"));*/ - } else if ( strcmp(method,"getpeers") == 0 ) return(LP_peers()); else if ( strcmp(method,"getutxos") == 0 ) return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); else if ( strcmp(method,"utxo") == 0 ) { - //printf("UTXO.%s\n",method); if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); @@ -332,17 +307,9 @@ trust(pubkey, trust)\n\ if ( IAMLP != 0 ) { if ( strcmp(method,"register") == 0 ) - { return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - /*retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"),juint(argjson,"pushport")); - //printf("got (%s) from register\n",retstr!=0?retstr:""); - return(retstr);*/ - } else if ( strcmp(method,"lookup") == 0 ) - { return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - //return(LP_lookup(jbits256(argjson,"client"))); - } if ( strcmp(method,"broadcast") == 0 ) { bits256 zero; char *cipherstr; int32_t cipherlen; uint8_t cipher[LP_ENCRYPTED_MAXSIZE]; @@ -364,7 +331,6 @@ trust(pubkey, trust)\n\ } retstr = clonestr("{\"result\":\"success\"}"); } else retstr = clonestr("{\"error\":\"couldnt dereference sendmessage\"}"); - //retstr = LP_forwardhex(ctx,pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex")); } else if ( strcmp(method,"psock") == 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 04c0e09da..85f3e05d2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -407,15 +407,6 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ jaddnum(retjson,"requestid",qp->R.requestid); jaddnum(retjson,"quoteid",qp->R.quoteid); char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey)); - /*if ( pubsock >= 0 ) - { - msg = jprint(retjson,0); - LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); - } - jdelete(retjson,"method"); - jaddstr(retjson,"method2","connected"); - jaddstr(retjson,"method","forward"); - LP_forward(ctx,myipaddr,pubsock,utxo->S.otherpubkey,jprint(retjson,1),1);*/ msg = jprint(retjson,1); LP_broadcast_message(pubsock,base,rel,utxo->S.otherpubkey,msg); retval = 0; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 45c54b76e..e32d6e275 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -419,13 +419,13 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags,int32_t timeout) { - struct nn_pollfd pfd; int32_t i; - for (i=0; i 0 ) + //if ( nn_poll(&pfd,1,1) > 0 ) return(nn_send(sock,data,datalen,flags)); usleep(1000); } From 19f584dc58667e7af9d0236a6d3a2648f99989ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 18:28:44 +0300 Subject: [PATCH 233/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6feb86da5..21e2d095d 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -416,10 +416,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { - printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); + //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60); LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); - + } if ( (counter % 600) == 10 ) { From 72f1060be96ef4f6f018f4401d2d96128d296d01 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 18:30:00 +0300 Subject: [PATCH 234/682] Test --- iguana/exchanges/LP_nativeDEX.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 21e2d095d..db1dd5a59 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -417,9 +417,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); - LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60); - LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); - + LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,30); + //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } if ( (counter % 600) == 10 ) { From 4341e40b29ea12ad19cadf7a0504d7307b03ec3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 21:18:55 +0300 Subject: [PATCH 235/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 4d71b4df6..b29bc3aea 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -281,7 +281,7 @@ struct iguana_info *LP_coinfind(char *symbol) coin->inactive = 0; else if ( strcmp(symbol,"BTC") == 0 ) { - coin->inactive = (uint32_t)time(NULL); // * !IAMLP + coin->inactive = (uint32_t)time(NULL) * !IAMLP; printf("BTC inactive.%u\n",coin->inactive); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index db1dd5a59..8b0201795 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,8 +20,10 @@ // swap cancel should cleanly cancel // stats // auto-utxo creation +// null plocktime, robustify remember // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes +// verify BTC trading #include #include "LP_include.h" From d750b1bfc3ab42abf1984a8d5b080a1be3af8dcf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 21:45:05 +0300 Subject: [PATCH 236/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_swap.c | 32 +++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 85f3e05d2..33b80a63f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -349,7 +349,7 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L int32_t LP_nanobind(void *ctx,char *pairstr) { - int32_t i,timeout,r,pairsock = -1; uint16_t mypullport; char bindaddr[128]; + int32_t i,r,pairsock = -1; uint16_t mypullport; char bindaddr[128]; if ( LP_canbind != 0 ) { if ( (pairsock= nn_socket(AF_SP,NN_PAIR)) < 0 ) @@ -428,7 +428,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ char *LP_connectedalice(cJSON *argjson) // alice { - cJSON *retjson; double bid,ask,price,qprice; int32_t timeout,pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; + cJSON *retjson; double bid,ask,price,qprice; int32_t pairsock = -1; char *pairstr; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,*butxo; struct LP_quoteinfo Q; struct basilisk_swap *swap; struct iguana_info *coin; if ( LP_quoteparse(&Q,argjson) < 0 ) clonestr("{\"error\":\"cant parse quote\"}"); if ( bits256_cmp(Q.desthash,LP_mypub25519) != 0 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e32d6e275..e282d8cc0 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -400,18 +400,24 @@ int32_t LP_mostprivs_verify(struct basilisk_swap *swap,uint8_t *data,int32_t dat int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen)) { - void *data; int32_t datalen,retval = -1; uint32_t expiration = (uint32_t)time(NULL) + timeout; + struct nn_pollfd pfd; void *data; int32_t datalen,retval = -1; uint32_t expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) { - //printf("start wait\n"); - if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 ) + memset(&pfd,0,sizeof(pfd)); + pfd.fd = pairsock; + pfd.events = NN_POLLIN; + if ( nn_poll(&pfd,1,1) > 0 ) { - //printf("wait for got.%d\n",datalen); - retval = (*verify)(swap,data,datalen); - nn_freemsg(data); - //printf("retval.%d\n",retval); - return(retval); - } // else printf("error nn_recv\n"); + //printf("start wait\n"); + if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 ) + { + //printf("wait for got.%d\n",datalen); + retval = (*verify)(swap,data,datalen); + nn_freemsg(data); + //printf("retval.%d\n",retval); + return(retval); + } // else printf("error nn_recv\n"); + } } printf("waitfor timedout\n"); return(retval); @@ -419,13 +425,13 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags,int32_t timeout) { - struct nn_pollfd pfd; //int32_t i; - //for (i=0; i 0 ) + pfd.events = NN_POLLOUT; + if ( nn_poll(&pfd,1,1) > 0 ) return(nn_send(sock,data,datalen,flags)); usleep(1000); } From ee76bacd3f1e933a1e7beabb2843bb15846757d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 22:45:10 +0300 Subject: [PATCH 237/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3557a70bc..f9751f0fc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -99,7 +99,7 @@ enable(coin)\n\ disable(coin)\n\ inventory(coin)\n\ bestfit(rel, relvolume)\n\ -ordermatch(base, txfee=0, rel, desttxfee=0, price, txid, vout, feetxid, feevout, duration=3600)\n\ +ordermatch(base, txfee=0, rel, desttxfee=0, price, relvolume=0, txid, vout, feetxid, feevout, duration=3600)\n\ trade(price, timeout=10, duration=3600, )\n\ autotrade(base, rel, price, relvolume, timeout=10, duration=3600)\n\ swapstatus()\n\ @@ -176,7 +176,7 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"ordermatch") == 0 ) { if ( price > SMALLVAL ) - return(LP_ordermatch(base,j64bits(argjson,"txfee"),price,rel,jbits256(argjson,"txid"),jint(argjson,"vout"),jbits256(argjson,"feetxid"),jint(argjson,"feevout"),j64bits(argjson,"desttxfee"),jint(argjson,"duration"))); + return(LP_ordermatch(base,j64bits(argjson,"txfee"),price,jdouble(argjson,"relvolume"),rel,jbits256(argjson,"txid"),jint(argjson,"vout"),jbits256(argjson,"feetxid"),jint(argjson,"feevout"),j64bits(argjson,"desttxfee"),jint(argjson,"duration"))); else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"trade") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 33b80a63f..a331d8552 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -562,7 +562,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } -struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee) +struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee,uint64_t maxdestsatoshis) { int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,vout,numasks; double bestmetric=0.,metric,vol,price,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; @@ -606,6 +606,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh destsatoshis = ((butxo->S.satoshis - txfee) * price); if ( destsatoshis > autxo->payment.value-desttxfee-1 ) destsatoshis = autxo->payment.value-desttxfee-1; + if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) + destsatoshis = maxdestsatoshis-desttxfee-1; satoshis = (destsatoshis / price + 0.0000000049) - txfee; if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { @@ -657,7 +659,7 @@ char *LP_bestfit(char *rel,double relvolume) return(jprint(LP_utxojson(autxo),1)); } -char *LP_ordermatch(char *base,int64_t txfee,double maxprice,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) +char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { struct LP_quoteinfo Q; int64_t bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; if ( desttxfee == 0 && (desttxfee= LP_getestimatedrate(rel) * LP_AVETXSIZE) < LP_MIN_TXFEE ) @@ -666,7 +668,7 @@ char *LP_ordermatch(char *base,int64_t txfee,double maxprice,char *rel,bits256 t txfee = LP_MIN_TXFEE; if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); @@ -747,7 +749,7 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *r desttxfee = LP_MIN_TXFEE; if ( (txfee= LP_getestimatedrate(base) * LP_AVETXSIZE) < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); From 63a8da4b7e5b27c9e9eeec0155c40e2ba117f51f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jul 2017 23:49:11 +0300 Subject: [PATCH 238/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_swap.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8b0201795..bf0591e44 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,9 +21,10 @@ // stats // auto-utxo creation // null plocktime, robustify remember +// verify BTC trading: 0 txfee on remember trades. even with invalid tx, thinks swap is completed RETSTR.({"result":null,"error":{"code":-26,"message":"66: insufficient priority"},"id":"jl777"} +//) BTC.0000000000000000000000000000000000000000000000000000000000000000 // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes -// verify BTC trading #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e282d8cc0..7e7726c1c 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -801,7 +801,11 @@ void LP_aliceloop(void *_swap) free(swap); } free(data); - nn_close(swap->N.pair); + if ( swap->N.pair >= 0 ) + { + nn_close(swap->N.pair); + swap->N.pair = -1; + } } bits256 instantdex_derivekeypair(void *ctx,bits256 *newprivp,uint8_t pubkey[33],bits256 privkey,bits256 orderhash) From dcdc5f50c44a9699fd880560c435ed953e941bd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 11:03:10 +0300 Subject: [PATCH 239/682] Test --- iguana/exchanges/LP_coins.c | 3 ++- iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index b29bc3aea..68b1b2ecd 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -317,7 +317,8 @@ struct iguana_info *LP_coincreate(cJSON *item) coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); } else coin = LP_coinadd(&cdata); - } + } else if ( symbol != 0 && jobj(item,"rpcport") == 0 ) + printf("SKIP %s, missing rpcport field in coins array\n",symbol); if ( coin != 0 && item != 0 ) { if ( strcmp("KMD",coin->symbol) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bf0591e44..838701fee 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -25,6 +25,7 @@ //) BTC.0000000000000000000000000000000000000000000000000000000000000000 // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes +// getmessage api #include #include "LP_include.h" From 833e2d1d56b7c28a8e6875520ae31779af9d09fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 16:58:24 +0300 Subject: [PATCH 240/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 +++ iguana/exchanges/coins | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 68b1b2ecd..c558b4725 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -18,7 +18,7 @@ // marketmaker // -char *portstrs[][3] = { { "BTC", "8332" }, { "KMD", "7771", "7772" } }; +char *portstrs[][3] = { { "BTC", "8332" }, { "KMD", "7771" } }; uint16_t LP_rpcport(char *symbol) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 838701fee..90c9ce218 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,9 +20,12 @@ // swap cancel should cleanly cancel // stats // auto-utxo creation + // null plocktime, robustify remember +// false detection of bobreclaim // verify BTC trading: 0 txfee on remember trades. even with invalid tx, thinks swap is completed RETSTR.({"result":null,"error":{"code":-26,"message":"66: insufficient priority"},"id":"jl777"} //) BTC.0000000000000000000000000000000000000000000000000000000000000000 + // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes // getmessage api diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 225cc88e9..b15117317 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,3 +1,2 @@ -export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" -#, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 36ad81c0609970aa475207a1bef9b0ab222df060 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 17:02:08 +0300 Subject: [PATCH 241/682] Test --- iguana/exchanges/LP_coins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index c558b4725..48aecd208 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -140,7 +140,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name) { - FILE *fp; char fname[512],username[512],password[512],confname[16]; + FILE *fp; char fname[512],username[512],password[512],confname[512]; userpass[0] = 0; sprintf(confname,"%s.conf",confroot); #ifdef __APPLE__ From fe4cc152f000128180a9c19f22115af2533cf1ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 17:04:58 +0300 Subject: [PATCH 242/682] Test --- iguana/exchanges/LP_coins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 48aecd208..b82d558cc 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -143,6 +143,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c FILE *fp; char fname[512],username[512],password[512],confname[512]; userpass[0] = 0; sprintf(confname,"%s.conf",confroot); + printf("%s (%s) %s confname.(%s) confroot.(%s)\n",symbol,assetname,name,confname,confroot); #ifdef __APPLE__ int32_t len; confname[0] = toupper(confname[0]); From 42368ed5121f159bed6a321a2071e6260face095 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 17:37:52 +0300 Subject: [PATCH 243/682] Test --- iguana/exchanges/LP_coins.c | 5 +++-- iguana/exchanges/LP_remember.c | 19 ++++++++++++------- iguana/exchanges/LP_transaction.c | 14 ++++++++++++-- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index b82d558cc..95844ddd3 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -143,7 +143,8 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c FILE *fp; char fname[512],username[512],password[512],confname[512]; userpass[0] = 0; sprintf(confname,"%s.conf",confroot); - printf("%s (%s) %s confname.(%s) confroot.(%s)\n",symbol,assetname,name,confname,confroot); + if ( 0 ) + printf("%s (%s) %s confname.(%s) confroot.(%s)\n",symbol,assetname,name,confname,confroot); #ifdef __APPLE__ int32_t len; confname[0] = toupper(confname[0]); @@ -157,7 +158,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c LP_userpassfp(symbol,username,password,fp); sprintf(userpass,"%s:%s",username,password); fclose(fp); - if ( 0 && strcmp(symbol,"HUSH") == 0 ) + if ( 0 ) printf("LP_statefname.(%s) <- %s %s %s (%s)\n",fname,name,symbol,assetname,userpass); return((int32_t)strlen(userpass)); } else printf("cant open.(%s)\n",fname); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 8f93bbc9b..0a51456da 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -368,7 +368,7 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t txfee = 10000; + FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee,Btxfee; if ( ctx == 0 ) ctx = bitcoin_ctx(); bobpaymentaddr[0] = bobdepositaddr[0] = alicepaymentaddr[0] = 0; @@ -566,6 +566,11 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Adest = Bdest = AAdest = ABdest = 0; if ( bobcoin[0] == 0 || alicecoin[0] == 0 ) return(0); + if ( (Atxfee= LP_getestimatedrate(alicecoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + Atxfee = LP_MIN_TXFEE; + if ( (Btxfee= LP_getestimatedrate(bobcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + Btxfee = LP_MIN_TXFEE; + printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); if ( finishedflag == 0 && bobcoin[0] != 0 && alicecoin[0] != 0 ) @@ -636,7 +641,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } for (j=0; j<32; j++) rev.bytes[j] = myprivs[0].bytes[31 - j]; - if ( (txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,txfee,"alicespend",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,1,expiration,&values[BASILISK_ALICESPEND],0,0,bobpaymentaddr,1)) != 0 ) + if ( (txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"alicespend",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,1,expiration,&values[BASILISK_ALICESPEND],0,0,bobpaymentaddr,1)) != 0 ) printf("alicespend.(%s)\n",txbytes[BASILISK_ALICESPEND]); } } @@ -661,7 +666,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,txfee,"aliceclaim",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,0,expiration,&values[BASILISK_ALICECLAIM],0,0,bobdepositaddr,1)) != 0 ) + if ( (txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"aliceclaim",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,0,expiration,&values[BASILISK_ALICECLAIM],0,0,bobdepositaddr,1)) != 0 ) printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICECLAIM]); } } @@ -683,7 +688,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti privBn = basilisk_swap_privBn_extract(&txids[BASILISK_BOBREFUND],bobcoin,txids[BASILISK_BOBDEPOSIT],privBn); if ( bits256_nonz(txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) { - if ( (txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",alicecoin,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_ALICERECLAIM],alicepaymentaddr)) != 0 ) + if ( (txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",alicecoin,Atxfee,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_ALICERECLAIM],alicepaymentaddr)) != 0 ) printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICERECLAIM]); } } @@ -713,7 +718,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) { - if ( (txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",alicecoin,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_BOBSPEND],alicepaymentaddr)) != 0 ) + if ( (txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",alicecoin,Atxfee,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_BOBSPEND],alicepaymentaddr)) != 0 ) printf("bobspend.(%s)\n",txbytes[BASILISK_BOBSPEND]); } } @@ -737,7 +742,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,myprivs[1],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,txfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[1],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,0,expiration,&values[BASILISK_BOBRECLAIM],0,0,bobpaymentaddr,1)) != 0 ) + if ( (txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[1],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,0,expiration,&values[BASILISK_BOBRECLAIM],0,0,bobpaymentaddr,1)) != 0 ) { int32_t z; for (z=0; z<20; z++) @@ -767,7 +772,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti vcalc_sha256(0,secretBn256,privBn.bytes,sizeof(privBn)); redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,privBn,secretAm,secretAm256,secretBn,secretBn256); len = basilisk_swapuserdata(userdata,privBn,0,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,txfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,1,expiration,&values[BASILISK_BOBREFUND],0,0,bobdepositaddr,1)) != 0 ) + if ( (txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,1,expiration,&values[BASILISK_BOBREFUND],0,0,bobdepositaddr,1)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,pubB1),txbytes[BASILISK_BOBREFUND]); } if ( txbytes[BASILISK_BOBREFUND] != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 529e279a3..a81e469fe 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -551,6 +551,11 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch } else if ( value > txfee ) satoshis = value - txfee; else printf("unexpected small value %.8f vs txfee %.8f\n",dstr(value),dstr(txfee)); + if ( value < satoshis+txfee ) + { + printf("utxo %.8f too small for %.8f + %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); + return(0); + } if ( destamountp != 0 ) *destamountp = satoshis; timestamp = (uint32_t)time(NULL); @@ -740,7 +745,7 @@ int32_t basilisk_alicescript(uint8_t *redeemscript,int32_t *redeemlenp,uint8_t * return(n); } -char *basilisk_swap_Aspend(char *name,char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t vout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) +char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t vout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) { char msigaddr[64],*signedtx = 0; int32_t spendlen,redeemlen; uint8_t tmp33[33],redeemscript[512],spendscript[128]; bits256 pubAm,pubBn,signedtxid; uint64_t txfee; if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) @@ -758,7 +763,12 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint8_t taddr,uint8_t pubtype rev = privBn; for (i=0; i<32; i++) privBn.bytes[i] = rev.bytes[31 - i];*/ - txfee = LP_txfee(symbol); + if ( (txfee= Atxfee) == 0 ) + { + if ( (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + txfee = LP_MIN_TXFEE; + } + //txfee = LP_txfee(symbol); signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,vout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); } return(signedtx); From cf1d133d6a5254db8313e6f4fa2f6044fe847f58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 18:30:49 +0300 Subject: [PATCH 244/682] test --- iguana/exchanges/LP_remember.c | 35 ++++++++++++++++++++++++++++--- iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 0a51456da..3a35ffdf5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -365,6 +365,33 @@ int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflag return(0); } +uint32_t LP_extract(uint32_t requestid,uint32_t quoteid,char *rootfname,char *field) +{ + char fname[1024],*filestr,*redeemstr; long fsize; int32_t len; uint32_t t=0; cJSON *json; uint8_t redeem[1024]; + if ( strcmp(field,"dlocktime") == 0 ) + sprintf(fname,"%s.bobdeposit",rootfname); + else if ( strcmp(field,"plocktime") == 0 ) + sprintf(fname,"%s.bobpayment",rootfname); + if ( (filestr= OS_filestr(&fsize,fname)) != 0 ) + { + if ( (json= cJSON_Parse(filestr)) != 0 ) + { + if ( (redeemstr= jstr(json,"redeem")) != 0 && (len= (int32_t)strlen(redeemstr)) <= sizeof(redeem)*2 ) + { + len >>= 1; + decode_hex(redeem,len,redeemstr); + t = redeem[5]; + t = (t << 8) | redeem[4]; + t = (t << 8) | redeem[3]; + t = (t << 8) | redeem[2]; + printf("extracted timestamp.%u\n",t); + } + } + free(filestr); + } + return(t); +} + cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; @@ -410,8 +437,10 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti // printf("%02x",pubkey33[i]); //printf(" <- %s dest33\n",dest33); } - plocktime = juint(item,"plocktime"); - dlocktime = juint(item,"dlocktime"); + if ( (plocktime= juint(item,"plocktime")) == 0 ) + plocktime = LP_extract(requestid,quoteid,fname,"plocktime"); + if ( (dlocktime= juint(item,"dlocktime")) == 0 ) + dlocktime = LP_extract(requestid,quoteid,fname,"dlocktime"); r = juint(item,"requestid"); q = juint(item,"quoteid"); pubA0 = jbits256(item,"pubA0"); @@ -570,7 +599,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Atxfee = LP_MIN_TXFEE; if ( (Btxfee= LP_getestimatedrate(bobcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) Btxfee = LP_MIN_TXFEE; - printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); + //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); if ( finishedflag == 0 && bobcoin[0] != 0 && alicecoin[0] != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a81e469fe..e11439684 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1367,12 +1367,12 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da swap->aliceclaim.utxotxid = swap->bobdeposit.I.signedtxid = LP_broadcast_tx(swap->bobdeposit.name,swap->bobcoin.symbol,swap->bobdeposit.txbytes,swap->bobdeposit.I.datalen); if ( bits256_nonz(swap->bobdeposit.I.signedtxid) != 0 ) swap->depositunconf = 1; - basilisk_dontforget_update(swap,&swap->bobdeposit); len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); memcpy(swap->I.userdata_aliceclaim,userdata,len); swap->I.userdata_aliceclaimlen = len; bitcoin_address(swap->bobdeposit.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); strcpy(swap->bobdeposit.I.destaddr,swap->bobdeposit.p2shaddr); + basilisk_dontforget_update(swap,&swap->bobdeposit); //LP_importaddress(swap->bobcoin.symbol,swap->bobdeposit.I.destaddr); /*for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); @@ -1431,12 +1431,12 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da swap->alicespend.utxotxid = swap->bobpayment.I.signedtxid = LP_broadcast_tx(swap->bobpayment.name,swap->bobpayment.coin->symbol,swap->bobpayment.txbytes,swap->bobpayment.I.datalen); if ( bits256_nonz(swap->bobpayment.I.signedtxid) != 0 ) swap->paymentunconf = 1; - basilisk_dontforget_update(swap,&swap->bobpayment); for (i=0; i<32; i++) revAm.bytes[i] = swap->I.privAm.bytes[31-i]; len = basilisk_swapuserdata(userdata,revAm,0,swap->I.myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); bitcoin_address(swap->bobpayment.p2shaddr,swap->bobcoin.taddr,swap->bobcoin.p2shtype,swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); strcpy(swap->bobpayment.I.destaddr,swap->bobpayment.p2shaddr); + basilisk_dontforget_update(swap,&swap->bobpayment); //LP_importaddress(swap->bobcoin.symbol,swap->bobpayment.I.destaddr); /*for (i=0; ibobpayment.I.datalen; i++) printf("%02x",swap->bobpayment.txbytes[i]); From 21b57604f583a19d13fe5e426ffcf7fa824e28b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 18:42:09 +0300 Subject: [PATCH 245/682] Test --- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 3a35ffdf5..0372cff88 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -384,7 +384,7 @@ uint32_t LP_extract(uint32_t requestid,uint32_t quoteid,char *rootfname,char *fi t = (t << 8) | redeem[4]; t = (t << 8) | redeem[3]; t = (t << 8) | redeem[2]; - printf("extracted timestamp.%u\n",t); + //printf("extracted timestamp.%u\n",t); } } free(filestr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0725c97ed..57f712f50 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -313,7 +313,7 @@ double LP_getestimatedrate(char *symbol) if ( retstr[0] != '-' ) { coin->estimatedrate = rate = atof(retstr) / 1024.; - printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); + //printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); } free(retstr); } From 36904d2262e9f4b40ab75de3d40ddd62998a72bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:20:45 +0300 Subject: [PATCH 246/682] Test --- iguana/exchanges/LP_nativeDEX.c | 12 +++++++----- iguana/exchanges/LP_transaction.c | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 90c9ce218..43eb4f999 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,15 +20,17 @@ // swap cancel should cleanly cancel // stats // auto-utxo creation +// getmessage api -// null plocktime, robustify remember +// robustify remember // false detection of bobreclaim -// verify BTC trading: 0 txfee on remember trades. even with invalid tx, thinks swap is completed RETSTR.({"result":null,"error":{"code":-26,"message":"66: insufficient priority"},"id":"jl777"} +// put Atxfee and Btxfee into rememberfiles +// coded fix: even with invalid tx, thinks swap is completed RETSTR.({"result":null,"error":{"code":-26,"message":"66: insufficient priority"},"id":"jl777"} //) BTC.0000000000000000000000000000000000000000000000000000000000000000 +// unduplicated bugs: // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes -// getmessage api #include #include "LP_include.h" @@ -423,11 +425,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { - //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); + printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,30); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } - if ( (counter % 600) == 10 ) + if ( (counter % 6000) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase); /*if ( lastforward < now-3600 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index e11439684..b066bc138 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -30,7 +30,8 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi if ( is_hexstr(retstr,0) == 64 ) { decode_hex(txid.bytes,32,retstr); - sentflag = 1; + if ( bits256_cmp(txid,expectedtxid) == 0 || (bits256_nonz(expectedtxid) == 0 && bits256_nonz(txid) != 0) ) + sentflag = 1; } else if ( (retjson= cJSON_Parse(retstr)) != 0 ) { @@ -44,7 +45,7 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi } free_json(retjson); } - char str[65]; printf("[%s] %s RETSTR.(%s) %s.%s\n",txname,txbytes,retstr,symbol,bits256_str(str,txid)); + char str[65]; printf("sentflag.%d [%s] %s RETSTR.(%s) %s.%s\n",sentflag,txname,txbytes,retstr,symbol,bits256_str(str,txid)); free(retstr); } if ( sentflag != 0 ) From a8cf12bc2044603de76131bca36056bbbfda0bc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:23:15 +0300 Subject: [PATCH 247/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 507c12ab6..d9f8677e9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -526,7 +526,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); return(0); } - //if ( dispflag != 0 ) + if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) From d8380770ed0acc4624671c16837cdf841250d213 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:32:38 +0300 Subject: [PATCH 248/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_utxos.c | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 43eb4f999..d44584f25 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,6 +21,7 @@ // stats // auto-utxo creation // getmessage api +// support coins LP node doesnt have // robustify remember // false detection of bobreclaim diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d9f8677e9..d7f935f7b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -507,7 +507,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); return(0); } - if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) + if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) return(0); if ( iambob != 0 && value2 < 9 * (value >> 3) + bigtxfee ) // big txfee padding { @@ -604,11 +604,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit { if ( LP_mypeer != 0 ) LP_mypeer->numutxos++; - /*if ( mypubsock >= 0 ) - { - msg = jprint(LP_utxojson(utxo),1); - /LP_send(mypubsock,msg,(int32_t)strlen(msg)+1,1); - } else LP_utxo_clientpublish(utxo);*/ if ( LP_ismine(utxo) > 0 ) { LP_utxo_clientpublish(utxo); From 3cefe5ec01a25b38cbbe2d9f4b2536c46b840888 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:44:39 +0300 Subject: [PATCH 249/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f9751f0fc..55a3800f4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -266,7 +266,7 @@ trust(pubkey, trust)\n\ } if ( LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); - else if ( LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) + else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) retstr = clonestr("{\"result\":\"coin is disabled\"}"); else if ( strcmp(method,"reserved") == 0 ) retstr = LP_quotereceived(argjson); From 65505e2778b5a35d088595ebd1b52d776e933a29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:46:37 +0300 Subject: [PATCH 250/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 55a3800f4..34105ae2a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -149,7 +149,7 @@ trust(pubkey, trust)\n\ if ( base != 0 && rel != 0 ) { double price,bid,ask; - if ( LP_isdisabled(base,rel) != 0 ) + if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"error\":\"at least one of coins disabled\"}")); price = jdouble(argjson,"price"); if ( strcmp(method,"setprice") == 0 ) @@ -264,7 +264,7 @@ trust(pubkey, trust)\n\ argjson = reqjson; } } - if ( LP_isdisabled(base,rel) != 0 ) + if ( IAMLP == 0 && LP_isdisabled(base,rel) != 0 ) return(clonestr("{\"result\":\"at least one of coins disabled\"}")); else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 ) retstr = clonestr("{\"result\":\"coin is disabled\"}"); From b2d2de2906cd43759f7bb95ac83296c5a495b0b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:49:56 +0300 Subject: [PATCH 251/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index a331d8552..e3d0df640 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -206,7 +206,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ce0146e67..8574440fc 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -638,6 +638,7 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; char str[65]; + printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { printf("PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); From 3f77e023e9eaa820de343ae5f973a099f1db81ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 20:52:58 +0300 Subject: [PATCH 252/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 34105ae2a..6d842f546 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; - //printf("stats_JSON(%s)\n",jprint(argjson,0)); +printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) From 1c13cffa04b6bf308d9020ecbfc2f413e4646a32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:00:53 +0300 Subject: [PATCH 253/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6d842f546..0e222c5c9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -251,7 +251,7 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"trust") == 0 ) return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); } - if ( IAMLP == 0 ) + //if ( IAMLP == 0 ) { if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { From f2b46b041186e486e5218f0a0c282d07a96a655d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:08:52 +0300 Subject: [PATCH 254/682] Test --- iguana/exchanges/LP_utxos.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index d7f935f7b..9bc58c1b4 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -288,16 +288,24 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,threshold=0; int32_t iter; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; + uint64_t val,val2=0,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; - if ( (val= LP_txvalue(destaddr,symbol,txid,vout)) >= satoshis ) + if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) + bypass = 1; + if ( bypass != 0 ) + val = satoshis; + else val = LP_txvalue(destaddr,symbol,txid,vout); + if ( val >= satoshis ) { threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : LP_DEXFEE(satoshis); - if ( (val2= LP_txvalue(destaddr2,symbol,txid2,vout2)) >= threshold ) + if ( bypass != 0 ) + val2 = threshold; + else val2 = LP_txvalue(destaddr2,symbol,txid2,vout2); + if ( val2 >= threshold ) { - if ( strcmp(destaddr,destaddr2) != 0 ) + if ( bypass == 0 && strcmp(destaddr,destaddr2) != 0 ) printf("mismatched %s destaddr (%s) vs (%s)\n",symbol,destaddr,destaddr2); - else if ( (iambob == 0 && val2 > val) || (iambob != 0 && val2 <= satoshis) ) + else if ( bypass == 0 && ((iambob == 0 && val2 > val) || (iambob != 0 && val2 <= satoshis)) ) printf("iambob.%d ineligible due to offsides: val %.8f and val2 %.8f vs %.8f diff %lld\n",iambob,dstr(val),dstr(val2),dstr(satoshis),(long long)(val2 - val)); else { From 978ee89ea5885a8ba8510d4a880c4412790e8c1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:21:43 +0300 Subject: [PATCH 255/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0e222c5c9..6d842f546 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -251,7 +251,7 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"trust") == 0 ) return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust"))); } - //if ( IAMLP == 0 ) + if ( IAMLP == 0 ) { if ( (reqjson= LP_dereference(argjson,"broadcast")) != 0 ) { From dd48e038edbe538c05e32838567cab642bf05868 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:23:59 +0300 Subject: [PATCH 256/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6d842f546..de86660f4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -35,7 +35,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; -printf("stats_JSON(%s)\n",jprint(argjson,0)); +//printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9bc58c1b4..9dac77905 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -602,7 +602,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit if ( LP_ismine(utxo) > 0 ) utxo->T.sessionid = LP_sessionid; else utxo->T.sessionid = sessionid; - printf("U.%d addutxo.%d pubkey.%s session.%u\n",LP_mypeer!=0?LP_mypeer->numutxos:-1,LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); + printf("U.%d %s %.8f %.8f addutxo.%d pubkey.%s session.%u\n",LP_mypeer!=0?LP_mypeer->numutxos:-1,symbol,dstr(value),dstr(value2),LP_ismine(utxo) > 0,bits256_str(str,utxo->pubkey),utxo->T.sessionid); portable_mutex_lock(&LP_utxomutex); HASH_ADD_KEYPTR(hh,LP_utxoinfos[iambob],utxo->key,sizeof(utxo->key),utxo); if ( _LP_utxo2find(iambob,txid2,vout2) == 0 ) From 3ba066affe8550c5b966089045137385f68d0a5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:31:06 +0300 Subject: [PATCH 257/682] Test --- iguana/exchanges/LP_nativeDEX.c | 8 ++++---- iguana/exchanges/LP_utxos.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d44584f25..fe11b13c1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -279,7 +279,7 @@ void LP_myutxo_updates(void *ctx,int32_t pubsock,char *passphrase) LP_privkey_updates(ctx,pubsock,passphrase,0); } -int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,int32_t interval) +int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,int32_t interval,int32_t maxentries) { int32_t lastn,n = -1; if ( peer->lastutxos < now-interval ) @@ -291,7 +291,7 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu { peer->lastutxos = now; //printf("query utxos from %s\n",peer->ipaddr); - n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport); + n = LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,maxentries); } } //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos); return(n); @@ -412,7 +412,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( lastn != n || n < 20 ) { lastn = n; - n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,60); + n = LP_peer_utxosquery(mypeer,myport,pubsock,peer,now,60,100); } LP_peer_pricesquery(peer->ipaddr,peer->port); peer->diduquery = now; @@ -427,7 +427,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); - LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,30); + LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } if ( (counter % 6000) == 10 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9dac77905..efd21ea07 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -680,7 +680,7 @@ int32_t LP_utxosparse(char *destipaddr,uint16_t destport,char *retstr,uint32_t n return(n); } -int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport) +int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *coin,int32_t lastn,char *myipaddr,uint16_t myport,int32_t maxentries) { char *retstr; struct LP_peerinfo *peer; uint32_t now; int32_t retval = -1; peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); @@ -688,8 +688,8 @@ int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa coin = ""; //printf("utxo query.(%s)\n",destipaddr); if ( IAMLP != 0 ) - retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0); - else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,100); + retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,mypeer != 0 ? mypeer->numpeers : 0,maxentries); + else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,maxentries); if ( retstr != 0 ) { now = (uint32_t)time(NULL); From ecde5347b391727f4a2d6c46f0e5412f22f95a4c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:42:12 +0300 Subject: [PATCH 258/682] Test --- iguana/exchanges/LP_include.h | 2 ++ iguana/exchanges/LP_peers.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a8566530a..415e89a71 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,6 +21,8 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H +//#define LP_STRICTPEERS + #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 4828f6153..5e7a26cc3 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -57,8 +57,10 @@ char *LP_peers() struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char *ipaddr,uint16_t port,uint16_t pushport,uint16_t subport,int32_t numpeers,int32_t numutxos,uint32_t sessionid) { uint32_t ipbits; int32_t pushsock,subsock,timeout; char checkip[64],pushaddr[64],subaddr[64]; struct LP_peerinfo *peer = 0; -if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) - return(0); +#ifdef LP_STRICTPEERS + if ( strncmp("5.9.253",ipaddr,strlen("5.9.253")) != 0 ) + return(0); +#endif ipbits = (uint32_t)calc_ipbits(ipaddr); expand_ipbits(checkip,ipbits); if ( strcmp(checkip,ipaddr) == 0 ) From 876ea280cdb7506e363a679c6b2695f939ac9bb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 21:53:40 +0300 Subject: [PATCH 259/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fe11b13c1..180138972 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -254,7 +254,9 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo) { - struct _LP_utxoinfo u; char str[65]; uint32_t now = (uint32_t)time(NULL); + struct _LP_utxoinfo u; struct iguana_info *coin; char str[65]; uint32_t now = (uint32_t)time(NULL); + if ( IAMLP != 0 && (coin= LP_coinfind(utxo->coin)) != 0 && coin->inactive != 0 ) + return; //printf("%s lag.%d\n",bits256_str(str,utxo->txid),now-utxo->lastspentcheck); if ( utxo->T.spentflag == 0 && now > utxo->T.lastspentcheck+60 ) { From 527ffb06787e9b022ceeab33c25967a2354d90e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 22:23:56 +0300 Subject: [PATCH 260/682] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_ordermatch.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 180138972..bd5ef8de8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,7 +21,6 @@ // stats // auto-utxo creation // getmessage api -// support coins LP node doesnt have // robustify remember // false detection of bobreclaim diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e3d0df640..51c37b5d2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -394,7 +394,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ { if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) { - LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis,rel,qp->destsatoshis,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); swap = LP_swapinit(1,0,privkey,&qp->R,qp); swap->N.pair = pair; utxo->S.swap = swap; @@ -468,7 +468,7 @@ char *LP_connectedalice(cJSON *argjson) // alice //timeout = 1; //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); //nn_setsockopt(pairsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); - LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis,Q.destcoin,Q.destsatoshis,Q.timestamp,Q.quotetime,DEXselector); + LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector); swap = LP_swapinit(0,0,Q.privkey,&Q.R,&Q); swap->N.pair = pairsock; autxo->S.swap = swap; @@ -697,7 +697,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q if ( price <= maxprice ) { price = LP_query(ctx,myipaddr,mypubsock,"connect",qp); - LP_requestinit(&qp->R,qp->srchash,qp->desthash,bobutxo->coin,qp->satoshis,qp->destcoin,qp->destsatoshis,qp->timestamp,qp->quotetime,DEXselector); + LP_requestinit(&qp->R,qp->srchash,qp->desthash,bobutxo->coin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); expiration = (uint32_t)time(NULL) + timeout; while ( time(NULL) < expiration ) { From 46ce29341d81fd8bbcb5ca047a693c8f4049310a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 22:32:16 +0300 Subject: [PATCH 261/682] Test --- iguana/exchanges/LP_transaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b066bc138..d21b8fa36 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -555,7 +555,9 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch if ( value < satoshis+txfee ) { printf("utxo %.8f too small for %.8f + %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); - return(0); + if ( value == satoshis ) + satoshis -= txfee; + else return(0); } if ( destamountp != 0 ) *destamountp = satoshis; From 0bd75991430afd6a608901c30ec9608c8208f821 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 22:43:44 +0300 Subject: [PATCH 262/682] Test --- iguana/exchanges/LP_transaction.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d21b8fa36..286eaf9e3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -546,19 +546,25 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch #endif if ( satoshis != 0 ) { + if ( value < satoshis+txfee ) + { + if ( value == satoshis ) + { + printf("reduce satoshis by txfee %.8f\n",dstr(txfee)); + satoshis -= txfee; + } + else + { + printf("utxo %.8f too small for %.8f + %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); + return(0); + } + } if ( value > satoshis+txfee ) change = value - (satoshis + txfee); printf("utxo %.8f, destamount %.8f change %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(change),dstr(txfee)); } else if ( value > txfee ) satoshis = value - txfee; else printf("unexpected small value %.8f vs txfee %.8f\n",dstr(value),dstr(txfee)); - if ( value < satoshis+txfee ) - { - printf("utxo %.8f too small for %.8f + %.8f\n",dstr(value),dstr(satoshis),dstr(txfee)); - if ( value == satoshis ) - satoshis -= txfee; - else return(0); - } if ( destamountp != 0 ) *destamountp = satoshis; timestamp = (uint32_t)time(NULL); From 415477886ab373e3eeb6de52dbbceb670afd6cfb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 22:49:28 +0300 Subject: [PATCH 263/682] Test --- iguana/exchanges/LP_transaction.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 286eaf9e3..45e96ec9e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -565,6 +565,11 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch } else if ( value > txfee ) satoshis = value - txfee; else printf("unexpected small value %.8f vs txfee %.8f\n",dstr(value),dstr(txfee)); + if ( change < 6000 ) + { + satoshis += change; + change = 0; + } if ( destamountp != 0 ) *destamountp = satoshis; timestamp = (uint32_t)time(NULL); From 6f22d4a0052fddd5d2b36178cc619f958d6c0a2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 23:08:03 +0300 Subject: [PATCH 264/682] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_swap.c | 11 +++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 415e89a71..5926f99b8 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -149,7 +149,7 @@ struct basilisk_swapinfo bits256 myhash,otherhash,orderhash; uint32_t statebits,otherstatebits,started,expiration,finished,dead,reftime,putduration,callduration; int32_t bobconfirms,aliceconfirms,iambob,reclaimed,bobspent,alicespent,pad; - uint64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance; + uint64_t alicesatoshis,bobsatoshis,bobinsurance,aliceinsurance,Atxfee,Btxfee; bits256 myprivs[2],mypubs[2],otherpubs[2],pubA0,pubA1,pubB0,pubB1,privAm,pubAm,privBn,pubBn; uint32_t crcs_mypub[2],crcs_mychoosei[2],crcs_myprivs[2],crcs_mypriv[2]; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bd5ef8de8..e481b3fc2 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -359,7 +359,7 @@ void command_rpcloop(void *myipaddr) int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport,char *passphrase) { - static uint32_t counter,numpeers; //lastforward + static uint32_t counter,numpeers,lastresync; //lastforward struct LP_utxoinfo *utxo,*utmp; cJSON *retjson; struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp,*mostpeer; uint32_t id,now; int32_t mostutxos,nonz = 0,n=0,num,lastn=-1; now = (uint32_t)time(NULL); if ( (origipaddr= myipaddr) == 0 ) @@ -425,10 +425,11 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 ) + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+60 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); + lastresync = (uint32_t)time(NULL); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); } if ( (counter % 6000) == 10 ) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 7e7726c1c..543b3e99a 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -510,7 +510,7 @@ struct basilisk_rawtx *LP_swapdata_rawtx(struct basilisk_swap *swap,uint8_t *dat int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct basilisk_rawtx *rawtx,int32_t v,uint8_t *recvbuf,int32_t recvlen,int32_t suppress_pubkeys) { - bits256 otherhash,myhash,txid; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; + bits256 otherhash,myhash,txid; int64_t txfee; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; for (i=0; i<32; i++) otherhash.bytes[i] = recvbuf[offset++]; for (i=0; i<32; i++) @@ -570,7 +570,12 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( (vouts= jarray(&n,txobj,"vout")) != 0 && v < n ) { vout = jitem(vouts,v); - if ( j64bits(vout,"satoshis") == rawtx->I.amount && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( strcmp(rawtx->coin->symbol,swap->bobcoin.symbol) == 0 ) + txfee = swap->I.Btxfee; + else if ( strcmp(rawtx->coin->symbol,swap->alicecoin.symbol) == 0 ) + txfee = swap->I.Atxfee; + else txfee = 10000; + if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { @@ -923,6 +928,8 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 { //FILE *fp; char fname[512]; uint8_t *alicepub33=0,*bobpub33=0; int32_t bobistrusted,aliceistrusted,jumblrflag=-2,x = -1; struct iguana_info *coin; + swap->I.Atxfee = qp->desttxfee; + swap->I.Btxfee = qp->txfee; swap->I.putduration = swap->I.callduration = INSTANTDEX_LOCKTIME; if ( optionduration < 0 ) swap->I.putduration -= optionduration; From 3d3edbbbb81386a85e578fe79a42a029ce566592 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 23:39:06 +0300 Subject: [PATCH 265/682] Test --- iguana/exchanges/LP_transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 45e96ec9e..a2450b7f7 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -548,10 +548,10 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { if ( value < satoshis+txfee ) { - if ( value == satoshis ) + if ( satoshis > value-txfee/2 ) { - printf("reduce satoshis by txfee %.8f\n",dstr(txfee)); - satoshis -= txfee; + satoshis = value - txfee; + printf("reduce satoshis by txfee %.8f to %.8f\n",dstr(txfee),dstr(satoshis)); } else { From e32c8348c7e3e59b0ae514239395aa5e56e07e85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jul 2017 23:48:06 +0300 Subject: [PATCH 266/682] VRT vertcoin --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index b15117317..50375d051 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From b6462af3823f95e7b8092e755f5ad61084ade2cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jul 2017 02:08:42 +0300 Subject: [PATCH 267/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index de86660f4..f15df7e9a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -84,7 +84,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r if ( laststr != 0 ) free(laststr); laststr = newstr; - retstr = laststr; + retstr = clonestr(laststr); } } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e481b3fc2..2af888e0e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -31,6 +31,7 @@ // unduplicated bugs: // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes +// free_json crash on encrypted message #include #include "LP_include.h" @@ -233,7 +234,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } } else printf("error (%s) method is %s\n",jsonstr,method); } - if ( jsonstr != 0 ) + if ( jsonstr != 0 && argjson != 0 ) { len = (int32_t)strlen(jsonstr) + 1; if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) From accc20e4c4d386b5b159705430a5c554a3f59b00 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jul 2017 22:42:45 +0200 Subject: [PATCH 268/682] Strict --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5926f99b8..ee11bf372 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,7 +21,7 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H -//#define LP_STRICTPEERS +#define LP_STRICTPEERS #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL From 0d2c5781968d9b43cb05f42e9a1759ea086a6ddf Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Jul 2017 09:33:17 +0200 Subject: [PATCH 269/682] Test --- iguana/exchanges/LP_coins.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 95844ddd3..6990e189a 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -304,14 +304,16 @@ struct iguana_info *LP_coincreate(cJSON *item) txfee = 10000; if ( (estimatedrate= jdouble(item,"estimatedrate")) == 0. ) estimatedrate = 20; - if ( (pubtype= juint(item,"pubtype")) == 0 ) - pubtype = 60; + pubtype = juint(item,"pubtype"); if ( (p2shtype= juint(item,"p2shtype")) == 0 ) p2shtype = 85; if ( (wiftype= juint(item,"wiftype")) == 0 ) wiftype = 188; if ( (assetname= jstr(item,"asset")) != 0 ) + { name = assetname; + pubtype = 60; + } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr"),LP_busport(port)) < 0 ) From 14e845f88662226a8d8e62e1277b2173b9ed5993 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 12:23:20 +0200 Subject: [PATCH 270/682] Fixes --- iguana/exchanges/LP_bitcoin.c | 46 ++++++++++++++++++++----------- iguana/exchanges/LP_coins.c | 9 ++++-- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 13 +++++---- iguana/exchanges/LP_remember.c | 22 ++++++++------- iguana/exchanges/LP_rpc.c | 25 +++++++++++++++-- iguana/exchanges/LP_transaction.c | 34 +++++++++++------------ iguana/exchanges/LP_utxos.c | 8 +++--- iguana/exchanges/coins | 2 +- 9 files changed, 100 insertions(+), 61 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index a90eb7bab..100b05080 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2145,9 +2145,10 @@ int32_t base58encode_checkbuf(uint8_t taddr,uint8_t addrtype,uint8_t *data,int32 return(data_len + 4 + offset); } -int32_t bitcoin_wif2priv(uint8_t *addrtypep,bits256 *privkeyp,char *wifstr) +int32_t bitcoin_wif2priv(uint8_t wiftaddr,uint8_t *addrtypep,bits256 *privkeyp,char *wifstr) { - int32_t len = -1; bits256 hash; uint8_t buf[256]; + int32_t offset,len = -1; bits256 hash; uint8_t buf[256]; + offset = 1 + (wiftaddr != 0); memset(buf,0,sizeof(buf)); if ( (len= bitcoin_base58decode(buf,wifstr)) >= 4 ) { @@ -2155,8 +2156,8 @@ int32_t bitcoin_wif2priv(uint8_t *addrtypep,bits256 *privkeyp,char *wifstr) if ( len < 38 ) len = 38; hash = bits256_doublesha256(0,buf,len - 4); - *addrtypep = *buf; - memcpy(privkeyp,buf+1,32); + *addrtypep = (wiftaddr == 0) ? *buf : buf[1]; + memcpy(privkeyp,buf+offset,32); if ( (buf[len - 4]&0xff) == hash.bytes[31] && (buf[len - 3]&0xff) == hash.bytes[30] &&(buf[len - 2]&0xff) == hash.bytes[29] && (buf[len - 1]&0xff) == hash.bytes[28] ) { //int32_t i; for (i=0; i wif.(%s) addrtype.%02x -> %02x (%s)\n",bits256_str(str,privkey),wifstr,addrtype,checktype,bits256_str(str2,checkpriv)); @@ -2195,17 +2208,18 @@ int32_t bitcoin_priv2wif(char *wifstr,bits256 privkey,uint8_t addrtype) return((int32_t)strlen(wifstr)); } -int32_t bitcoin_priv2wiflong(char *wifstr,bits256 privkey,uint8_t addrtype) +int32_t bitcoin_priv2wiflong(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t addrtype) { - uint8_t data[128]; int32_t len = 32; - memcpy(data+1,privkey.bytes,sizeof(privkey)); - len = base58encode_checkbuf(0,addrtype,data,len); + uint8_t data[128]; int32_t offset,len = 32; + offset = 1 + (wiftaddr != 0); + memcpy(data+offset,privkey.bytes,sizeof(privkey)); + len = base58encode_checkbuf(wiftaddr,addrtype,data,len); if ( bitcoin_base58encode(wifstr,data,len) == 0 ) return(-1); if ( 1 ) { uint8_t checktype; bits256 checkpriv; char str[65],str2[65]; - if ( bitcoin_wif2priv(&checktype,&checkpriv,wifstr) == sizeof(bits256) ) + if ( bitcoin_wif2priv(wiftaddr,&checktype,&checkpriv,wifstr) == sizeof(bits256) ) { if ( checktype != addrtype || bits256_cmp(checkpriv,privkey) != 0 ) printf("(%s) -> wif.(%s) addrtype.%02x -> %02x (%s)\n",bits256_str(str,privkey),wifstr,addrtype,checktype,bits256_str(str2,checkpriv)); @@ -2229,11 +2243,11 @@ bits256 LP_pubkey(bits256 privkey) return(pubkey); } -char *_setVsigner(uint8_t pubtype,struct vin_info *V,int32_t ind,char *pubstr,char *wifstr) +char *_setVsigner(uint8_t wiftaddr,uint8_t pubtype,struct vin_info *V,int32_t ind,char *pubstr,char *wifstr) { uint8_t addrtype; decode_hex(V->signers[ind].pubkey,(int32_t)strlen(pubstr)/2,pubstr); - bitcoin_wif2priv(&addrtype,&V->signers[ind].privkey,wifstr); + bitcoin_wif2priv(wiftaddr,&addrtype,&V->signers[ind].privkey,wifstr); if ( addrtype != pubtype ) return(clonestr("{\"error\":\"invalid wifA\"}")); else return(0); diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6990e189a..5db13e2bb 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -215,7 +215,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) return(coin); } -int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t taddr,uint16_t busport) +int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport) { char *name2; memset(coin,0,sizeof(*coin)); @@ -223,6 +223,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset sprintf(coin->serverport,"127.0.0.1:%u",port); coin->isPoS = isPoS; coin->taddr = taddr; + coin->wiftaddr = wiftaddr; coin->longestchain = longestchain; coin->txfee = txfee; coin->estimatedrate = estimatedrate; @@ -234,6 +235,8 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; + if ( strcmp(symbol,"VERGE") == 0 ) + coin->noimportprivkey_flag = 1; return(LP_userpass(coin->userpass,symbol,assetname,name,name2)); } @@ -275,7 +278,7 @@ struct iguana_info *LP_coinfind(char *symbol) else if ( strcmp(symbol,"KMD") == 0 ) name = "komodo"; else return(0); - if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,busport) > 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport) > 0 ) { if ( (coin= LP_coinadd(&cdata)) != 0 ) { @@ -316,7 +319,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; - if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr"),LP_busport(port)) < 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port)) < 0 ) { coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index ee11bf372..91b40e56a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -180,7 +180,7 @@ struct iguana_info uint64_t txfee; double estimatedrate; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; uint32_t counter,inactive,lastmempool,lastgetinfo; - uint8_t pubtype,p2shtype,isPoS,wiftype,taddr; + uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2af888e0e..50487756a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,21 +17,22 @@ // LP_nativeDEX.c // marketmaker // -// swap cancel should cleanly cancel +// new features: // stats // auto-utxo creation // getmessage api -// robustify remember +// fixes: +// -wiftaddr and no flag for importprivkey (VERGE) +// -avoid redundant importprivkey +// -KMD: z_sendmany to set nLockTime +// -put Atxfee and Btxfee into rememberfiles // false detection of bobreclaim -// put Atxfee and Btxfee into rememberfiles -// coded fix: even with invalid tx, thinks swap is completed RETSTR.({"result":null,"error":{"code":-26,"message":"66: insufficient priority"},"id":"jl777"} -//) BTC.0000000000000000000000000000000000000000000000000000000000000000 // unduplicated bugs: +// swap cancel should cleanly cancel // multiple smartaddresses? enable/disable causes? 250 KMD bounty // verify bid volumes -// free_json crash on encrypted message #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 0372cff88..292bc7100 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -93,7 +93,7 @@ void basilisk_dontforget(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx sprintf(fname,"%s/SWAPS/%u-%u",GLOBAL_DBDIR,swap->I.req.requestid,swap->I.req.quoteid), OS_compatible_path(fname); if ( (fp= fopen(fname,"wb")) != 0 ) { - fprintf(fp,"{\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u",swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime); + fprintf(fp,"{\"src\":\"%s\",\"srcamount\":%.8f,\"dest\":\"%s\",\"destamount\":%.8f,\"requestid\":%u,\"quoteid\":%u,\"iambob\":%d,\"state\":%u,\"otherstate\":%u,\"expiration\":%u,\"dlocktime\":%u,\"plocktime\":%u,\"Atxfee\":%llu,\"Btxfee\":%llu",swap->I.req.src,dstr(swap->I.req.srcamount),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.requestid,swap->I.req.quoteid,swap->I.iambob,swap->I.statebits,swap->I.otherstatebits,swap->I.expiration,swap->bobdeposit.I.locktime,swap->bobpayment.I.locktime,(long long)swap->I.Atxfee,(long long)swap->I.Btxfee); if ( memcmp(zeroes,swap->I.secretAm,20) != 0 ) { init_hexbytes_noT(secretAmstr,swap->I.secretAm,20); @@ -395,7 +395,7 @@ uint32_t LP_extract(uint32_t requestid,uint32_t quoteid,char *rootfname,char *fi cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee,Btxfee; + FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee=0,Btxfee=0; if ( ctx == 0 ) ctx = bitcoin_ctx(); bobpaymentaddr[0] = bobdepositaddr[0] = alicepaymentaddr[0] = 0; @@ -443,6 +443,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti dlocktime = LP_extract(requestid,quoteid,fname,"dlocktime"); r = juint(item,"requestid"); q = juint(item,"quoteid"); + Atxfee = j64bits(item,"Atxfee"); + Btxfee = j64bits(item,"Btxfee"); pubA0 = jbits256(item,"pubA0"); pubB0 = jbits256(item,"pubB0"); pubB1 = jbits256(item,"pubB1"); @@ -595,9 +597,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Adest = Bdest = AAdest = ABdest = 0; if ( bobcoin[0] == 0 || alicecoin[0] == 0 ) return(0); - if ( (Atxfee= LP_getestimatedrate(alicecoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( Atxfee == 0 && (Atxfee= LP_getestimatedrate(alicecoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) Atxfee = LP_MIN_TXFEE; - if ( (Btxfee= LP_getestimatedrate(bobcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + if ( Btxfee == 0 && (Btxfee= LP_getestimatedrate(bobcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) Btxfee = LP_MIN_TXFEE; //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); @@ -670,7 +672,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } for (j=0; j<32; j++) rev.bytes[j] = myprivs[0].bytes[31 - j]; - if ( (txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"alicespend",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,1,expiration,&values[BASILISK_ALICESPEND],0,0,bobpaymentaddr,1)) != 0 ) + if ( (txbytes[BASILISK_ALICESPEND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"alicespend",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,1,expiration,&values[BASILISK_ALICESPEND],0,0,bobpaymentaddr,1)) != 0 ) printf("alicespend.(%s)\n",txbytes[BASILISK_ALICESPEND]); } } @@ -695,7 +697,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"aliceclaim",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,0,expiration,&values[BASILISK_ALICECLAIM],0,0,bobdepositaddr,1)) != 0 ) + if ( (txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"aliceclaim",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,0,expiration,&values[BASILISK_ALICECLAIM],0,0,bobdepositaddr,1)) != 0 ) printf("privBn.(%s) aliceclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICECLAIM]); } } @@ -717,7 +719,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti privBn = basilisk_swap_privBn_extract(&txids[BASILISK_BOBREFUND],bobcoin,txids[BASILISK_BOBDEPOSIT],privBn); if ( bits256_nonz(txids[BASILISK_ALICEPAYMENT]) != 0 && bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) { - if ( (txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",alicecoin,Atxfee,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_ALICERECLAIM],alicepaymentaddr)) != 0 ) + if ( (txbytes[BASILISK_ALICERECLAIM]= basilisk_swap_Aspend("alicereclaim",alicecoin,Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_ALICERECLAIM],alicepaymentaddr)) != 0 ) printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,privBn),txbytes[BASILISK_ALICERECLAIM]); } } @@ -747,7 +749,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) { - if ( (txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",alicecoin,Atxfee,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_BOBSPEND],alicepaymentaddr)) != 0 ) + if ( (txbytes[BASILISK_BOBSPEND]= basilisk_swap_Aspend("bobspend",alicecoin,Atxfee,alice->wiftaddr,alice->taddr,alice->pubtype,alice->p2shtype,alice->isPoS,alice->wiftype,ctx,privAm,privBn,txids[BASILISK_ALICEPAYMENT],0,pubkey33,expiration,&values[BASILISK_BOBSPEND],alicepaymentaddr)) != 0 ) printf("bobspend.(%s)\n",txbytes[BASILISK_BOBSPEND]); } } @@ -771,7 +773,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,myprivs[1],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[1],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,0,expiration,&values[BASILISK_BOBRECLAIM],0,0,bobpaymentaddr,1)) != 0 ) + if ( (txbytes[BASILISK_BOBRECLAIM]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[1],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBPAYMENT],0,0,pubkey33,0,expiration,&values[BASILISK_BOBRECLAIM],0,0,bobpaymentaddr,1)) != 0 ) { int32_t z; for (z=0; z<20; z++) @@ -801,7 +803,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti vcalc_sha256(0,secretBn256,privBn.bytes,sizeof(privBn)); redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,privBn,secretAm,secretAm256,secretBn,secretBn256); len = basilisk_swapuserdata(userdata,privBn,0,myprivs[0],redeemscript,redeemlen); - if ( (txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,1,expiration,&values[BASILISK_BOBREFUND],0,0,bobdepositaddr,1)) != 0 ) + if ( (txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,Btxfee,"bobrefund",bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,myprivs[0],0,redeemscript,redeemlen,userdata,len,txids[BASILISK_BOBDEPOSIT],0,0,pubkey33,1,expiration,&values[BASILISK_BOBREFUND],0,0,bobdepositaddr,1)) != 0 ) printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,pubB1),txbytes[BASILISK_BOBREFUND]); } if ( txbytes[BASILISK_BOBREFUND] != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 57f712f50..775222e4d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -270,9 +270,28 @@ cJSON *LP_validateaddress(char *symbol,char *address) cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { - char buf[512]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"[\"%s\", \"%s\", %s]",wifstr,label,flag < 0 ? "false" : "true"); - return(bitcoin_json(coin,"importprivkey",buf)); + static void *ctx; + char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t doneflag = 0; + coin = LP_coinfind(symbol); + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + bitcoin_wif2addr(ctx,coin->wiftaddr,coin->taddr,coin->pubtype,address,wifstr); + if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) + { + if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) + { + doneflag = 1; + printf("%s already ismine\n",address); + } + free_json(retjson); + } + if ( doneflag == 0 ) + { + if ( coin->noimportprivkey_flag != 0 ) + sprintf(buf,"[\"%s\", \"%s\"]",wifstr,label); + else sprintf(buf,"[\"%s\", \"%s\", %s]",wifstr,label,flag < 0 ? "false" : "true"); + return(bitcoin_json(coin,"importprivkey",buf)); + } else return(cJSON_Parse("{\"result\":\"success\"}")); } int32_t LP_importaddress(char *symbol,char *address) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a2450b7f7..a570b381d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -231,7 +231,7 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc return(0); } -bits256 iguana_str2priv(char *str) +bits256 iguana_str2priv(uint8_t wiftaddr,char *str) { bits256 privkey; int32_t n; uint8_t addrtype; //struct iguana_waccount *wacct=0; struct iguana_waddress *waddr; memset(&privkey,0,sizeof(privkey)); @@ -240,7 +240,7 @@ bits256 iguana_str2priv(char *str) n = (int32_t)strlen(str) >> 1; if ( n == sizeof(bits256) && is_hexstr(str,sizeof(bits256)) > 0 ) decode_hex(privkey.bytes,sizeof(privkey),str); - else if ( bitcoin_wif2priv(&addrtype,&privkey,str) != sizeof(bits256) ) + else if ( bitcoin_wif2priv(wiftaddr,&addrtype,&privkey,str) != sizeof(bits256) ) { //if ( (waddr= iguana_waddresssearch(&wacct,str)) != 0 ) // privkey = waddr->privkey; @@ -394,7 +394,7 @@ int64_t iguana_lockval(int32_t finalized,int64_t locktime) return(lockval); } -int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) +int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson) { uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 65536; char *privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0; maxsize = 1000000; @@ -429,7 +429,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t taddr,uint8_t p privkeystr = jstr(item,0); if ( privkeystr == 0 || privkeystr[0] == 0 ) continue; - privkeys[i] = privkey = iguana_str2priv(privkeystr); + privkeys[i] = privkey = iguana_str2priv(wiftaddr,privkeystr); bitcoin_pubkey33(ctx,pubkeys[i],privkey); //if ( bits256_nonz(privkey) != 0 ) // iguana_ensure_privkey(coin,privkey); @@ -524,7 +524,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t taddr,uint8_t p return(complete); } -char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) +char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys) { char *rawtxbytes=0,*signedtx=0,tmpaddr[64],hexstr[999],wifstr[128],txdestaddr[64],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*item,*privkeys; int32_t completed,spendlen,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value,change = 0; struct iguana_msgtx msgtx; *destamountp = 0; @@ -579,13 +579,13 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch { V[0].signers[1].privkey = *privkey2p; bitcoin_pubkey33(ctx,V[0].signers[1].pubkey,*privkey2p); - bitcoin_priv2wif(wifstr,*privkey2p,wiftype); + bitcoin_priv2wif(wiftaddr,wifstr,*privkey2p,wiftype); jaddistr(privkeys,wifstr); V[0].N = V[0].M = 2; } else V[0].N = V[0].M = 1; V[0].signers[0].privkey = privkey; bitcoin_pubkey33(ctx,V[0].signers[0].pubkey,privkey); - bitcoin_priv2wif(wifstr,privkey,wiftype); + bitcoin_priv2wif(wiftaddr,wifstr,privkey,wiftype); jaddistr(privkeys,wifstr); V[0].suppress_pubkeys = suppress_pubkeys; V[0].ignore_cltverr = ignore_cltverr; @@ -650,7 +650,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch completed = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); //printf("locktime.%u sequenceid.%x rawtx.(%s) vins.(%s)\n",locktime,sequenceid,rawtxbytes,jprint(vins,0)); - if ( (completed= iguana_signrawtransaction(ctx,symbol,taddr,pubtype,p2shtype,isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,1,rawtxbytes,vins,privkeys)) < 0 ) + if ( (completed= iguana_signrawtransaction(ctx,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,1,rawtxbytes,vins,privkeys)) < 0 ) //if ( (signedtx= LP_signrawtx(symbol,signedtxidp,&completed,vins,rawtxbytes,privkeys,V)) == 0 ) printf("couldnt sign transaction.%s %s\n",name,bits256_str(str,*signedtxidp)); else if ( completed == 0 ) @@ -681,7 +681,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub } for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) { rawtx->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( rawtx->I.datalen <= sizeof(rawtx->txbytes) ) @@ -705,7 +705,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub return(retval); } -int32_t basilisk_rawtx_sign(char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,struct basilisk_swap *swap,struct basilisk_rawtx *dest,struct basilisk_rawtx *rawtx,bits256 privkey,bits256 *privkey2,uint8_t *userdata,int32_t userdatalen,int32_t ignore_cltverr,uint8_t *changermd160,char *vinaddr) +int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,struct basilisk_swap *swap,struct basilisk_rawtx *dest,struct basilisk_rawtx *rawtx,bits256 privkey,bits256 *privkey2,uint8_t *userdata,int32_t userdatalen,int32_t ignore_cltverr,uint8_t *changermd160,char *vinaddr) { char *signedtx,*changeaddr = 0,_changeaddr[64]; int64_t txfee,newtxfee=0,destamount; uint32_t timestamp,locktime=0,sequenceid = 0xffffffff; int32_t iter,retval = -1; double estimatedrate; //char str2[65]; printf("%s rawtxsign.(%s/v%d)\n",dest->name,bits256_str(str2,dest->utxotxid),dest->utxovout); @@ -723,7 +723,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t taddr,uint8_t pubtype,uint8_t p } for (iter=0; iter<2; iter++) { - if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys)) != 0 ) + if ( (signedtx= basilisk_swap_bobtxspend(&dest->I.signedtxid,iter == 0 ? txfee : newtxfee,rawtx->name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,swap->ctx,privkey,privkey2,rawtx->redeemscript,rawtx->I.redeemlen,userdata,userdatalen,dest->utxotxid,dest->utxovout,dest->I.destaddr,rawtx->I.pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,dest->I.suppress_pubkeys)) != 0 ) { dest->I.datalen = (int32_t)strlen(signedtx) >> 1; if ( dest->I.datalen <= sizeof(dest->txbytes) ) @@ -759,7 +759,7 @@ int32_t basilisk_alicescript(uint8_t *redeemscript,int32_t *redeemlenp,uint8_t * return(n); } -char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t vout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) +char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privAm,bits256 privBn,bits256 utxotxid,int32_t vout,uint8_t pubkey33[33],uint32_t expiration,int64_t *destamountp,char *vinaddr) { char msigaddr[64],*signedtx = 0; int32_t spendlen,redeemlen; uint8_t tmp33[33],redeemscript[512],spendscript[128]; bits256 pubAm,pubBn,signedtxid; uint64_t txfee; if ( bits256_nonz(privAm) != 0 && bits256_nonz(privBn) != 0 ) @@ -783,7 +783,7 @@ char *basilisk_swap_Aspend(char *name,char *symbol,uint64_t Atxfee,uint8_t taddr txfee = LP_MIN_TXFEE; } //txfee = LP_txfee(symbol); - signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,vout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); + signedtx = basilisk_swap_bobtxspend(&signedtxid,txfee,name,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,wiftype,ctx,privAm,&privBn,redeemscript,redeemlen,0,0,utxotxid,vout,0,pubkey33,1,expiration,destamountp,0,0,vinaddr,1); } return(signedtx); } @@ -1123,7 +1123,7 @@ int32_t basilisk_bobpayment_reclaim(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,zero,1,swap->I.myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.I.redeemlen); memcpy(swap->I.userdata_bobreclaim,userdata,len); swap->I.userdata_bobreclaimlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobreclaim,&swap->bobpayment,swap->I.myprivs[1],0,userdata,len,1,swap->changermd160,swap->bobpayment.I.destaddr)) == 0 ) { //for (i=0; ibobreclaim.I.datalen; i++) // printf("%02x",swap->bobreclaim.txbytes[i]); @@ -1140,7 +1140,7 @@ int32_t basilisk_bobdeposit_refund(struct basilisk_swap *swap,int32_t delay) len = basilisk_swapuserdata(userdata,swap->I.privBn,0,swap->I.myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.I.redeemlen); memcpy(swap->I.userdata_bobrefund,userdata,len); swap->I.userdata_bobrefundlen = len; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->bobrefund,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,0,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) { for (i=0; ibobrefund.I.datalen; i++) printf("%02x",swap->bobrefund.txbytes[i]); @@ -1399,7 +1399,7 @@ int32_t LP_verify_bobdeposit(struct basilisk_swap *swap,uint8_t *data,int32_t da memcpy(swap->aliceclaim.I.pubkey33,swap->persistent_pubkey33,33); bitcoin_address(swap->aliceclaim.I.destaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->persistent_pubkey33,33); retval = 0; - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->aliceclaim,&swap->bobdeposit,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->bobdeposit.I.destaddr)) == 0 ) { /*for (i=0; ibobdeposit.I.datalen; i++) printf("%02x",swap->bobdeposit.txbytes[i]); @@ -1464,7 +1464,7 @@ int32_t LP_verify_bobpayment(struct basilisk_swap *swap,uint8_t *data,int32_t da memcpy(swap->alicespend.I.pubkey33,swap->persistent_pubkey33,33); bitcoin_address(swap->alicespend.I.destaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->persistent_pubkey33,33); //char str[65],str2[65]; printf("bobpaid privAm.(%s) myprivs[0].(%s)\n",bits256_str(str,swap->I.privAm),bits256_str(str2,swap->I.myprivs[0])); - if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr)) == 0 ) + if ( (retval= basilisk_rawtx_sign(swap->bobcoin.symbol,swap->bobcoin.wiftaddr,swap->bobcoin.taddr,swap->bobcoin.pubtype,swap->bobcoin.p2shtype,swap->bobcoin.isPoS,swap->bobcoin.wiftype,swap,&swap->alicespend,&swap->bobpayment,swap->I.myprivs[0],0,userdata,len,1,swap->changermd160,swap->alicepayment.I.destaddr)) == 0 ) { /*for (i=0; ibobpayment.I.datalen; i++) printf("%02x",swap->bobpayment.txbytes[i]); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index efd21ea07..b4d4b4a7d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -869,7 +869,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); else { - bitcoin_wif2priv(&tmptype,&privkey,wifstr); + bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); if ( 0 ) { char str[65],str2[65]; @@ -882,15 +882,15 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan if ( coin->counter == 0 ) { coin->counter++; - bitcoin_priv2wif(tmpstr,privkey,coin->wiftype); + bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); bitcoin_addr2rmd160(coin->taddr,&tmptype,rmd160,coin->smartaddr); LP_privkeyadd(privkey,rmd160); if ( 0 && (coin->pubtype != 60 || strcmp(coin->symbol,"KMD") == 0) ) printf("%s (%s) %d wif.(%s) (%s)\n",coin->symbol,coin->smartaddr,coin->pubtype,tmpstr,passphrase); if ( counter++ == 0 ) { - bitcoin_priv2wif(USERPASS_WIFSTR,privkey,188); - bitcoin_wif2priv(&tmptype,&checkkey,USERPASS_WIFSTR); + bitcoin_priv2wif(coin->wiftaddr,USERPASS_WIFSTR,privkey,188); + bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,USERPASS_WIFSTR); if ( bits256_cmp(checkkey,privkey) != 0 ) { char str[65],str2[65]; diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 50375d051..b8ae596fe 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 5c49b28e53df904c9534874db41de544b916e295 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 12:56:02 +0200 Subject: [PATCH 271/682] Test --- iguana/exchanges/LP_commands.c | 30 +++++++---- iguana/exchanges/LP_messages.c | 92 +++++++++++++++++++++++++++++++++ iguana/exchanges/LP_nativeDEX.c | 4 +- 3 files changed, 114 insertions(+), 12 deletions(-) create mode 100644 iguana/exchanges/LP_messages.c diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f15df7e9a..0ba142513 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -84,6 +84,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r if ( laststr != 0 ) free(laststr); laststr = newstr; + LP_gotmessage(argjson); retstr = clonestr(laststr); } } @@ -112,18 +113,11 @@ getutxos(coin, lastn)\n\ orderbook(base, rel, duration=3600)\n\ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ +getmessages(firsti=0, num=100)\n\ +clearmessages(firsti=0, num=100)\n\ trust(pubkey, trust)\n\ \"}")); - /* - register(pubkey,pushaddr)\n\ - registerall(numnodes)\n\ - lookup(pubkey)\n\ - forward(pubkey,method2,)\n\ - forward(pubkey,method2=publish,)\n\ - forwardhex(pubkey,hex)\n\ - */ - base = jstr(argjson,"base"); rel = jstr(argjson,"rel"); if ( USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 ) @@ -142,8 +136,22 @@ trust(pubkey, trust)\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"sendmessage") == 0 ) { - printf("broadcast message\n"); - LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); + if ( jobj(argjson,"method2") == 0 ) + { + printf("broadcast message\n"); + LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0)); + } + return(clonestr("{\"result\":\"success\"}")); + } + else if ( strcmp(method,"getmessages") == 0 ) + { + if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 ) + return(jprint(retjson,1)); + else return(clonestr("{\"error\":\"null messages\"}")); + } + else if ( strcmp(method,"deletemessages") == 0 ) + { + LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } if ( base != 0 && rel != 0 ) diff --git a/iguana/exchanges/LP_messages.c b/iguana/exchanges/LP_messages.c new file mode 100644 index 000000000..76cfca051 --- /dev/null +++ b/iguana/exchanges/LP_messages.c @@ -0,0 +1,92 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_messages.c +// marketmaker +// + +struct LP_messageinfo { struct LP_messageinfo *next,*prev; cJSON *msgjson; int32_t ind; } *LP_MSGS; +int32_t Num_messages; + +void LP_gotmessage(cJSON *argjson) +{ + struct LP_messageinfo *msg = calloc(1,sizeof(*msg)); + msg->msgjson = jduplicate(argjson); + msg->ind = Num_messages++; +} + +void LP_deletemessages(int32_t firsti,int32_t num) +{ + struct LP_messageinfo *msg,*tmp; int32_t lasti; + if ( num == 0 ) + num = 100; + if ( firsti < 0 ) + firsti = 0; + else if ( firsti >= Num_messages ) + return; + lasti = firsti + num - 1; + if ( lasti < Num_messages-1 ) + lasti = Num_messages - 1; + DL_FOREACH_SAFE(LP_MSGS,msg,tmp) + { + if ( msg->ind >= firsti && msg->ind <= lasti ) + { + portable_mutex_lock(&LP_messagemutex); + DL_DELETE(LP_MSGS,msg); + portable_mutex_unlock(&LP_messagemutex); + free_json(msg->msgjson); + free(msg); + } + } +} + +cJSON *LP_getmessages(int32_t firsti,int32_t num) +{ + struct LP_messageinfo *msg,*tmp; int32_t lasti,n=0,maxi=-1,mini=-1; cJSON *retjson,*item,*array = cJSON_CreateArray(); + retjson = cJSON_CreateObject(); + if ( num == 0 ) + num = 100; + if ( firsti < 0 ) + firsti = 0; + else if ( firsti >= Num_messages ) + { + jadd(retjson,"messages",array); + return(retjson); + } + lasti = firsti + num - 1; + if ( lasti < Num_messages-1 ) + lasti = Num_messages - 1; + DL_FOREACH_SAFE(LP_MSGS,msg,tmp) + { + if ( msg->ind >= firsti && msg->ind <= lasti ) + { + item = cJSON_CreateObject(); + jaddnum(item,"ind",msg->ind); + jadd(item,"msg",jduplicate(msg->msgjson)); + jaddi(array,item); + if ( mini == -1 || msg->ind < mini ) + mini = msg->ind; + if ( maxi == -1 || msg->ind > maxi ) + maxi = msg->ind; + n++; + } + } + jadd(retjson,"messages",array); + jaddnum(retjson,"minind",mini); + jaddnum(retjson,"maxind",maxi); + jaddnum(retjson,"num",n); + return(retjson); +} diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 50487756a..6d09611fa 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -36,7 +36,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex; int32_t LP_canbind; struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; @@ -97,6 +97,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_utxos.c" #include "LP_forwarding.c" #include "LP_ordermatch.c" +#include "LP_messages.c" #include "LP_commands.c" char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen) @@ -651,6 +652,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_psockmutex); portable_mutex_init(&LP_coinmutex); portable_mutex_init(&LP_pubkeymutex); + portable_mutex_init(&LP_messagemutex); LP_sessionid = (uint32_t)time(NULL); printf("getting myipaddr sessionid.%u\n",LP_sessionid); if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) From 401d458f18808fd7b755aacfce0c5ed45a0dbbba Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:00:55 +0200 Subject: [PATCH 272/682] Test --- iguana/exchanges/deletemessages | 2 ++ iguana/exchanges/getmessages | 2 ++ iguana/exchanges/install | 2 +- iguana/exchanges/mm.c | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 iguana/exchanges/deletemessages create mode 100755 iguana/exchanges/getmessages diff --git a/iguana/exchanges/deletemessages b/iguana/exchanges/deletemessages new file mode 100755 index 000000000..ad1269cd8 --- /dev/null +++ b/iguana/exchanges/deletemessages @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"deletemessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/getmessages b/iguana/exchanges/getmessages new file mode 100755 index 000000000..85d246c51 --- /dev/null +++ b/iguana/exchanges/getmessages @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getmessages\",\"firsti\":0,\"num\":10}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 145548421..da1ceb75a 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 44cf4f5f0..522121258 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -797,10 +797,12 @@ void LP_main(void *ptr) int main(int argc, const char * argv[]) { - char *base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; + char dirname[512],*base,*rel,*name,*exchange,*apikey,*apisecret,*blocktrail,*retstr,*baseaddr,*reladdr,*passphrase; double profitmargin,maxexposure,incrratio,start_rel,start_base,minask,maxbid,incr; cJSON *retjson,*loginjson; int32_t i; OS_init(); + sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); + sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) From af9d5c7924f24162668c7688d663b042232ad01f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:04:27 +0200 Subject: [PATCH 273/682] Test --- iguana/exchanges/LP_messages.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iguana/exchanges/LP_messages.c b/iguana/exchanges/LP_messages.c index 76cfca051..80847ee5c 100644 --- a/iguana/exchanges/LP_messages.c +++ b/iguana/exchanges/LP_messages.c @@ -26,6 +26,9 @@ void LP_gotmessage(cJSON *argjson) struct LP_messageinfo *msg = calloc(1,sizeof(*msg)); msg->msgjson = jduplicate(argjson); msg->ind = Num_messages++; + portable_mutex_lock(&LP_messagemutex); + DL_APPEND(LP_MSGS,msg); + portable_mutex_unlock(&LP_messagemutex); } void LP_deletemessages(int32_t firsti,int32_t num) @@ -85,6 +88,8 @@ cJSON *LP_getmessages(int32_t firsti,int32_t num) } } jadd(retjson,"messages",array); + jaddnum(retjson,"firsti",firsti); + jaddnum(retjson,"lasti",lasti); jaddnum(retjson,"minind",mini); jaddnum(retjson,"maxind",maxi); jaddnum(retjson,"num",n); From 842a34216ffd994606a3b6a91c275b2543a6b55d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:08:29 +0200 Subject: [PATCH 274/682] Test --- iguana/exchanges/LP_commands.c | 3 ++- iguana/exchanges/LP_nativeDEX.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 0ba142513..fb6ec3ede 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -71,12 +71,13 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else*/ if ( strcmp(method,"sendmessage") == 0 ) + else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"method2") != 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypub25519) == 0 ) { + jdelete(argjson,"userpass"); newstr = jprint(argjson,0); if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6d09611fa..f799c7753 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,7 +20,6 @@ // new features: // stats // auto-utxo creation -// getmessage api // fixes: // -wiftaddr and no flag for importprivkey (VERGE) From f32312bf6f48179a92b595636e4a5e3c4f0e9deb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:10:17 +0200 Subject: [PATCH 275/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index fb6ec3ede..89c60990e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -71,7 +71,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"method2") != 0 ) + else*/ if ( strcmp(method,"sendmessage") == 0 )//&& jobj(argjson,"method2") != 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); From f6582ac9cba204a30b7da52549672bdebab149f8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:12:44 +0200 Subject: [PATCH 276/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 89c60990e..d6b399db9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -71,7 +71,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else*/ if ( strcmp(method,"sendmessage") == 0 )//&& jobj(argjson,"method2") != 0 ) + else*/ if ( strcmp(method,"sendmessage") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); From 920a7a22288c2086e4d853740318732c3f0c308d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:13:57 +0200 Subject: [PATCH 277/682] Test --- iguana/exchanges/LP_commands.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d6b399db9..8be6c6a62 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -71,13 +71,12 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r //printf("got hello from %s:%u\n",ipaddr!=0?ipaddr:"",argport); return(0); } - else*/ if ( strcmp(method,"sendmessage") == 0 ) + else*/ if ( strcmp(method,"sendmessage") == 0 && jobj(argjson,"userpass") == 0 ) { static char *laststr; char *newstr; bits256 pubkey = jbits256(argjson,"pubkey"); if ( bits256_nonz(pubkey) == 0 || bits256_cmp(pubkey,LP_mypub25519) == 0 ) { - jdelete(argjson,"userpass"); newstr = jprint(argjson,0); if ( laststr == 0 || strcmp(laststr,newstr) != 0 ) { From b49c61c0d9474b51722cffb23c043877881454de Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 13:17:44 +0200 Subject: [PATCH 278/682] Test --- iguana/exchanges/LP_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8be6c6a62..612eedeb1 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -87,7 +87,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r LP_gotmessage(argjson); retstr = clonestr(laststr); } - } + } else retstr = clonestr("{\"error\":\"duplicate message\"}"); } //else if ( strcmp(method,"nn_tests") == 0 ) // return(clonestr("{\"result\":\"success\"}")); From fea0b4105372cf5ae4ce033808773c2841ea4d31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:22:52 +0200 Subject: [PATCH 279/682] Auto price --- iguana/exchanges/LP_commands.c | 6 +++ iguana/exchanges/LP_nativeDEX.c | 30 ++++------- iguana/exchanges/LP_network.c | 31 ----------- iguana/exchanges/LP_prices.c | 83 +++++++++++++++++++++++++++++- iguana/exchanges/LP_statemachine.c | 50 ++++++++++++++++++ 5 files changed, 147 insertions(+), 53 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 612eedeb1..13aab17f0 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -169,6 +169,12 @@ trust(pubkey, trust)\n\ else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } + else if ( strcmp(method,"autoprice") == 0 ) + { + if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) < 0 ) + return(clonestr("{\"error\":\"couldnt set autoprice\"}")); + else return(clonestr("{\"error\":\"autoprice error\"}")); + } else if ( strcmp(method,"myprice") == 0 ) { if ( LP_myprice(&bid,&ask,base,rel) > SMALLVAL ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index f799c7753..3073531c5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,13 +19,17 @@ // // new features: // stats -// auto-utxo creation +// autoprice +// autofill +// autoutxo // fixes: // -wiftaddr and no flag for importprivkey (VERGE) // -avoid redundant importprivkey // -KMD: z_sendmany to set nLockTime // -put Atxfee and Btxfee into rememberfiles + +// bugs" // false detection of bobreclaim // unduplicated bugs: @@ -437,13 +441,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (counter % 6000) == 10 ) { LP_myutxo_updates(ctx,pubsock,passphrase); - /*if ( lastforward < now-3600 ) - { - if ( (retstr= LP_registerall(0)) != 0 ) - free(retstr); - //LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10); - lastforward = now; - }*/ HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp) { LP_utxo_spentcheck(pubsock,utxo); @@ -458,18 +455,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } } - //if ( IAMLP != 0 && (counter % 600) == 42 ) - // LP_hellos(); - /*if ( 0 && LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) - { - char keepalive[128]; - sprintf(keepalive,"{\"method\":\"keepalive\"}"); - //printf("send keepalive to %s pullsock.%d\n",pushaddr,pullsock); - if ( /LP_send(pullsock,keepalive,(int32_t)strlen(keepalive)+1,0) < 0 ) - { - //LP_deadman_switch = 0; - } - }*/ HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { cJSON *obj; int32_t height; bits256 zero; @@ -717,6 +702,11 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu printf("error launching stats rpcloop for port.%u\n",myport); exit(-1); } + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)&myipaddr) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } //if ( (retstr= basilisk_swapentry(0,0)) != 0 ) // free(retstr); while ( 1 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 7acda1a6c..53f538105 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -576,37 +576,6 @@ char *LP_psock(char *myipaddr,int32_t ispaired) */ -/*int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) -{ - int32_t sock,n,m,timeout,retval = -1; char msg[512],*retstr; - printf("nn_tests.(%s)\n",pushaddr); - if ( (sock= nn_socket(AF_SP,nnother)) >= 0 ) - { - if ( nn_connect(sock,pushaddr) < 0 ) - printf("connect error %s\n",nn_strerror(nn_errno())); - else - { - sleep(3); - timeout = 1; - nn_setsockopt(sock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); - sprintf(msg,"{\"method\":\"nn_tests\",\"ipaddr\":\"%s\"}",pushaddr); - n = /LP_send(sock,msg,(int32_t)strlen(msg)+1,0); - sleep(3); - LP_pullsock_check(ctx,&retstr,"127.0.0.1",-1,pullsock,0.); - sprintf(msg,"{\"method\":\"nn_tests2\",\"ipaddr\":\"%s\"}",pushaddr); - m = /LP_send(pullsock,msg,(int32_t)strlen(msg)+1,0); - printf(">>>>>>>>>>>>>>>>>>>>>> sent %d+%d bytes -> pullsock.%d retstr.(%s)\n",n,m,pullsock,retstr!=0?retstr:""); - if ( retstr != 0 ) - { - free(retstr); - retval = 0; - } - } - nn_close(sock); - } - return(retval); -}*/ - int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char *myipaddr,uint16_t mypullport,int32_t ispaired) { int32_t nntype,pullsock,timeout; char bindaddr[128],connectaddr[128]; diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8574440fc..ef582f12d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -26,9 +26,11 @@ struct LP_priceinfo char symbol[16]; uint64_t coinbits; int32_t ind,pad; - double diagval; + double diagval,high,low,volume,btcvolume,last,bid,ask,prevday; // mostly bittrex info double relvals[LP_MAXPRICEINFOS]; double myprices[LP_MAXPRICEINFOS]; + double minprices[LP_MAXPRICEINFOS]; + double margins[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; @@ -650,7 +652,84 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } else printf("error finding %s/%s %.8f\n",base,rel,price); } +int32_t LP_autoprices; +int32_t LP_autoprice(char *base,char *rel,double minprice,double margin) +{ + struct LP_priceinfo *basepp,*relpp; + if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + { + basepp->minprices[relpp->ind] = minprice; + basepp->margins[relpp->ind] = margin; + LP_autoprices++; + return(0); + } + return(-1); +} - +void prices_loop(void *ignore) +{ + //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, + int32_t i,n; double margin,price; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; + while ( 1 ) + { + if ( LP_autoprices == 0 ) + { + sleep(60); + continue; + } + if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) + { + sleep(60); + continue; + } + if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) + { + sleep(60); + continue; + } + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (array= jarray(&n,retjson,"result")) != 0 ) + { + for (i=0; ihigh = jdouble(item,"High"); + coinpp->low = jdouble(item,"Low"); + coinpp->volume = jdouble(item,"Volume"); + coinpp->btcvolume = jdouble(item,"BaseVolume"); + coinpp->last = jdouble(item,"Last"); + coinpp->bid = jdouble(item,"Bid"); + coinpp->ask = jdouble(item,"Ask"); + coinpp->prevday = jdouble(item,"PrevDay"); + if ( (margin= coinpp->margins[btcpp->ind]) > SMALLVAL ) + { + price = coinpp->bid * (1. - margin); + LP_mypriceset("BTC",name,1. / price); + + } + if ( (margin= btcpp->margins[coinpp->ind]) > SMALLVAL ) + { + price = coinpp->ask * (1. + margin); + LP_mypriceset(name,"BTC",price); + } + } + } + } + } + } + free_json(retjson); + } + free(retstr); + sleep(60); + } +} diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index f4621aa5b..4e98068a6 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -113,6 +113,56 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil }*/ return(fp); } +/*if ( lastforward < now-3600 ) + { + if ( (retstr= LP_registerall(0)) != 0 ) + free(retstr); + //LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10); + lastforward = now; + }*/ +//if ( IAMLP != 0 && (counter % 600) == 42 ) +// LP_hellos(); +/*if ( 0 && LP_canbind == 0 && (counter % (PSOCK_KEEPALIVE*MAINLOOP_PERSEC/2)) == 13 ) + { + char keepalive[128]; + sprintf(keepalive,"{\"method\":\"keepalive\"}"); + //printf("send keepalive to %s pullsock.%d\n",pushaddr,pullsock); + if ( /LP_send(pullsock,keepalive,(int32_t)strlen(keepalive)+1,0) < 0 ) + { + //LP_deadman_switch = 0; + } + }*/ + +/*int32_t nn_tests(void *ctx,int32_t pullsock,char *pushaddr,int32_t nnother) + { + int32_t sock,n,m,timeout,retval = -1; char msg[512],*retstr; + printf("nn_tests.(%s)\n",pushaddr); + if ( (sock= nn_socket(AF_SP,nnother)) >= 0 ) + { + if ( nn_connect(sock,pushaddr) < 0 ) + printf("connect error %s\n",nn_strerror(nn_errno())); + else + { + sleep(3); + timeout = 1; + nn_setsockopt(sock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); + sprintf(msg,"{\"method\":\"nn_tests\",\"ipaddr\":\"%s\"}",pushaddr); + n = /LP_send(sock,msg,(int32_t)strlen(msg)+1,0); + sleep(3); + LP_pullsock_check(ctx,&retstr,"127.0.0.1",-1,pullsock,0.); + sprintf(msg,"{\"method\":\"nn_tests2\",\"ipaddr\":\"%s\"}",pushaddr); + m = /LP_send(pullsock,msg,(int32_t)strlen(msg)+1,0); + printf(">>>>>>>>>>>>>>>>>>>>>> sent %d+%d bytes -> pullsock.%d retstr.(%s)\n",n,m,pullsock,retstr!=0?retstr:""); + if ( retstr != 0 ) + { + free(retstr); + retval = 0; + } + } + nn_close(sock); + } + return(retval); + }*/ int32_t basilisk_swap_load(uint32_t requestid,uint32_t quoteid,bits256 *privkeyp,struct basilisk_request *rp,uint32_t *statebitsp,int32_t *optiondurationp) { From c9aba1f049218714ba99c32fb6c119fdf48bd9d3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:26:07 +0200 Subject: [PATCH 280/682] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/autoprice | 2 ++ 2 files changed, 3 insertions(+) create mode 100755 iguana/exchanges/autoprice diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 13aab17f0..ccff2d66c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -95,6 +95,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ setprice(base, rel, price)\n\ +autoprice(base, rel, price, margin)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice new file mode 100755 index 000000000..fd4b0b052 --- /dev/null +++ b/iguana/exchanges/autoprice @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.01}" From cf181e5ae90689fae4a3e35524a4eabd077b6621 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:28:10 +0200 Subject: [PATCH 281/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ccff2d66c..401460235 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -172,7 +172,7 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"autoprice") == 0 ) { - if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) < 0 ) + if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) >= 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"error\":\"autoprice error\"}")); } diff --git a/iguana/exchanges/install b/iguana/exchanges/install index da1ceb75a..d790f4a8d 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 75b5da88d9204470820ac43b97e6c3394582d967 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:29:14 +0200 Subject: [PATCH 282/682] Test --- iguana/exchanges/LP_prices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ef582f12d..d2650715f 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -685,11 +685,13 @@ void prices_loop(void *ignore) } if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) { + printf("error getting marketsummaries\n"); sleep(60); continue; } if ( (retjson= cJSON_Parse(retstr)) != 0 ) { + printf("got.(%s)\n",retstr); if ( (array= jarray(&n,retjson,"result")) != 0 ) { for (i=0; i Date: Sat, 15 Jul 2017 16:32:27 +0200 Subject: [PATCH 283/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_prices.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 401460235..f6e16484a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -172,9 +172,9 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"autoprice") == 0 ) { - if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) >= 0 ) + if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); - else return(clonestr("{\"error\":\"autoprice error\"}")); + else return(clonestr("{\"result\":\"success\"}")); } else if ( strcmp(method,"myprice") == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d2650715f..bf6211a8b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -691,7 +691,7 @@ void prices_loop(void *ignore) } if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - printf("got.(%s)\n",retstr); + //printf("got.(%s)\n",retstr); if ( (array= jarray(&n,retjson,"result")) != 0 ) { for (i=0; ihigh = jdouble(item,"High"); From 270a0eb173d07fd96cc3fa7462f8ca3d9ff766fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:40:54 +0200 Subject: [PATCH 284/682] Test --- iguana/exchanges/LP_commands.c | 9 +++++---- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_prices.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f6e16484a..ff9d8d1b6 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -34,7 +34,7 @@ char *LP_numutxos() char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { - char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; + char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,othernumutxos,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; //printf("stats_JSON(%s)\n",jprint(argjson,0)); if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 ) { @@ -165,9 +165,10 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { - if ( LP_mypriceset(base,rel,price) < 0 ) + if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); - else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); + else if ( changed != 0 ) + return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } else if ( strcmp(method,"autoprice") == 0 ) @@ -208,7 +209,7 @@ trust(pubkey, trust)\n\ if ( price > SMALLVAL ) { printf("price set (%s/%s) <- %.8f\n",rel,base,1./price); - LP_mypriceset(rel,base,1./price); + LP_mypriceset(&changed,rel,base,1./price); return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); } diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 91b40e56a..3242c4e5f 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -269,6 +269,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo); int32_t LP_coinbus(uint16_t coin_busport); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); +char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); #endif diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index bf6211a8b..243159c09 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -327,11 +327,14 @@ char *LP_myprices() return(jprint(array,1)); } -int32_t LP_mypriceset(char *base,char *rel,double price) +int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; + *changedp = 0; if ( base != 0 && rel != 0 && price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { + if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) + *changedp = 1; basepp->myprices[relpp->ind] = price; // ask //relpp->myprices[basepp->ind] = (1. / price); // bid if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 ) @@ -670,7 +673,7 @@ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin) void prices_loop(void *ignore) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - int32_t i,n; double margin,price; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; + int32_t i,n,changed; double margin,price; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -715,14 +718,15 @@ void prices_loop(void *ignore) coinpp->prevday = jdouble(item,"PrevDay"); if ( (margin= coinpp->margins[btcpp->ind]) > SMALLVAL ) { - price = coinpp->bid * (1. - margin); - LP_mypriceset("BTC",name,1. / price); - + price = 1. / coinpp->bid * (1. - margin); + LP_mypriceset(&changed,"BTC",name,price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,"BTC",name,price); } if ( (margin= btcpp->margins[coinpp->ind]) > SMALLVAL ) { price = coinpp->ask * (1. + margin); - LP_mypriceset(name,"BTC",price); + LP_mypriceset(&changed,name,"BTC",price); + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,name,"BTC",price); } } } From 006a597bf601c041f4537954cbb5c4157d31125a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:43:21 +0200 Subject: [PATCH 285/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 243159c09..389fe4672 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -705,7 +705,7 @@ void prices_loop(void *ignore) if ( strncmp("BTC-",name,4) == 0 ) { name += 4; - printf("%s\n",jprint(item,0)); + //printf("%s\n",jprint(item,0)); if ( (coinpp= LP_priceinfofind(name)) != 0 ) { coinpp->high = jdouble(item,"High"); From 8ac602728dc07bbae3156d7717a5c2354f1956b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 16:45:15 +0200 Subject: [PATCH 286/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 65c26cf22..2e8310de8 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -166,7 +166,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) } free_json(txobj); return(0); - } else printf("LP_transactioninit error for %s\n",bits256_str(str,txid)); + } else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); return(-1); } From 51b1a85f96fc736bd4f7d4b9b15193e4bf2b7d8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 22:23:02 +0200 Subject: [PATCH 287/682] Autoprice --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_prices.c | 36 +++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 51c37b5d2..2abe38779 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -206,7 +206,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 389fe4672..96f3e75a1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -643,7 +643,7 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; char str[65]; - printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); + //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { printf("PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); @@ -673,7 +673,7 @@ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin) void prices_loop(void *ignore) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - int32_t i,n,changed; double margin,price; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); + int32_t i,n,changed; double margin,price,minprice; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -716,17 +716,29 @@ void prices_loop(void *ignore) coinpp->bid = jdouble(item,"Bid"); coinpp->ask = jdouble(item,"Ask"); coinpp->prevday = jdouble(item,"PrevDay"); - if ( (margin= coinpp->margins[btcpp->ind]) > SMALLVAL ) + if ( coinpp->bid > SMALLVAL && coinpp->ask > SMALLVAL ) { - price = 1. / coinpp->bid * (1. - margin); - LP_mypriceset(&changed,"BTC",name,price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,"BTC",name,price); - } - if ( (margin= btcpp->margins[coinpp->ind]) > SMALLVAL ) - { - price = coinpp->ask * (1. + margin); - LP_mypriceset(&changed,name,"BTC",price); - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,name,"BTC",price); + price = 0.5 * (coinpp->bid + coinpp->ask); + if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) + { + price = 1. / price * (1. - margin); + if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) + { + LP_mypriceset(&changed,"BTC",name,price); + if ( changed != 0 ) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,"BTC",name,price); + } + } + if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) + { + price *= (1. + margin); + if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) + { + LP_mypriceset(&changed,name,"BTC",price); + if ( changed != 0 ) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,name,"BTC",price); + } + } } } } From e2273302f659684551b1d91c5ee12f3b44960a1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 22:31:54 +0200 Subject: [PATCH 288/682] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ff9d8d1b6..c6ee93264 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -165,6 +165,7 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { + printf("setprice %.8f\n",price); if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); else if ( changed != 0 ) From 88ecc91cd17da10a28805687b55c4afc1e694b34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 22:36:50 +0200 Subject: [PATCH 289/682] Test --- iguana/exchanges/LP_commands.c | 4 +--- iguana/exchanges/LP_ordermatch.c | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index c6ee93264..beeb2913d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -165,11 +165,9 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { - printf("setprice %.8f\n",price); if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); - else if ( changed != 0 ) - return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); + else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } else if ( strcmp(method,"autoprice") == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2abe38779..e6678b00c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -200,6 +200,8 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddstr(reqjson,"method","postprice"); msg = jprint(reqjson,1); LP_broadcast_message(pubsock,base,rel,zero,msg); + printf("broadcast.(%s)\n",msg); + free(msg); return(clonestr("{\"result\":\"success\"}")); } From c1f4333499140e2dc950b9c9134edd2fc3c2a923 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:02:45 +0200 Subject: [PATCH 290/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_ordermatch.c | 1 - iguana/exchanges/LP_prices.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index beeb2913d..b63dfb25b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -95,7 +95,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ setprice(base, rel, price)\n\ -autoprice(base, rel, price, margin)\n\ +autoprice(base, rel, price, margin, type)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ @@ -172,7 +172,7 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"autoprice") == 0 ) { - if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin")) < 0 ) + if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin"),jstr(argjson,"type")) < 0 ) return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e6678b00c..83ad881eb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -201,7 +201,6 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re msg = jprint(reqjson,1); LP_broadcast_message(pubsock,base,rel,zero,msg); printf("broadcast.(%s)\n",msg); - free(msg); return(clonestr("{\"result\":\"success\"}")); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 96f3e75a1..5565b802e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -657,7 +657,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) int32_t LP_autoprices; -int32_t LP_autoprice(char *base,char *rel,double minprice,double margin) +int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *type) { struct LP_priceinfo *basepp,*relpp; if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) From 95ee3ed73b63ef23dcb1454fb59d3338087736fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:02:56 +0200 Subject: [PATCH 291/682] Test --- iguana/exchanges/LP_ordermatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 83ad881eb..2abe38779 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -200,7 +200,6 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddstr(reqjson,"method","postprice"); msg = jprint(reqjson,1); LP_broadcast_message(pubsock,base,rel,zero,msg); - printf("broadcast.(%s)\n",msg); return(clonestr("{\"result\":\"success\"}")); } From eed58679bf486a3b093c9047dce034c4e039915e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:09:05 +0200 Subject: [PATCH 292/682] Test --- iguana/exchanges/autoprice | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index fd4b0b052..4957aa7ab 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,2 +1,3 @@ source userpass curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.01}" From 35cf3c7042ea784346917f512fb1a4c284bef8f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:15:56 +0200 Subject: [PATCH 293/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5565b802e..a45224317 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price = 1. / price * (1. - margin); + price *= (1. - margin); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); From 0d79fe82427f6e21f130625d0b7d3c3b858cea9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:19:54 +0200 Subject: [PATCH 294/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a45224317..d1011b0a3 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price *= (1. - margin); + price *= (1. + margin); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); @@ -731,7 +731,7 @@ void prices_loop(void *ignore) } if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) { - price *= (1. + margin); + price *= (1. - margin); if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,name,"BTC",price); From 16d66dcc1c42dd50cf05a3ae50f4be6f3640893c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:23:15 +0200 Subject: [PATCH 295/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d1011b0a3..2da6ecf02 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price *= (1. + margin); + price *= (1. - margin); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); @@ -731,7 +731,7 @@ void prices_loop(void *ignore) } if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) { - price *= (1. - margin); + price = 1. / (price * (1. + margin)); if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,name,"BTC",price); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 775222e4d..a27203fb9 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -281,7 +281,7 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - printf("%s already ismine\n",address); + //printf("%s already ismine\n",address); } free_json(retjson); } From 73cca9eb9118ef03621cc0cbc96811e69659d924 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:24:22 +0200 Subject: [PATCH 296/682] Test --- iguana/exchanges/LP_nativeDEX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3073531c5..090a3ffcd 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,7 +19,6 @@ // // new features: // stats -// autoprice // autofill // autoutxo @@ -191,7 +190,8 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( duplicate != 0 ) dup++; else uniq++; - printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); + if ( (rand() % 100) == 0 ) + printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( duplicate == 0 ) { if ( i >= 0 ) From 4ebf6ccd89aac2ed51e42cac48ed083fde72346d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:28:29 +0200 Subject: [PATCH 297/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2da6ecf02..c1bad807e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price *= (1. - margin); + price = 1. / (price * (1. - margin)); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); @@ -731,7 +731,7 @@ void prices_loop(void *ignore) } if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) { - price = 1. / (price * (1. + margin)); + price = (price * (1. + margin)); if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,name,"BTC",price); From 197d29ef1d0a60d19570342a8305a2cfa7b1de83 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:33:19 +0200 Subject: [PATCH 298/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c1bad807e..62d156beb 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -731,7 +731,7 @@ void prices_loop(void *ignore) } if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) { - price = (price * (1. + margin)); + price = 1. / (price * (1. + margin)); if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,name,"BTC",price); From ee9b55c6636dd0db4380a5e38b5f359a9d795454 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:35:42 +0200 Subject: [PATCH 299/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 62d156beb..3ceef6889 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price = 1. / (price * (1. - margin)); + price = 1. / (price * (1. + margin)); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); @@ -731,7 +731,7 @@ void prices_loop(void *ignore) } if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) { - price = 1. / (price * (1. + margin)); + price = 1. / (price * (1. - margin)); if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,name,"BTC",price); From 0ea292b0b29ac677ebde700b1e1a8d537dbd6d0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:39:17 +0200 Subject: [PATCH 300/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3ceef6889..3bec51125 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -721,7 +721,7 @@ void prices_loop(void *ignore) price = 0.5 * (coinpp->bid + coinpp->ask); if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) { - price = 1. / (price * (1. + margin)); + price = 1. / (price * (1. - margin)); if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,"BTC",name,price); From d16289d2e85c70326e50fe0c4e5f4c6033e00dde Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Jul 2017 23:51:01 +0200 Subject: [PATCH 301/682] Test --- iguana/exchanges/autoprice | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 4957aa7ab..07049ce78 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,3 +1,3 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.01}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.00001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.00001}" From 5817b4f3b7fd51759a11f21170754ff581eeec18 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 07:56:00 +0200 Subject: [PATCH 302/682] Fixes for chip --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 +++- iguana/exchanges/LP_rpc.c | 4 ++-- iguana/exchanges/coins | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 5db13e2bb..cd3763246 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -235,7 +235,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"VERGE") == 0 ) + if ( strcmp(symbol,"XVG") == 0 ) coin->noimportprivkey_flag = 1; return(LP_userpass(coin->userpass,symbol,assetname,name,name2)); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 090a3ffcd..cb182cd3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,11 +21,13 @@ // stats // autofill // autoutxo +// autoprice for fiat and crypto -> KMD + + // fixes: // -wiftaddr and no flag for importprivkey (VERGE) // -avoid redundant importprivkey -// -KMD: z_sendmany to set nLockTime // -put Atxfee and Btxfee into rememberfiles // bugs" diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a27203fb9..324e52eb1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -324,7 +324,7 @@ int32_t LP_importaddress(char *symbol,char *address) double LP_getestimatedrate(char *symbol) { char buf[512],*retstr; double rate = 20; struct iguana_info *coin = LP_coinfind(symbol); - if ( coin != 0 ) + if ( coin != 0 && (strcmp(coin->symbol,"BTC") == 0 || coin->txfee == 0) ) { sprintf(buf,"[%d]",3); if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"estimatefee",buf)) != 0 ) @@ -336,7 +336,7 @@ double LP_getestimatedrate(char *symbol) } free(retstr); } - } + } else rate = coin->txfee / LP_AVETXSIZE; return(rate); } diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index b8ae596fe..8cf0e6dd0 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From eea266436ee0092ad4d4055c647968abb019953f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 09:22:18 +0200 Subject: [PATCH 303/682] Test --- iguana/exchanges/LP_prices.c | 80 +++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 32 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3bec51125..b440b5e59 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -670,10 +670,25 @@ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *ty return(-1); } +void LP_autopriceset(void *ctx,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) +{ + double margin,minprice; int32_t changed; + if ( (margin= basepp->margins[relpp->ind]) != 0. ) + { + price = 1. / (price * (1. - margin)); + if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) + { + LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); + if ( changed != 0 ) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } + } +} + void prices_loop(void *ignore) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - int32_t i,n,changed; double margin,price,minprice; struct LP_priceinfo *coinpp,*btcpp; char *retstr,*name; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); + int32_t i,n,changed,iter; double margin,price,minprice,kmdbtc; struct LP_priceinfo *coinpp,*refpp,*btcpp; char *retstr,*name,*refcoin; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -695,54 +710,55 @@ void prices_loop(void *ignore) if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); + kmdbtc = 0.; + refcoin = "BTC"; + refpp = btcpp; if ( (array= jarray(&n,retjson,"result")) != 0 ) { - for (i=0; ihigh = jdouble(item,"High"); - coinpp->low = jdouble(item,"Low"); - coinpp->volume = jdouble(item,"Volume"); - coinpp->btcvolume = jdouble(item,"BaseVolume"); - coinpp->last = jdouble(item,"Last"); - coinpp->bid = jdouble(item,"Bid"); - coinpp->ask = jdouble(item,"Ask"); - coinpp->prevday = jdouble(item,"PrevDay"); - if ( coinpp->bid > SMALLVAL && coinpp->ask > SMALLVAL ) + name += 4; + //printf("%s\n",jprint(item,0)); + if ( (coinpp= LP_priceinfofind(name)) != 0 ) { - price = 0.5 * (coinpp->bid + coinpp->ask); - if ( (margin= coinpp->margins[btcpp->ind]) != 0. ) + coinpp->high = jdouble(item,"High"); + coinpp->low = jdouble(item,"Low"); + coinpp->volume = jdouble(item,"Volume"); + coinpp->btcvolume = jdouble(item,"BaseVolume"); + coinpp->last = jdouble(item,"Last"); + coinpp->bid = jdouble(item,"Bid"); + coinpp->ask = jdouble(item,"Ask"); + coinpp->prevday = jdouble(item,"PrevDay"); + if ( coinpp->bid > SMALLVAL && coinpp->ask > SMALLVAL ) { - price = 1. / (price * (1. - margin)); - if ( (minprice= coinpp->minprices[btcpp->ind]) == 0. || price >= minprice ) + price = 0.5 * (coinpp->bid + coinpp->ask); + if ( iter == 0 ) { - LP_mypriceset(&changed,"BTC",name,price); - if ( changed != 0 ) - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,"BTC",name,price); + if ( strcmp(name,"KMD") == 0 ) + kmdbtc = price; } - } - if ( (margin= btcpp->margins[coinpp->ind]) != 0. ) - { - price = 1. / (price * (1. - margin)); - if ( (minprice= btcpp->minprices[coinpp->ind]) == 0. || price >= minprice ) + else { - LP_mypriceset(&changed,name,"BTC",price); - if ( changed != 0 ) - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,name,"BTC",price); + //if ( strcmp(name,"KMD") == 0 ) + continue; } + LP_autopriceset(ctx,refpp,coinpp,price); + LP_autopriceset(ctx,coinpp,refpp,price); } } } } } + refcoin = "KMD"; + if ( kmdbtc == 0. || (refpp= LP_priceinfofind("KMD")) == 0 ) + break; } } free_json(retjson); From a2a655191392a4d0fd805a07a536d4150a95bbdb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 09:28:23 +0200 Subject: [PATCH 304/682] Test --- iguana/exchanges/LP_prices.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b440b5e59..533afeb70 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -670,12 +670,14 @@ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *ty return(-1); } -void LP_autopriceset(void *ctx,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) +void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) { double margin,minprice; int32_t changed; if ( (margin= basepp->margins[relpp->ind]) != 0. ) { - price = 1. / (price * (1. - margin)); + if ( dir > 0 ) + price = 1. / (price * (1. - margin)); + else price = (price * (1. + margin)); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); @@ -688,7 +690,7 @@ void LP_autopriceset(void *ctx,struct LP_priceinfo *relpp,struct LP_priceinfo *b void prices_loop(void *ignore) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - int32_t i,n,changed,iter; double margin,price,minprice,kmdbtc; struct LP_priceinfo *coinpp,*refpp,*btcpp; char *retstr,*name,*refcoin; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); + int32_t i,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp,*btcpp; char *retstr,*name,*refcoin; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -749,8 +751,8 @@ void prices_loop(void *ignore) //if ( strcmp(name,"KMD") == 0 ) continue; } - LP_autopriceset(ctx,refpp,coinpp,price); - LP_autopriceset(ctx,coinpp,refpp,price); + LP_autopriceset(ctx,1,refpp,coinpp,price); + LP_autopriceset(ctx,-1,coinpp,refpp,price); } } } From 6889360bd0001df5628089ff54de215454e408f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 09:32:00 +0200 Subject: [PATCH 305/682] Test --- iguana/exchanges/autoprice | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 07049ce78..1c147dd6f 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,3 +1,3 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.00001}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.00001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" From 8b975488dc21d09b772c7bbc2e28de0767f7b4ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 09:35:19 +0200 Subject: [PATCH 306/682] Test --- iguana/exchanges/LP_prices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 533afeb70..bb59273a1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -748,8 +748,9 @@ void prices_loop(void *ignore) } else { - //if ( strcmp(name,"KMD") == 0 ) + if ( strcmp(name,"KMD") == 0 ) continue; + price /= kmdbtc; } LP_autopriceset(ctx,1,refpp,coinpp,price); LP_autopriceset(ctx,-1,coinpp,refpp,price); From 673fc2a0f4eca46f63116cc052b4bab7724dca4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:02:37 +0200 Subject: [PATCH 307/682] Test --- iguana/exchanges/LP_prices.c | 148 +++++++++++++++++++++-------------- iguana/exchanges/autoprice | 2 + 2 files changed, 92 insertions(+), 58 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index bb59273a1..68f387803 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -26,7 +26,7 @@ struct LP_priceinfo char symbol[16]; uint64_t coinbits; int32_t ind,pad; - double diagval,high,low,volume,btcvolume,last,bid,ask,prevday; // mostly bittrex info + double diagval,high[2],low[2],last[2],bid[2],ask[2]; //volume,btcvolume,prevday; // mostly bittrex info double relvals[LP_MAXPRICEINFOS]; double myprices[LP_MAXPRICEINFOS]; double minprices[LP_MAXPRICEINFOS]; @@ -687,10 +687,90 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ } } -void prices_loop(void *ignore) +void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - int32_t i,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp,*btcpp; char *retstr,*name,*refcoin; cJSON *retjson,*array,*item; void *ctx = bitcoin_ctx(); + //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, + int32_t i,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + //printf("got.(%s)\n",retstr); + kmdbtc = 0.; + refcoin = "BTC"; + refpp = btcpp; + if ( (array= jarray(&n,retjson,trexflag != 0 ? "result" : "Data")) != 0 ) + { + for (iter=0; iter<2; iter++) + { + for (i=0; ihigh[trexflag] = jdouble(item,"High"); + coinpp->low[trexflag] = jdouble(item,"Low"); + //coinpp->volume = jdouble(item,"Volume"); + //coinpp->btcvolume = jdouble(item,"BaseVolume"); + coinpp->last[trexflag] = jdouble(item,trexflag != 0 ? "Last" : "LastPrice"); + coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); + coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); + //coinpp->prevday = jdouble(item,"PrevDay"); + if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) + { + if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) + continue; + else price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); + if ( iter == 0 ) + { + if ( strcmp(name,"KMD") == 0 ) + kmdbtc = price; + } + else + { + if ( strcmp(name,"KMD") == 0 ) + continue; + price /= kmdbtc; + } + LP_autopriceset(ctx,1,refpp,coinpp,price); + LP_autopriceset(ctx,-1,coinpp,refpp,price); + } + } + } + } + } + refcoin = "KMD"; + if ( kmdbtc == 0. || (refpp= LP_priceinfofind("KMD")) == 0 ) + break; + } + } + free_json(retjson); + } +} + +void prices_loop(void *ignore) +{ + char *retstr; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -709,63 +789,15 @@ void prices_loop(void *ignore) sleep(60); continue; } - if ( (retjson= cJSON_Parse(retstr)) != 0 ) + LP_pricesparse(ctx,1,retstr,btcpp); + free(retstr); + if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) { - //printf("got.(%s)\n",retstr); - kmdbtc = 0.; - refcoin = "BTC"; - refpp = btcpp; - if ( (array= jarray(&n,retjson,"result")) != 0 ) - { - for (iter=0; iter<2; iter++) - { - for (i=0; ihigh = jdouble(item,"High"); - coinpp->low = jdouble(item,"Low"); - coinpp->volume = jdouble(item,"Volume"); - coinpp->btcvolume = jdouble(item,"BaseVolume"); - coinpp->last = jdouble(item,"Last"); - coinpp->bid = jdouble(item,"Bid"); - coinpp->ask = jdouble(item,"Ask"); - coinpp->prevday = jdouble(item,"PrevDay"); - if ( coinpp->bid > SMALLVAL && coinpp->ask > SMALLVAL ) - { - price = 0.5 * (coinpp->bid + coinpp->ask); - if ( iter == 0 ) - { - if ( strcmp(name,"KMD") == 0 ) - kmdbtc = price; - } - else - { - if ( strcmp(name,"KMD") == 0 ) - continue; - price /= kmdbtc; - } - LP_autopriceset(ctx,1,refpp,coinpp,price); - LP_autopriceset(ctx,-1,coinpp,refpp,price); - } - } - } - } - } - refcoin = "KMD"; - if ( kmdbtc == 0. || (refpp= LP_priceinfofind("KMD")) == 0 ) - break; - } - } - free_json(retjson); + printf("error getting marketsummaries\n"); + sleep(60); + continue; } + LP_pricesparse(ctx,0,retstr,btcpp); free(retstr); sleep(60); } diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 1c147dd6f..d49532fa7 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,3 +1,5 @@ source userpass curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.0001}" From 0b5834def22c70634311ebaf2dbc185f81e69fa7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:17:06 +0200 Subject: [PATCH 308/682] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 68f387803..2458bf636 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -723,6 +723,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo break; symbol[i] = 0; } + printf("trexflag.%d %s\n",trexflag,symbol); if ( symbol[0] != 0 ) { //printf("%s\n",jprint(item,0)); From addcdb057d8b8d3d16ad82976d486aa1c80c910e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:20:41 +0200 Subject: [PATCH 309/682] Test --- iguana/exchanges/LP_prices.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2458bf636..b07710cfc 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -691,7 +691,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + int32_t i,j,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); @@ -718,10 +718,10 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo } else { - for (i=0; i Date: Sun, 16 Jul 2017 10:24:04 +0200 Subject: [PATCH 310/682] Test --- iguana/exchanges/LP_prices.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b07710cfc..e2c34661e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -722,8 +722,9 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo if ( (symbol[j]= name[j]) == '/' ) break; symbol[j] = 0; + if ( strcmp(name+j+1,"BTC") != 0 ) + continue; } - printf("trexflag.%d %s\n",trexflag,symbol); if ( symbol[0] != 0 ) { //printf("%s\n",jprint(item,0)); @@ -751,6 +752,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo { if ( strcmp(name,"KMD") == 0 ) continue; + printf("trexflag.%d %s %.8f %.8f\n",trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; } LP_autopriceset(ctx,1,refpp,coinpp,price); From 77057f60fef0f9a61c5912305d75dc924abc90cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:29:37 +0200 Subject: [PATCH 311/682] Test --- iguana/exchanges/LP_prices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index e2c34661e..c0388c695 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -738,6 +738,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); //coinpp->prevday = jdouble(item,"PrevDay"); + printf("trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) { if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) From 19c1bfdb0b645e60ecc915aa513c7e7cc0b9dbff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:38:48 +0200 Subject: [PATCH 312/682] Test --- iguana/exchanges/LP_prices.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c0388c695..dfc2be149 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -738,11 +738,14 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); //coinpp->prevday = jdouble(item,"PrevDay"); - printf("trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); + printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) { if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) + { + printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); continue; + } else price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); if ( iter == 0 ) { @@ -753,7 +756,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo { if ( strcmp(name,"KMD") == 0 ) continue; - printf("trexflag.%d %s %.8f %.8f\n",trexflag,symbol,price,price/kmdbtc); + printf("iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; } LP_autopriceset(ctx,1,refpp,coinpp,price); From 442a4ebeafc0c755a92f1ed5015108e99df31c27 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:42:49 +0200 Subject: [PATCH 313/682] Test --- iguana/exchanges/LP_prices.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index dfc2be149..3b4034f17 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -749,14 +749,14 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo else price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); if ( iter == 0 ) { - if ( strcmp(name,"KMD") == 0 ) + if ( strcmp(symbol,"KMD") == 0 ) kmdbtc = price; } else { - if ( strcmp(name,"KMD") == 0 ) + if ( strcmp(symbol,"KMD") == 0 ) continue; - printf("iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,price,price/kmdbtc); + printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; } LP_autopriceset(ctx,1,refpp,coinpp,price); From 78f8b30557b473e04bc2207a08c2462785a9471f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:46:37 +0200 Subject: [PATCH 314/682] Test --- iguana/exchanges/LP_prices.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3b4034f17..8f0d7a0a2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -738,15 +738,10 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); //coinpp->prevday = jdouble(item,"PrevDay"); - printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); + //printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) { - if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) - { - printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); - continue; - } - else price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); + price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); if ( iter == 0 ) { if ( strcmp(symbol,"KMD") == 0 ) @@ -759,6 +754,11 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; } + if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) + { + //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); + continue; + } LP_autopriceset(ctx,1,refpp,coinpp,price); LP_autopriceset(ctx,-1,coinpp,refpp,price); } From 5aa03fdf0e70bfde771d6a2ac1b243ffc8cb4a93 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:50:37 +0200 Subject: [PATCH 315/682] Test --- iguana/exchanges/autoprice | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index d49532fa7..6130f7480 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -1,5 +1,5 @@ source userpass curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"BTC\",\"margin\":0.0001}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.0001}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.0001}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" From b6193c2811d7464a0cdea1e7228a35408dc2ac1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 10:50:52 +0200 Subject: [PATCH 316/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8f0d7a0a2..b3b598a35 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -751,7 +751,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo { if ( strcmp(symbol,"KMD") == 0 ) continue; - printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); + //printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; } if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) From a82f63a8159b8465d964802e33b0a10a63d4b9a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 11:04:54 +0200 Subject: [PATCH 317/682] Test --- iguana/exchanges/LP_prices.c | 10 +++++++++- iguana/exchanges/LP_rpc.c | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b3b598a35..baff3c599 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -777,7 +777,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo void prices_loop(void *ignore) { - char *retstr; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson; int32_t i; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -806,6 +806,14 @@ void prices_loop(void *ignore) } LP_pricesparse(ctx,0,retstr,btcpp); free(retstr); + for (i=0; i<32; i++) + { + if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + { + printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + free_json(retjson); + } + } sleep(60); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 324e52eb1..54007d46a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -217,10 +217,19 @@ cJSON *LP_getmempool(char *symbol) return(bitcoin_json(coin,"getrawmempool","[]")); } +cJSON *LP_paxprice(char *fiat) +{ + char buf[128],lfiat[65]; struct iguana_info *coin = LP_coinfind("KMD"); + strcpy(lfiat,fiat); + tolowercase(lfiat); + sprintf(buf,"[\"%s\", \"kmd\"]",lfiat); + return(bitcoin_json(coin,"paxprice",buf)); +} + cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { char buf[128],str[65]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"\"%s\", %d, true",bits256_str(str,txid),vout); + sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout); return(bitcoin_json(coin,"gettxout",buf)); } @@ -248,7 +257,7 @@ cJSON *LP_getblockhashstr(char *symbol,char *blockhashstr) cJSON *LP_listunspent(char *symbol,char *coinaddr) { char buf[128]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"0, 99999999, [\"%s\"]",coinaddr); + sprintf(buf,"[0, 99999999, [\"%s\"]]",coinaddr); return(bitcoin_json(coin,"listunspent",buf)); } @@ -264,7 +273,7 @@ cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t ski cJSON *LP_validateaddress(char *symbol,char *address) { char buf[512]; struct iguana_info *coin = LP_coinfind(symbol); - sprintf(buf,"\"%s\"",address); + sprintf(buf,"[\"%s\"]",address); return(bitcoin_json(coin,"validateaddress",buf)); } From 246d8478584d0a05edcbd2fcdcd15e84e84a17e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 11:05:41 +0200 Subject: [PATCH 318/682] Test --- iguana/exchanges/autoprice | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 6130f7480..841b49936 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -3,3 +3,5 @@ curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"BTC\",\"rel\":\"KMD\",\"margin\":0.0001}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"HUSH\",\"margin\":0.01}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" From 4059b4a473d9424a9bd9f327242e3689196fafa5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 11:10:00 +0200 Subject: [PATCH 319/682] Test --- iguana/exchanges/LP_prices.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index baff3c599..ff04f630a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -777,7 +777,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo void prices_loop(void *ignore) { - char *retstr; cJSON *retjson; int32_t i; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson; int32_t i; double price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -806,12 +806,21 @@ void prices_loop(void *ignore) } LP_pricesparse(ctx,0,retstr,btcpp); free(retstr); - for (i=0; i<32; i++) + if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) { - if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + for (i=0; i<32; i++) { - printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); - free_json(retjson); + if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) + { + if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + { + printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + price = jdouble(retjson,"invprice"); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); + free_json(retjson); + } + } } } sleep(60); From bb66ae0ff4dd5bff19c766e28d39ea59f1a13ab3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 11:16:01 +0200 Subject: [PATCH 320/682] Test --- iguana/exchanges/LP_prices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ff04f630a..42ab2c242 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -678,9 +678,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); + printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); + printf("changed.%d\n",changed); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } From d876fb3ae9597a5f2bc03ad896f2fa74f798fa1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 11:18:45 +0200 Subject: [PATCH 321/682] Test --- iguana/exchanges/LP_prices.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 42ab2c242..c2769a4d1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -678,11 +678,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); - printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); + //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - printf("changed.%d\n",changed); + //printf("changed.%d\n",changed); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } @@ -817,7 +817,7 @@ void prices_loop(void *ignore) if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) { printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); - price = jdouble(retjson,"invprice"); + price = jdouble(retjson,"price"); LP_autopriceset(ctx,1,kmdpp,fiatpp,price); LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); free_json(retjson); From 1109645c88b7f74a5189dcbf9bc7543007b30893 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:08:06 +0200 Subject: [PATCH 322/682] Test --- iguana/exchanges/LP_prices.c | 20 ++++++++++++++++---- iguana/exchanges/LP_rpc.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index c2769a4d1..b288daed1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -689,11 +689,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ } } -void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) +double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,j,n,iter; double price,kmdbtc; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + int32_t i,j,n,iter; double price,kmdbtc,nxtkmd; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); @@ -755,6 +755,8 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo continue; //printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; + if ( strcmp(symbol,"NXT") == 0 ) + nxtkmd = price; } if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) { @@ -775,11 +777,12 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo } free_json(retjson); } + return(nxtkmd); } void prices_loop(void *ignore) { - char *retstr; cJSON *retjson; int32_t i; double price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); + char *retstr,*assetid; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -798,7 +801,7 @@ void prices_loop(void *ignore) sleep(60); continue; } - LP_pricesparse(ctx,1,retstr,btcpp); + nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); free(retstr); if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) { @@ -825,6 +828,15 @@ void prices_loop(void *ignore) } } } + if ( nxtkmd > SMALLVAL ) + { + assetid = "12071612744977229797"; + if ( (retjson= LP_assethbla(assetid)) != 0 ) + { + printf("%s -> (%s) nxtkmd %.8f\n",assetid,jprint(retjson,0),nxtkmd); + free_json(retjson); + } + } sleep(60); } } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 54007d46a..787744af5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -205,6 +205,40 @@ void LP_unspents_mark(char *symbol,cJSON *vins) printf("LOCK (%s)\n",jprint(vins,0)); } +char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.207.76", "188.174.110.224", "91.235.72.49", "213.144.130.91", "209.222.98.250", "216.155.128.10", "178.33.203.157", "162.243.122.251", "69.163.47.173", "193.151.106.129", "78.94.2.74", "192.3.196.10", "173.33.112.87", "104.198.173.28", "35.184.154.126", "174.140.167.239", "23.88.113.131", "198.71.84.173", "178.150.207.53", "23.88.61.53", "192.157.233.106", "192.157.241.212", "23.89.192.88", "23.89.200.27", "192.157.241.139", "23.89.200.63", "23.89.192.98", "163.172.214.102", "176.9.85.5", "80.150.243.88", "80.150.243.92", "80.150.243.98", "109.70.186.198", "146.148.84.237", "104.155.56.82", "104.197.157.140", "37.48.73.249", "146.148.77.226", "84.57.170.200", "107.161.145.131", "80.150.243.97", "80.150.243.93", "80.150.243.100", "80.150.243.95", "80.150.243.91", "80.150.243.99", "80.150.243.96", "93.231.187.177", "212.237.23.85", "35.158.179.254", "46.36.66.41", "185.170.113.79", "163.172.68.112", "78.47.35.210", "77.90.90.75", "94.177.196.134", "212.237.22.215", "94.177.234.11", "167.160.180.199", "54.68.189.9", "94.159.62.14", "195.181.221.89", "185.33.145.94", "195.181.209.245", "195.181.221.38", "195.181.221.162", "185.33.145.12", "185.33.145.176", "178.79.128.235", "94.177.214.120", "94.177.199.41", "94.177.214.200", "94.177.213.201", "212.237.13.162", "195.181.221.236", "195.181.221.185", "185.28.103.187", "185.33.146.244", "217.61.123.71", "195.181.214.45", "195.181.212.99", "195.181.214.46", "195.181.214.215", "195.181.214.68", "217.61.123.118", "195.181.214.79", "217.61.123.14", "217.61.124.100", "195.181.214.111", "85.255.0.176", "81.2.254.116", "217.61.123.184", "195.181.212.231", "94.177.214.110", "195.181.209.164", "104.129.56.238", "85.255.13.64", "167.160.180.206", "217.61.123.226", "167.160.180.208", "93.186.253.127", "212.237.6.208", "94.177.207.190", "217.61.123.119", "85.255.1.245", "217.61.124.157", "37.59.57.141", "167.160.180.58", "104.223.53.14", "217.61.124.69", "195.181.212.103", "85.255.13.141", "104.207.133.204", "71.90.7.107", "107.150.18.108", "23.94.134.161", "80.150.243.13", "80.150.243.11", "185.81.165.52", "80.150.243.8" }; + + +cJSON *LP_assethbla(char *assetid) +{ + char url[1024],*retstr; cJSON *bid=0,*ask=0,*retjson; + sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + { + bid = cJSON_Parse(retstr); + free(retstr); + } + sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getAskOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); + if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) + { + ask = cJSON_Parse(retstr); + free(retstr); + } + retjson = cJSON_CreateObject(); + if ( bid != 0 && ask != 0 ) + { + jadd(retjson,"bid",bid); + jadd(retjson,"ask",ask); + } + else + { + if ( bid != 0 ) + free_json(bid); + if ( ask != 0 ) + free_json(ask); + } + return(retjson); +} + cJSON *LP_getinfo(char *symbol) { struct iguana_info *coin = LP_coinfind(symbol); From b260dabb75b3cec28bb6b9367339de4bf3b42891 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:13:16 +0200 Subject: [PATCH 323/682] Test --- iguana/exchanges/LP_prices.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b288daed1..9d15ecd60 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -693,7 +693,7 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,j,n,iter; double price,kmdbtc,nxtkmd; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + int32_t i,j,n,iter; double price,kmdbtc,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); @@ -730,6 +730,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf if ( symbol[0] != 0 ) { //printf("%s\n",jprint(item,0)); + if ( iter == 1 && kmdbtc > SMALLVAL && strcmp(symbol,"NXT") == 0 ) + nxtkmd = 0.5 * (jdouble(item,trexflag != 0 ? "Bid" : "BidPrice") + jdouble(item,trexflag != 0 ? "Ask" : "AskPrice")) / kmdbtc; if ( (coinpp= LP_priceinfofind(symbol)) != 0 ) { coinpp->high[trexflag] = jdouble(item,"High"); @@ -755,8 +757,6 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf continue; //printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); price /= kmdbtc; - if ( strcmp(symbol,"NXT") == 0 ) - nxtkmd = price; } if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) { From b95bdf3e5c26947138110d06eda811e192e8fe67 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:19:07 +0200 Subject: [PATCH 324/682] Test --- iguana/exchanges/LP_prices.c | 10 ++++++---- iguana/exchanges/LP_rpc.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 9d15ecd60..e422931d2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -693,7 +693,7 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf { //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,j,n,iter; double price,kmdbtc,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + int32_t i,j,n,iter; double price,kmdbtc,bid,ask,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; if ( (retjson= cJSON_Parse(retstr)) != 0 ) { //printf("got.(%s)\n",retstr); @@ -730,8 +730,10 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf if ( symbol[0] != 0 ) { //printf("%s\n",jprint(item,0)); + bid = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); + ask = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); if ( iter == 1 && kmdbtc > SMALLVAL && strcmp(symbol,"NXT") == 0 ) - nxtkmd = 0.5 * (jdouble(item,trexflag != 0 ? "Bid" : "BidPrice") + jdouble(item,trexflag != 0 ? "Ask" : "AskPrice")) / kmdbtc; + nxtkmd = 0.5 * (bid + ask) / kmdbtc; if ( (coinpp= LP_priceinfofind(symbol)) != 0 ) { coinpp->high[trexflag] = jdouble(item,"High"); @@ -739,8 +741,8 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf //coinpp->volume = jdouble(item,"Volume"); //coinpp->btcvolume = jdouble(item,"BaseVolume"); coinpp->last[trexflag] = jdouble(item,trexflag != 0 ? "Last" : "LastPrice"); - coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); - coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); + coinpp->bid[trexflag] = bid; + coinpp->ask[trexflag] = ask; //coinpp->prevday = jdouble(item,"PrevDay"); //printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 787744af5..a9846086d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -210,7 +210,7 @@ char *NXTnodes[] = { "62.75.159.113", "91.44.203.238", "82.114.88.225", "78.63.2 cJSON *LP_assethbla(char *assetid) { - char url[1024],*retstr; cJSON *bid=0,*ask=0,*retjson; + char url[1024],*retstr; int32_t n; cJSON *array,*bid=0,*ask=0,*retjson; sprintf(url,"http://%s:7876/nxt?=%%2Fnxt&requestType=getBidOrders&asset=%s&firstIndex=0&lastIndex=0",NXTnodes[rand() % (sizeof(NXTnodes)/sizeof(*NXTnodes))],assetid); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) { @@ -226,16 +226,15 @@ cJSON *LP_assethbla(char *assetid) retjson = cJSON_CreateObject(); if ( bid != 0 && ask != 0 ) { - jadd(retjson,"bid",bid); - jadd(retjson,"ask",ask); - } - else - { - if ( bid != 0 ) - free_json(bid); - if ( ask != 0 ) - free_json(ask); + if ( (array= jarray(&n,bid,"bidOrders")) != 0 ) + jadd(retjson,"bid",jduplicate(jitem(array,0))); + if ( (array= jarray(&n,bid,"askOrders")) != 0 ) + jadd(retjson,"ask",jduplicate(jitem(array,0))); } + if ( bid != 0 ) + free_json(bid); + if ( ask != 0 ) + free_json(ask); return(retjson); } From e119b6c3fced1dd93c2ee5819c7ddf961e5ad97c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:24:02 +0200 Subject: [PATCH 325/682] Test --- iguana/exchanges/LP_prices.c | 26 +++++++++++++++++++++----- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index e422931d2..33e11eee7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -782,9 +782,23 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf return(nxtkmd); } +static char *assetids[][2] = +{ + { "12071612744977229797", "UNITY" }, + { "15344649963748848799", "DEX" }, + { "6883271355794806507", "PANGEA" }, + { "17911762572811467637", "JUMBLR" }, + { "17083334802666450484", "BET" }, + { "13476425053110940554", "CRYPTO" }, + { "6932037131189568014", "HODL" }, + { "3006420581923704757", "SHARK" }, + { "17571711292785902558", "BOTS" }, + { "10524562908394749924", "MGW" }, +}; + void prices_loop(void *ignore) { - char *retstr,*assetid; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -832,11 +846,13 @@ void prices_loop(void *ignore) } if ( nxtkmd > SMALLVAL ) { - assetid = "12071612744977229797"; - if ( (retjson= LP_assethbla(assetid)) != 0 ) + for (i=0; i (%s) nxtkmd %.8f\n",assetid,jprint(retjson,0),nxtkmd); - free_json(retjson); + if ( (retjson= LP_assethbla(assetids[i][0])) != 0 ) + { + printf("%s %s -> (%s) nxtkmd %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd); + free_json(retjson); + } } } sleep(60); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index a9846086d..2a86c583a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -228,7 +228,7 @@ cJSON *LP_assethbla(char *assetid) { if ( (array= jarray(&n,bid,"bidOrders")) != 0 ) jadd(retjson,"bid",jduplicate(jitem(array,0))); - if ( (array= jarray(&n,bid,"askOrders")) != 0 ) + if ( (array= jarray(&n,ask,"askOrders")) != 0 ) jadd(retjson,"ask",jduplicate(jitem(array,0))); } if ( bid != 0 ) From 3c185af5a2bd26d20be0e118137c01ed0cd3ad33 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:38:05 +0200 Subject: [PATCH 326/682] Test --- iguana/exchanges/LP_prices.c | 46 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 33e11eee7..6aaecad19 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -782,23 +782,23 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf return(nxtkmd); } -static char *assetids[][2] = -{ - { "12071612744977229797", "UNITY" }, - { "15344649963748848799", "DEX" }, - { "6883271355794806507", "PANGEA" }, - { "17911762572811467637", "JUMBLR" }, - { "17083334802666450484", "BET" }, - { "13476425053110940554", "CRYPTO" }, - { "6932037131189568014", "HODL" }, - { "3006420581923704757", "SHARK" }, - { "17571711292785902558", "BOTS" }, - { "10524562908394749924", "MGW" }, +static char *assetids[][3] = +{ + { "12071612744977229797", "UNITY", "10000" }, + { "15344649963748848799", "DEX", "1" }, + { "6883271355794806507", "PANGEA", "10000" }, + { "17911762572811467637", "JUMBLR", "10000" }, + { "17083334802666450484", "BET", "1" }, + { "13476425053110940554", "CRYPTO", "1000" }, + { "6932037131189568014", "HODL", "1" }, + { "3006420581923704757", "SHARK", "10000" }, + { "17571711292785902558", "BOTS", "1" }, + { "10524562908394749924", "MGW", "1" }, }; void prices_loop(void *ignore) { - char *retstr; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp,*nxtpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( LP_autoprices == 0 ) @@ -848,10 +848,24 @@ void prices_loop(void *ignore) { for (i=0; i (%s) nxtkmd %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd); - free_json(retjson); + price = 0.; + bidsatoshis = asksatoshis = 0; + if ( (retjson= LP_assethbla(assetids[i][0])) != 0 ) + { + if ( (bid= jobj(retjson,"bid")) != 0 && (ask= jobj(retjson,"ask")) != 0 ) + { + bidsatoshis = j64bits(bid,"priceNQT") * atoi(assetids[i][2]); + asksatoshis = j64bits(ask,"priceNQT") * atoi(assetids[i][2]); + if ( bidsatoshis != 0 && asksatoshis != 0 ) + price = dstr(bidsatoshis + asksatoshis) * nxtkmd; + } + LP_autopriceset(ctx,1,kmdpp,nxtpp,price); + LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); + printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,dstr(bidsatoshis + asksatoshis),price); + free_json(retjson); + } } } } From 8e8d429fc547418d2dc8074afd0de09eb8436bc6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:43:34 +0200 Subject: [PATCH 327/682] Test --- iguana/exchanges/LP_prices.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6aaecad19..3a8389183 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -678,11 +678,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); - //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); + printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - //printf("changed.%d\n",changed); + printf("changed.%d\n",changed); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } @@ -788,7 +788,7 @@ static char *assetids[][3] = { "15344649963748848799", "DEX", "1" }, { "6883271355794806507", "PANGEA", "10000" }, { "17911762572811467637", "JUMBLR", "10000" }, - { "17083334802666450484", "BET", "1" }, + { "17083334802666450484", "BET", "10000" }, { "13476425053110940554", "CRYPTO", "1000" }, { "6932037131189568014", "HODL", "1" }, { "3006420581923704757", "SHARK", "10000" }, @@ -859,11 +859,11 @@ void prices_loop(void *ignore) bidsatoshis = j64bits(bid,"priceNQT") * atoi(assetids[i][2]); asksatoshis = j64bits(ask,"priceNQT") * atoi(assetids[i][2]); if ( bidsatoshis != 0 && asksatoshis != 0 ) - price = dstr(bidsatoshis + asksatoshis) * nxtkmd; + price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } LP_autopriceset(ctx,1,kmdpp,nxtpp,price); LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); - printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,dstr(bidsatoshis + asksatoshis),price); + //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } } From f5edc6694e24524d398332755faf6567673babd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:47:12 +0200 Subject: [PATCH 328/682] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/autoprice | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 3a8389183..a76e7b7f8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -863,7 +863,7 @@ void prices_loop(void *ignore) } LP_autopriceset(ctx,1,kmdpp,nxtpp,price); LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); - //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,dstr(bidsatoshis + asksatoshis),price); + printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } } diff --git a/iguana/exchanges/autoprice b/iguana/exchanges/autoprice index 841b49936..e612d19a9 100755 --- a/iguana/exchanges/autoprice +++ b/iguana/exchanges/autoprice @@ -5,3 +5,5 @@ curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\ curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"HUSH\",\"rel\":\"KMD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"USD\",\"margin\":0.01}" curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"USD\",\"rel\":\"KMD\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"JUMBLR\",\"margin\":0.01}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"JUMBLR\",\"rel\":\"KMD\",\"margin\":0.01}" From 10956d8920ca6b5cfa8b92a84219417f4eeb2ca8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:50:36 +0200 Subject: [PATCH 329/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a76e7b7f8..4dc32bed3 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -678,11 +678,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); - printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); + //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - printf("changed.%d\n",changed); + //printf("changed.%d\n",changed); if ( changed != 0 ) LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); } From d8a8d21e52f45926138e918c8ab988138813aff6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 12:55:42 +0200 Subject: [PATCH 330/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4dc32bed3..487db103a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -835,7 +835,7 @@ void prices_loop(void *ignore) { if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) { - printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); price = jdouble(retjson,"price"); LP_autopriceset(ctx,1,kmdpp,fiatpp,price); LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); @@ -863,7 +863,7 @@ void prices_loop(void *ignore) } LP_autopriceset(ctx,1,kmdpp,nxtpp,price); LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); - printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); + //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); free_json(retjson); } } From 97984b216504cb874a44237ac6f0cb0b899db7dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Jul 2017 21:32:21 +0200 Subject: [PATCH 331/682] BTX --- iguana/exchanges/LP_nativeDEX.c | 5 +---- iguana/exchanges/coins | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cb182cd3e..bd03aec25 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,10 +20,7 @@ // new features: // stats // autofill -// autoutxo -// autoprice for fiat and crypto -> KMD - - +// autoutxo // fixes: // -wiftaddr and no flag for importprivkey (VERGE) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 8cf0e6dd0..16bd30641 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From df4e37f1696b4b1c0c23bc58a32c73e988811d7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Jul 2017 13:04:53 +0200 Subject: [PATCH 332/682] Add MAC coin --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 16bd30641..2b6d9ff6e 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From fe5f4427496ab89e208c0a13b1abb77ef4cc58c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:35:48 +0200 Subject: [PATCH 333/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_include.h | 3 + iguana/exchanges/LP_nativeDEX.c | 23 ++---- iguana/exchanges/LP_portfolio.c | 111 +++++++++++++++++++++++++++++ iguana/exchanges/LP_rpc.c | 39 +--------- iguana/exchanges/LP_statemachine.c | 53 ++++++++++++++ 6 files changed, 174 insertions(+), 57 deletions(-) create mode 100644 iguana/exchanges/LP_portfolio.c diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index cd3763246..7bb23501e 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -158,7 +158,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c LP_userpassfp(symbol,username,password,fp); sprintf(userpass,"%s:%s",username,password); fclose(fp); - if ( 0 ) + if ( 1 ) printf("LP_statefname.(%s) <- %s %s %s (%s)\n",fname,name,symbol,assetname,userpass); return((int32_t)strlen(userpass)); } else printf("cant open.(%s)\n",fname); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 3242c4e5f..b42cc8770 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -182,6 +182,9 @@ struct iguana_info uint32_t counter,inactive,lastmempool,lastgetinfo; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; + // portfolio + double price_kmd; + uint64_t maxamount,kmd_equiv,goal,balanceA,balanceB,valuesumA,valuesumB; }; struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bd03aec25..562c8cf82 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -23,11 +23,11 @@ // autoutxo // fixes: -// -wiftaddr and no flag for importprivkey (VERGE) +// -wiftaddr and no flag for importprivkey (XVG) // -avoid redundant importprivkey // -put Atxfee and Btxfee into rememberfiles -// bugs" +// bugs: // false detection of bobreclaim // unduplicated bugs: @@ -37,7 +37,7 @@ #include #include "LP_include.h" -portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex; +portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex; int32_t LP_canbind; struct LP_utxoinfo *LP_utxoinfos[2],*LP_utxoinfos2[2]; @@ -98,6 +98,7 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_ #include "LP_utxos.c" #include "LP_forwarding.c" #include "LP_ordermatch.c" +#include "LP_portfolio.c" #include "LP_messages.c" #include "LP_commands.c" @@ -636,6 +637,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu portable_mutex_init(&LP_coinmutex); portable_mutex_init(&LP_pubkeymutex); portable_mutex_init(&LP_messagemutex); + portable_mutex_init(&LP_portfoliomutex); LP_sessionid = (uint32_t)time(NULL); printf("getting myipaddr sessionid.%u\n",LP_sessionid); if ( system("curl -s4 checkip.amazonaws.com > /tmp/myipaddr") == 0 ) @@ -713,21 +715,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu //fprintf(stderr,"."); if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport,passphrase) == 0 ) usleep(1000000 / MAINLOOP_PERSEC); - /*if ( LP_canbind == 0 ) - { - //printf("check deadman %u vs %u\n",LP_deadman_switch,(uint32_t)time(NULL)); - if ( LP_deadman_switch < time(NULL)-PSOCK_KEEPALIVE ) - { - printf("DEAD man's switch %u activated at %u lag.%d, register forwarding again\n",LP_deadman_switch,(uint32_t)time(NULL),(uint32_t)(time(NULL) - LP_deadman_switch)); - if ( pullsock >= 0 ) - nn_close(pullsock); - pullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); - LP_deadman_switch = (uint32_t)time(NULL); - strcpy(LP_publicaddr,pushaddr); - LP_publicport = mypullport; - LP_forwarding_register(LP_mypubkey,pushaddr,mypullport,MAX_PSOCK_PORT); - } - }*/ } } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c new file mode 100644 index 000000000..957dfa001 --- /dev/null +++ b/iguana/exchanges/LP_portfolio.c @@ -0,0 +1,111 @@ + +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ +// +// LP_portfolio.c +// marketmaker +// + +cJSON *LP_portfolio_entry(struct iguana_info *coin,uint64_t kmdsum) +{ + cJSON *item = cJSON_CreateObject(); + jaddstr(item,"coin",coin->symbol); + jaddnum(item,"amount",dstr(coin->maxamount)); + jaddnum(item,"price",coin->price_kmd); + jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv)); + jaddnum(item,"kmdsum",dstr(kmdsum)); + jaddnum(item,"goal",dstr(coin->goal)); + if ( kmdsum > 0 ) + jaddnum(item,"perc",(double)coin->kmd_equiv/ kmdsum); + jaddnum(item,"balanceA",dstr(coin->balanceA)); + jaddnum(item,"valuesumA",dstr(coin->valuesumA)); + jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); + jaddnum(item,"balanceB",dstr(coin->balanceB)); + jaddnum(item,"valuesumB",dstr(coin->valuesumB)); + jaddnum(item,"bobutil",100. * (double)coin->balanceB/coin->valuesumB); + return(item); +} + +uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) +{ + cJSON *array,*item; int32_t i,n; uint64_t valuesum,satoshisum; + valuesum = satoshisum = 0; + if ( (array= LP_inventory(symbol,iambob)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 && is_cJSON_Array(array) != 0 ) + { + for (i=0; ibalanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); + coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); + if ( strcmp(coin->symbol,"KMD") != 0 ) + coin->price_kmd = LP_price(coin->symbol,"KMD"); + else coin->price_kmd = 1.; + coin->maxamount = coin->valuesumA; + if ( coin->valuesumB > coin->maxamount ) + coin->maxamount = coin->valuesumB; + coin->kmd_equiv = coin->maxamount * coin->price_kmd; + kmdsum += coin->kmd_equiv; + } else jaddi(array,LP_portfolio_entry(coin,kmdsum)); + } + } + jaddstr(retjson,"result","success"); + jaddnum(retjson,"kmd_equiv",kmdsum); + jadd(retjson,"portfolio",array); + return(jprint(retjson,1)); +} + +struct LP_portfolioinfo *LP_portfoliofind(char *symbol) +{ + struct LP_portfolioinfo *ptr; + portable_mutex_lock(&LP_portfoliomutex); + HASH_FIND(hh,LP_portfolios,symbol,strlen(symbol),ptr); + portable_mutex_unlock(&LP_portfoliomutex); + return(ptr); +} + +struct LP_portfolioinfo *LP_portfolioadd(char *symbol,uint64_t goal) +{ + struct LP_portfolioinfo *ptr = calloc(1,sizeof(*ptr)); + safecopy(ptr->symbol,symbol,sizeof(ptr->symbol)); + ptr->goal = goal; + portable_mutex_lock(&LP_portfoliomutex); + HASH_ADD_KEYPTR(hh,LP_portfolios,ptr->symbol,strlen(ptr->symbol),ptr); + portable_mutex_unlock(&LP_portfoliomutex); + return(ptr); +} + diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2a86c583a..2d29bf41c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -94,43 +94,6 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port, //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } -/*char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) -{ - char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2; - if ( (retstr= LP_isitme(destip,destport)) != 0 ) - return(retstr); - if ( utxo->iambob == 0 ) - { - printf("issue_LP_notifyutxo trying to send Alice %s/v%d\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout); - return(0); - } - u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; - if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) > 0 ) - { - sprintf(url,"http://%s:%u/api/stats/notified?iambob=%d&pubkey=%s&coin=%s&txid=%s&vout=%d&value=%llu&txid2=%s&vout2=%d&value2=%llu&script=%s&address=%s×tamp=%u&gui=%s",destip,destport,utxo->iambob,bits256_str(str3,utxo->pubkey),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,(long long)utxo->payment.value,bits256_str(str2,utxo->deposit.txid),utxo->deposit.vout,(long long)utxo->deposit.value,utxo->spendscript,utxo->coinaddr,(uint32_t)time(NULL),utxo->gui); - if ( strlen(url) > 1024 ) - printf("WARNING long url.(%s)\n",url); - return(LP_issue_curl("notifyutxo",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); - } - else - { - printf("issue_LP_notifyutxo: ineligible utxo iambob.%d %.8f %.8f\n",utxo->iambob,dstr(val),dstr(val2)); - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); - return(0); - } -}*/ - -/*char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) -{ - char url[512],str[65]; - sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey)); - //printf("getutxo.(%s)\n",url); - return(LP_issue_curl("lookup",destip,destport,url)); - //return(issue_curlt(url,LP_HTTP_TIMEOUT)); -}*/ - char *issue_LP_getprices(char *destip,uint16_t destport) { char url[512]; @@ -330,7 +293,7 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) if ( doneflag == 0 ) { if ( coin->noimportprivkey_flag != 0 ) - sprintf(buf,"[\"%s\", \"%s\"]",wifstr,label); + sprintf(buf,"[\"%s\"]",wifstr); else sprintf(buf,"[\"%s\", \"%s\", %s]",wifstr,label,flag < 0 ? "false" : "true"); return(bitcoin_json(coin,"importprivkey",buf)); } else return(cJSON_Parse("{\"result\":\"success\"}")); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 4e98068a6..1daa90920 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -113,6 +113,59 @@ FILE *basilisk_swap_save(struct basilisk_swap *swap,bits256 privkey,struct basil }*/ return(fp); } +/*char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) + { + char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2; + if ( (retstr= LP_isitme(destip,destport)) != 0 ) + return(retstr); + if ( utxo->iambob == 0 ) + { + printf("issue_LP_notifyutxo trying to send Alice %s/v%d\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout); + return(0); + } + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,u.txid,u.vout) > 0 ) + { + sprintf(url,"http://%s:%u/api/stats/notified?iambob=%d&pubkey=%s&coin=%s&txid=%s&vout=%d&value=%llu&txid2=%s&vout2=%d&value2=%llu&script=%s&address=%s×tamp=%u&gui=%s",destip,destport,utxo->iambob,bits256_str(str3,utxo->pubkey),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout,(long long)utxo->payment.value,bits256_str(str2,utxo->deposit.txid),utxo->deposit.vout,(long long)utxo->deposit.value,utxo->spendscript,utxo->coinaddr,(uint32_t)time(NULL),utxo->gui); + if ( strlen(url) > 1024 ) + printf("WARNING long url.(%s)\n",url); + return(LP_issue_curl("notifyutxo",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); + } + else + { + printf("issue_LP_notifyutxo: ineligible utxo iambob.%d %.8f %.8f\n",utxo->iambob,dstr(val),dstr(val2)); + if ( utxo->T.spentflag == 0 ) + utxo->T.spentflag = (uint32_t)time(NULL); + return(0); + } + }*/ + +/*char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) + { + char url[512],str[65]; + sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey)); + //printf("getutxo.(%s)\n",url); + return(LP_issue_curl("lookup",destip,destport,url)); + //return(issue_curlt(url,LP_HTTP_TIMEOUT)); + }*/ + + +/*if ( LP_canbind == 0 ) + { + //printf("check deadman %u vs %u\n",LP_deadman_switch,(uint32_t)time(NULL)); + if ( LP_deadman_switch < time(NULL)-PSOCK_KEEPALIVE ) + { + printf("DEAD man's switch %u activated at %u lag.%d, register forwarding again\n",LP_deadman_switch,(uint32_t)time(NULL),(uint32_t)(time(NULL) - LP_deadman_switch)); + if ( pullsock >= 0 ) + nn_close(pullsock); + pullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); + LP_deadman_switch = (uint32_t)time(NULL); + strcpy(LP_publicaddr,pushaddr); + LP_publicport = mypullport; + LP_forwarding_register(LP_mypubkey,pushaddr,mypullport,MAX_PSOCK_PORT); + } + }*/ /*if ( lastforward < now-3600 ) { if ( (retstr= LP_registerall(0)) != 0 ) From b0c7f0378a2f5819b035fcebe88df3fed3838fa4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:37:06 +0200 Subject: [PATCH 334/682] Test --- iguana/exchanges/LP_portfolio.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 957dfa001..16fc2fa52 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -89,23 +89,4 @@ char *LP_portfolio() return(jprint(retjson,1)); } -struct LP_portfolioinfo *LP_portfoliofind(char *symbol) -{ - struct LP_portfolioinfo *ptr; - portable_mutex_lock(&LP_portfoliomutex); - HASH_FIND(hh,LP_portfolios,symbol,strlen(symbol),ptr); - portable_mutex_unlock(&LP_portfoliomutex); - return(ptr); -} - -struct LP_portfolioinfo *LP_portfolioadd(char *symbol,uint64_t goal) -{ - struct LP_portfolioinfo *ptr = calloc(1,sizeof(*ptr)); - safecopy(ptr->symbol,symbol,sizeof(ptr->symbol)); - ptr->goal = goal; - portable_mutex_lock(&LP_portfoliomutex); - HASH_ADD_KEYPTR(hh,LP_portfolios,ptr->symbol,strlen(ptr->symbol),ptr); - portable_mutex_unlock(&LP_portfoliomutex); - return(ptr); -} From db7693792ad2ff84da14d9b8527060ff75f12b64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:42:59 +0200 Subject: [PATCH 335/682] Test --- iguana/exchanges/LP_coins.c | 5 ++++- iguana/exchanges/LP_commands.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 7bb23501e..7a6ac6e72 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -235,8 +235,11 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 ) + if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"NLG") == 0 ) + { coin->noimportprivkey_flag = 1; + printf("truncate importprivkey for %s\n",symbol); + } return(LP_userpass(coin->userpass,symbol,assetname,name,name2)); } diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b63dfb25b..db22b4ccc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -155,6 +155,10 @@ trust(pubkey, trust)\n\ LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"portfolio") == 0 ) + { + return(LP_portfolio()); + } if ( base != 0 && rel != 0 ) { double price,bid,ask; From b8b4a2bc0b7a881640414501f45ad8af17323eb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:46:56 +0200 Subject: [PATCH 336/682] Test --- iguana/exchanges/install | 2 +- iguana/exchanges/portfolio | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/portfolio diff --git a/iguana/exchanges/install b/iguana/exchanges/install index d790f4a8d..ec2e5b8b3 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp portfolio autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/portfolio b/iguana/exchanges/portfolio new file mode 100755 index 000000000..2265e0fc2 --- /dev/null +++ b/iguana/exchanges/portfolio @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"portfolio\"}" From 0f148f2f5624713ef07f76f2534984e85c7f0bff Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:48:57 +0200 Subject: [PATCH 337/682] Test --- iguana/exchanges/LP_portfolio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 16fc2fa52..383971e59 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -68,6 +68,8 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { + if ( coin->inactive != 0 ) + continue; if ( iter == 0 ) { coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); @@ -80,7 +82,9 @@ char *LP_portfolio() coin->maxamount = coin->valuesumB; coin->kmd_equiv = coin->maxamount * coin->price_kmd; kmdsum += coin->kmd_equiv; - } else jaddi(array,LP_portfolio_entry(coin,kmdsum)); + } + else if ( coin->maxamount > 0 ) + jaddi(array,LP_portfolio_entry(coin,kmdsum)); } } jaddstr(retjson,"result","success"); From ba77e50b6a8f07de6dc9fdc9e6603712503a0bbc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 13:55:22 +0200 Subject: [PATCH 338/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 383971e59..7887d8cff 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -49,7 +49,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) for (i=0; imatrix[basepp->ind][relpp->ind] = price; + pubp->matrix[relpp->ind][basepp->ind] = 1. / price; pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); } else printf("error finding %s/%s %.8f\n",base,rel,price); From 9c828a331c33b4deb9923d2bf20449f4a90aba6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:02:06 +0200 Subject: [PATCH 339/682] Test --- iguana/exchanges/LP_network.c | 4 ++-- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 53f538105..426743def 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -121,7 +121,7 @@ void queue_loop(void *ignore) { if ( (sentbytes= nn_send(ptr->sock,ptr->msg,ptr->msglen,0)) != ptr->msglen ) printf("%d LP_send sent %d instead of %d\n",n,sentbytes,ptr->msglen); - else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); + // else printf("%d %p qsent %u msglen.%d peerind.%d\n",n,ptr,ptr->crc32,ptr->msglen,ptr->peerind); ptr->sock = -1; if ( ptr->peerind > 0 ) ptr->starttime = (uint32_t)time(NULL); @@ -134,7 +134,7 @@ void queue_loop(void *ignore) if ( duplicate > 0 ) { LP_Qfound++; - //if ( (LP_Qenqueued % 10) == 0 ) + if ( (LP_Qenqueued % 10) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 7887d8cff..96d30a9fc 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -88,7 +88,7 @@ char *LP_portfolio() } } jaddstr(retjson,"result","success"); - jaddnum(retjson,"kmd_equiv",kmdsum); + jaddnum(retjson,"kmd_equiv",dstr(kmdsum)); jadd(retjson,"portfolio",array); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d45ca9668..102bc17be 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -646,11 +646,12 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - printf("PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); + printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; - pubp->matrix[relpp->ind][basepp->ind] = 1. / price; + basepp->relvals[relpp->ind] = price; + relpp->relvals[basepp->ind] = 1. / price; pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); } else printf("error finding %s/%s %.8f\n",base,rel,price); From da1ef3662ea8e52c234ebf3c5b0cccb00ad460cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:06:27 +0200 Subject: [PATCH 340/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_prices.c | 3 ++- iguana/exchanges/LP_rpc.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 7a6ac6e72..0b40f0867 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -235,7 +235,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"NLG") == 0 ) + if ( strcmp(symbol,"XVG") == 0 ) { coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 102bc17be..eddc1ea69 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -646,7 +646,8 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); + if ( fabs(basepp->relvals[relpp->ind] - price) > SMALLVAL ) + printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { pubp->matrix[basepp->ind][relpp->ind] = price; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2d29bf41c..82629b767 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -294,7 +294,7 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { if ( coin->noimportprivkey_flag != 0 ) sprintf(buf,"[\"%s\"]",wifstr); - else sprintf(buf,"[\"%s\", \"%s\", %s]",wifstr,label,flag < 0 ? "false" : "true"); + else sprintf(buf,"\"%s\", \"%s\", %s",wifstr,label,flag < 0 ? "false" : "true"); return(bitcoin_json(coin,"importprivkey",buf)); } else return(cJSON_Parse("{\"result\":\"success\"}")); } From b3457436ee3bf63ce6b836532749eb6a6f22e90e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:13:13 +0200 Subject: [PATCH 341/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 96d30a9fc..a3e6845da 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -28,7 +28,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin,uint64_t kmdsum) jaddnum(item,"kmdsum",dstr(kmdsum)); jaddnum(item,"goal",dstr(coin->goal)); if ( kmdsum > 0 ) - jaddnum(item,"perc",(double)coin->kmd_equiv/ kmdsum); + jaddnum(item,"perc",100. * (double)coin->kmd_equiv/ kmdsum); jaddnum(item,"balanceA",dstr(coin->balanceA)); jaddnum(item,"valuesumA",dstr(coin->valuesumA)); jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index eddc1ea69..be8760ca1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -646,13 +646,13 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( fabs(basepp->relvals[relpp->ind] - price) > SMALLVAL ) - printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { + if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) + printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); pubp->matrix[basepp->ind][relpp->ind] = price; - basepp->relvals[relpp->ind] = price; - relpp->relvals[basepp->ind] = 1. / price; + dxblend(&basepp->relvals[relpp->ind],price,0.9); + dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); } else printf("error finding %s/%s %.8f\n",base,rel,price); From 5519190c34f7e660d3e9fcc7fcdef5dd322e5f32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:14:14 +0200 Subject: [PATCH 342/682] Test --- iguana/exchanges/LP_prices.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index be8760ca1..defe2f0dc 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -650,9 +650,11 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); - pubp->matrix[basepp->ind][relpp->ind] = price; - dxblend(&basepp->relvals[relpp->ind],price,0.9); - dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); + { + pubp->matrix[basepp->ind][relpp->ind] = price; + dxblend(&basepp->relvals[relpp->ind],price,0.9); + dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); + } pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); } else printf("error finding %s/%s %.8f\n",base,rel,price); From f02bb8ff3115747e6725a2755afcf7502a53813f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:34:20 +0200 Subject: [PATCH 343/682] Test --- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_portfolio.c | 16 ++++++++++++---- iguana/exchanges/LP_prices.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index b42cc8770..787a033b0 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -183,8 +183,8 @@ struct iguana_info uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio - double price_kmd; - uint64_t maxamount,kmd_equiv,goal,balanceA,balanceB,valuesumA,valuesumB; + double price_kmd,force,perc,goal; + uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; }; struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; }; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index a3e6845da..ee15b9505 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -26,9 +26,9 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin,uint64_t kmdsum) jaddnum(item,"price",coin->price_kmd); jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv)); jaddnum(item,"kmdsum",dstr(kmdsum)); - jaddnum(item,"goal",dstr(coin->goal)); - if ( kmdsum > 0 ) - jaddnum(item,"perc",100. * (double)coin->kmd_equiv/ kmdsum); + jaddnum(item,"goal",coin->goal); + jaddnum(item,"perc",coin->perc); + jaddnum(item,"force",coin->force); jaddnum(item,"balanceA",dstr(coin->balanceA)); jaddnum(item,"valuesumA",dstr(coin->valuesumA)); jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); @@ -61,7 +61,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) char *LP_portfolio() { - uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp; + double goalsum = 0.; uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp; array = cJSON_CreateArray(); retjson = cJSON_CreateObject(); for (iter=0; iter<2; iter++) @@ -82,9 +82,17 @@ char *LP_portfolio() coin->maxamount = coin->valuesumB; coin->kmd_equiv = coin->maxamount * coin->price_kmd; kmdsum += coin->kmd_equiv; + goalsum += coin->goal; } else if ( coin->maxamount > 0 ) + { + if ( goalsum > SMALLVAL && coin->goal > SMALLVAL ) + { + coin->perc = 100. * coin->goal / goalsum; + coin->force = (coin->perc - coin->goal); + } else coin->perc = coin->force = 0.; jaddi(array,LP_portfolio_entry(coin,kmdsum)); + } } } jaddstr(retjson,"result","success"); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index defe2f0dc..b2cfa8bc1 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -649,7 +649,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) - printf("PRICEFEED UPDATE.(%s/%s) %.8f %s %.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); + printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); { pubp->matrix[basepp->ind][relpp->ind] = price; dxblend(&basepp->relvals[relpp->ind],price,0.9); From 35cc10520d2d4a14d67c11ee6d2e7dffae602470 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:37:26 +0200 Subject: [PATCH 344/682] Test --- iguana/exchanges/LP_portfolio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index ee15b9505..621b1690c 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -88,8 +88,10 @@ char *LP_portfolio() { if ( goalsum > SMALLVAL && coin->goal > SMALLVAL ) { - coin->perc = 100. * coin->goal / goalsum; - coin->force = (coin->perc - coin->goal); + coin->perc = 100. * coin->kmd_equiv / goalsum; + if ( (coin->force= (coin->perc - coin->goal)) < 0. ) + coin->force *= -coin->force; + else coin->force *= coin->force; } else coin->perc = coin->force = 0.; jaddi(array,LP_portfolio_entry(coin,kmdsum)); } From 880739a1e57c84e716b210ac11fbb015f8a6e176 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:46:40 +0200 Subject: [PATCH 345/682] Goal --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_commands.c | 4 ++++ iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_portfolio.c | 24 ++++++++++++++++++------ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 0b40f0867..21661ab86 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -158,7 +158,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c LP_userpassfp(symbol,username,password,fp); sprintf(userpass,"%s:%s",username,password); fclose(fp); - if ( 1 ) + if ( 0 ) printf("LP_statefname.(%s) <- %s %s %s (%s)\n",fname,name,symbol,assetname,userpass); return((int32_t)strlen(userpass)); } else printf("cant open.(%s)\n",fname); diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index db22b4ccc..1629da8d4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -257,6 +257,10 @@ trust(pubkey, trust)\n\ return(jprint(retjson,1)); } } + else if ( strcmp(method,"goal") == 0 ) + { + return(LP_portfolio_goal(coin,jdouble(argjson,"goal"))); + } } else if ( strcmp(method,"swapstatus") == 0 ) { diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 787a033b0..a7dad4c24 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -183,7 +183,7 @@ struct iguana_info uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio - double price_kmd,force,perc,goal; + double price_kmd,force,perc,goal,goalperc; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; }; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 621b1690c..5d42d4a67 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -18,16 +18,16 @@ // marketmaker // -cJSON *LP_portfolio_entry(struct iguana_info *coin,uint64_t kmdsum) +cJSON *LP_portfolio_entry(struct iguana_info *coin) { cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); jaddnum(item,"amount",dstr(coin->maxamount)); jaddnum(item,"price",coin->price_kmd); jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv)); - jaddnum(item,"kmdsum",dstr(kmdsum)); - jaddnum(item,"goal",coin->goal); jaddnum(item,"perc",coin->perc); + jaddnum(item,"goal",coin->goal); + jaddnum(item,"goalperc",coin->goalperc); jaddnum(item,"force",coin->force); jaddnum(item,"balanceA",dstr(coin->balanceA)); jaddnum(item,"valuesumA",dstr(coin->valuesumA)); @@ -86,14 +86,16 @@ char *LP_portfolio() } else if ( coin->maxamount > 0 ) { + if ( kmdsum > SMALLVAL ) + coin->perc = 100. * coin->kmd_equiv / kmdsum; if ( goalsum > SMALLVAL && coin->goal > SMALLVAL ) { - coin->perc = 100. * coin->kmd_equiv / goalsum; - if ( (coin->force= (coin->perc - coin->goal)) < 0. ) + coin->goalperc = 100. * coin->goal / goalsum; + if ( (coin->force= (coin->perc - coin->goalperc)) < 0. ) coin->force *= -coin->force; else coin->force *= coin->force; } else coin->perc = coin->force = 0.; - jaddi(array,LP_portfolio_entry(coin,kmdsum)); + jaddi(array,LP_portfolio_entry(coin)); } } } @@ -103,4 +105,14 @@ char *LP_portfolio() return(jprint(retjson,1)); } +char *LP_portfolio_goal(char *symbol,double goal) +{ + struct iguana_info *coin; + if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) + { + coin->goal = goal; + return(LP_portfolio()); + } else return(clonestr("{\error\":\"cant set goal for inactive coin\"}")); +} + From 67ffc159b1aae460cfdf24947c06e84a983bd6ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:48:36 +0200 Subject: [PATCH 346/682] Test --- iguana/exchanges/goal | 3 +++ iguana/exchanges/install | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/goal diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal new file mode 100755 index 000000000..c69d6ca7c --- /dev/null +++ b/iguana/exchanges/goal @@ -0,0 +1,3 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"goal\":99}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":1}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index ec2e5b8b3..0e913c346 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp portfolio autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp goal portfolio autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From eea332c0bd0afe29f9db445274e6c439b74289bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:50:31 +0200 Subject: [PATCH 347/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 5d42d4a67..fd619fb89 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -84,7 +84,7 @@ char *LP_portfolio() kmdsum += coin->kmd_equiv; goalsum += coin->goal; } - else if ( coin->maxamount > 0 ) + else { if ( kmdsum > SMALLVAL ) coin->perc = 100. * coin->kmd_equiv / kmdsum; From 82c10671f96da7292015cdabfd25bd7bbb002ac7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 14:58:24 +0200 Subject: [PATCH 348/682] Test --- iguana/exchanges/LP_portfolio.c | 10 ++++++---- iguana/exchanges/goal | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index fd619fb89..9639189c1 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -31,10 +31,12 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) jaddnum(item,"force",coin->force); jaddnum(item,"balanceA",dstr(coin->balanceA)); jaddnum(item,"valuesumA",dstr(coin->valuesumA)); - jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); + if ( coin->valuesumA != 0 ) + jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); jaddnum(item,"balanceB",dstr(coin->balanceB)); jaddnum(item,"valuesumB",dstr(coin->valuesumB)); - jaddnum(item,"bobutil",100. * (double)coin->balanceB/coin->valuesumB); + if ( coin->valuesumB != 0 ) + jaddnum(item,"bobutil",100. * (double)coin->balanceB/coin->valuesumB); return(item); } @@ -84,14 +86,14 @@ char *LP_portfolio() kmdsum += coin->kmd_equiv; goalsum += coin->goal; } - else + else { if ( kmdsum > SMALLVAL ) coin->perc = 100. * coin->kmd_equiv / kmdsum; if ( goalsum > SMALLVAL && coin->goal > SMALLVAL ) { coin->goalperc = 100. * coin->goal / goalsum; - if ( (coin->force= (coin->perc - coin->goalperc)) < 0. ) + if ( (coin->force= (coin->goalperc - coin->perc)) < 0. ) coin->force *= -coin->force; else coin->force *= coin->force; } else coin->perc = coin->force = 0.; diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal index c69d6ca7c..f054e5ea2 100755 --- a/iguana/exchanges/goal +++ b/iguana/exchanges/goal @@ -1,3 +1,4 @@ source userpass curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"goal\":99}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":1}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":10}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"goal\":1}" From 82d40b128d229f57eaa2016f45fe74aeb2445d3b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 15:28:08 +0200 Subject: [PATCH 349/682] Test --- iguana/exchanges/LP_prices.c | 16 +++++++++++++++- iguana/exchanges/mm.c | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b2cfa8bc1..44a6ad4d4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -642,7 +642,21 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { - struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; char str[65]; + static FILE *fp; + struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; + if ( fp == 0 ) + { + sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel), OS_ensure_directory(fname); + fp = OS_appendfile(fname); + } + if ( fp != 0 && price > SMALLVAL ) + { + price64 = price * SATOSHIDEN; + now = (uint32_t)time(NULL); + fwrite(&now,1,sizeof(now),fp); + fwrite(&price64,1,sizeof(price64),fp); + fflush(fp); + } //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 522121258..91b2df3dc 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -803,6 +803,7 @@ int main(int argc, const char * argv[]) OS_init(); sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname); sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname); + sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname); if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) { if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) From 10700220fd1ce6bc239d5ec66e73b1c37c1a7fb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 15:30:39 +0200 Subject: [PATCH 350/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 44a6ad4d4..da4cc77cd 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -646,7 +646,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; if ( fp == 0 ) { - sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel), OS_ensure_directory(fname); + sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel); fp = OS_appendfile(fname); } if ( fp != 0 && price > SMALLVAL ) From 84352b45f82707d8e0177b0e7c993d239c801690 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 15:34:50 +0200 Subject: [PATCH 351/682] Test --- iguana/exchanges/LP_prices.c | 43 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index da4cc77cd..bc2a5f1e7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -31,6 +31,7 @@ struct LP_priceinfo double myprices[LP_MAXPRICEINFOS]; double minprices[LP_MAXPRICEINFOS]; double margins[LP_MAXPRICEINFOS]; + FILE *fps[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; @@ -642,24 +643,36 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { - static FILE *fp; - struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; - if ( fp == 0 ) - { - sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel); - fp = OS_appendfile(fname); - } - if ( fp != 0 && price > SMALLVAL ) - { - price64 = price * SATOSHIDEN; - now = (uint32_t)time(NULL); - fwrite(&now,1,sizeof(now),fp); - fwrite(&price64,1,sizeof(price64),fp); - fflush(fp); - } + struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { + if ( (fp= basepp->fps[relpp->ind]) == 0 ) + { + sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel); + fp = basepp->fps[relpp->ind] = OS_appendfile(fname); + } + if ( fp != 0 && price > SMALLVAL ) + { + now = (uint32_t)time(NULL); + price64 = price * SATOSHIDEN; + fwrite(&now,1,sizeof(now),fp); + fwrite(&price64,1,sizeof(price64),fp); + fflush(fp); + } + if ( (fp= relpp->fps[basepp->ind]) == 0 ) + { + sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,rel,base); + fp = relpp->fps[basepp->ind] = OS_appendfile(fname); + } + if ( fp != 0 && price > SMALLVAL ) + { + now = (uint32_t)time(NULL); + price64 = (1. / price) * SATOSHIDEN; + fwrite(&now,1,sizeof(now),fp); + fwrite(&price64,1,sizeof(price64),fp); + fflush(fp); + } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) From 7f729cf370444d7604910964e5e89fb35a9d5c69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 16:05:20 +0200 Subject: [PATCH 352/682] Test --- iguana/exchanges/LP_portfolio.c | 233 +++++++++++++++++++++++++++++++- iguana/exchanges/LP_prices.c | 222 +----------------------------- 2 files changed, 235 insertions(+), 220 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 9639189c1..9fffa36a3 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -22,6 +22,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) { cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); + jaddstr(item,"address",coin->smartaddr); jaddnum(item,"amount",dstr(coin->maxamount)); jaddnum(item,"price",coin->price_kmd); jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv)); @@ -96,7 +97,7 @@ char *LP_portfolio() if ( (coin->force= (coin->goalperc - coin->perc)) < 0. ) coin->force *= -coin->force; else coin->force *= coin->force; - } else coin->perc = coin->force = 0.; + } else coin->goalperc = coin->force = 0.; jaddi(array,LP_portfolio_entry(coin)); } } @@ -117,4 +118,234 @@ char *LP_portfolio_goal(char *symbol,double goal) } else return(clonestr("{\error\":\"cant set goal for inactive coin\"}")); } +int32_t LP_autoprices; + +int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) +{ + struct LP_priceinfo *basepp,*relpp; + if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + { + basepp->maxprices[relpp->ind] = maxprice; + basepp->relvols[relpp->ind] = totalrelvolume; + return(0); + } + return(-1); +} + +int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *type) +{ + struct LP_priceinfo *basepp,*relpp; + if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + { + basepp->minprices[relpp->ind] = minprice; + basepp->margins[relpp->ind] = margin; + LP_autoprices++; + return(0); + } + return(-1); +} + +void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) +{ + double margin,minprice; int32_t changed; + if ( (margin= basepp->margins[relpp->ind]) != 0. ) + { + if ( dir > 0 ) + price = 1. / (price * (1. - margin)); + else price = (price * (1. + margin)); + //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); + if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) + { + LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); + //printf("changed.%d\n",changed); + if ( changed != 0 ) + LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); + } + } +} + +double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) +{ + //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, + //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, + int32_t i,j,n,iter; double price,kmdbtc,bid,ask,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + //printf("got.(%s)\n",retstr); + kmdbtc = 0.; + refcoin = "BTC"; + refpp = btcpp; + if ( (array= jarray(&n,retjson,trexflag != 0 ? "result" : "Data")) != 0 ) + { + for (iter=0; iter<2; iter++) + { + for (i=0; i SMALLVAL && strcmp(symbol,"NXT") == 0 ) + nxtkmd = 0.5 * (bid + ask) / kmdbtc; + if ( (coinpp= LP_priceinfofind(symbol)) != 0 ) + { + coinpp->high[trexflag] = jdouble(item,"High"); + coinpp->low[trexflag] = jdouble(item,"Low"); + //coinpp->volume = jdouble(item,"Volume"); + //coinpp->btcvolume = jdouble(item,"BaseVolume"); + coinpp->last[trexflag] = jdouble(item,trexflag != 0 ? "Last" : "LastPrice"); + coinpp->bid[trexflag] = bid; + coinpp->ask[trexflag] = ask; + //coinpp->prevday = jdouble(item,"PrevDay"); + //printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); + if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) + { + price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); + if ( iter == 0 ) + { + if ( strcmp(symbol,"KMD") == 0 ) + kmdbtc = price; + } + else + { + if ( strcmp(symbol,"KMD") == 0 ) + continue; + //printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); + price /= kmdbtc; + } + if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) + { + //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); + continue; + } + LP_autopriceset(ctx,1,refpp,coinpp,price); + LP_autopriceset(ctx,-1,coinpp,refpp,price); + } + } + } + } + } + refcoin = "KMD"; + if ( kmdbtc == 0. || (refpp= LP_priceinfofind("KMD")) == 0 ) + break; + } + } + free_json(retjson); + } + return(nxtkmd); +} + +static char *assetids[][3] = +{ + { "12071612744977229797", "UNITY", "10000" }, + { "15344649963748848799", "DEX", "1" }, + { "6883271355794806507", "PANGEA", "10000" }, + { "17911762572811467637", "JUMBLR", "10000" }, + { "17083334802666450484", "BET", "10000" }, + { "13476425053110940554", "CRYPTO", "1000" }, + { "6932037131189568014", "HODL", "1" }, + { "3006420581923704757", "SHARK", "10000" }, + { "17571711292785902558", "BOTS", "1" }, + { "10524562908394749924", "MGW", "1" }, +}; + +void prices_loop(void *ignore) +{ + char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp,*nxtpp; void *ctx = bitcoin_ctx(); + while ( 1 ) + { + if ( LP_autoprices == 0 ) + { + sleep(60); + continue; + } + if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) + { + sleep(60); + continue; + } + if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) + { + printf("error getting marketsummaries\n"); + sleep(60); + continue; + } + nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); + free(retstr); + if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) + { + printf("error getting marketsummaries\n"); + sleep(60); + continue; + } + LP_pricesparse(ctx,0,retstr,btcpp); + free(retstr); + if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) + { + for (i=0; i<32; i++) + { + if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) + { + if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + { + //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + price = jdouble(retjson,"price"); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); + free_json(retjson); + } + } + } + } + if ( nxtkmd > SMALLVAL ) + { + for (i=0; i (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); + free_json(retjson); + } + } + } + } + sleep(60); + } +} + diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index bc2a5f1e7..b1147c9a0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -29,8 +29,10 @@ struct LP_priceinfo double diagval,high[2],low[2],last[2],bid[2],ask[2]; //volume,btcvolume,prevday; // mostly bittrex info double relvals[LP_MAXPRICEINFOS]; double myprices[LP_MAXPRICEINFOS]; - double minprices[LP_MAXPRICEINFOS]; + double minprices[LP_MAXPRICEINFOS]; // autoprice double margins[LP_MAXPRICEINFOS]; + double maxprices[LP_MAXPRICEINFOS]; // autofill of base/rel + double relvols[LP_MAXPRICEINFOS]; FILE *fps[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; @@ -687,221 +689,3 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } else printf("error finding %s/%s %.8f\n",base,rel,price); } -int32_t LP_autoprices; - -int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *type) -{ - struct LP_priceinfo *basepp,*relpp; - if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) - { - basepp->minprices[relpp->ind] = minprice; - basepp->margins[relpp->ind] = margin; - LP_autoprices++; - return(0); - } - return(-1); -} - -void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) -{ - double margin,minprice; int32_t changed; - if ( (margin= basepp->margins[relpp->ind]) != 0. ) - { - if ( dir > 0 ) - price = 1. / (price * (1. - margin)); - else price = (price * (1. + margin)); - //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); - if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) - { - LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); - //printf("changed.%d\n",changed); - if ( changed != 0 ) - LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); - } - } -} - -double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo *btcpp) -{ - //{"success":true,"message":"","result":[{"MarketName":"BTC-KMD","High":0.00040840,"Low":0.00034900,"Volume":328042.46061669,"Last":0.00037236,"BaseVolume":123.36439511,"TimeStamp":"2017-07-15T13:50:21.87","Bid":0.00035721,"Ask":0.00037069,"OpenBuyOrders":343,"OpenSellOrders":1690,"PrevDay":0.00040875,"Created":"2017-02-11T23:04:01.853"}, - //{"TradePairId":4762,"Label":"WAVES/BTC","AskPrice":0.00099989,"BidPrice":0.00097350,"Low":0.00095000,"High":0.00108838,"Volume":6501.24403100,"LastPrice":0.00098028,"BuyVolume":1058994.86554882,"SellVolume":2067.87377158,"Change":-7.46,"Open":0.00105926,"Close":0.00098028,"BaseVolume":6.52057452,"BuyBaseVolume":2.33098660,"SellBaseVolume":1167.77655709}, - int32_t i,j,n,iter; double price,kmdbtc,bid,ask,nxtkmd=0.; struct LP_priceinfo *coinpp,*refpp; char symbol[16],*name,*refcoin; cJSON *retjson,*array,*item; - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - //printf("got.(%s)\n",retstr); - kmdbtc = 0.; - refcoin = "BTC"; - refpp = btcpp; - if ( (array= jarray(&n,retjson,trexflag != 0 ? "result" : "Data")) != 0 ) - { - for (iter=0; iter<2; iter++) - { - for (i=0; i SMALLVAL && strcmp(symbol,"NXT") == 0 ) - nxtkmd = 0.5 * (bid + ask) / kmdbtc; - if ( (coinpp= LP_priceinfofind(symbol)) != 0 ) - { - coinpp->high[trexflag] = jdouble(item,"High"); - coinpp->low[trexflag] = jdouble(item,"Low"); - //coinpp->volume = jdouble(item,"Volume"); - //coinpp->btcvolume = jdouble(item,"BaseVolume"); - coinpp->last[trexflag] = jdouble(item,trexflag != 0 ? "Last" : "LastPrice"); - coinpp->bid[trexflag] = bid; - coinpp->ask[trexflag] = ask; - //coinpp->prevday = jdouble(item,"PrevDay"); - //printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); - if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) - { - price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]); - if ( iter == 0 ) - { - if ( strcmp(symbol,"KMD") == 0 ) - kmdbtc = price; - } - else - { - if ( strcmp(symbol,"KMD") == 0 ) - continue; - //printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); - price /= kmdbtc; - } - if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) - { - //printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]); - continue; - } - LP_autopriceset(ctx,1,refpp,coinpp,price); - LP_autopriceset(ctx,-1,coinpp,refpp,price); - } - } - } - } - } - refcoin = "KMD"; - if ( kmdbtc == 0. || (refpp= LP_priceinfofind("KMD")) == 0 ) - break; - } - } - free_json(retjson); - } - return(nxtkmd); -} - -static char *assetids[][3] = -{ - { "12071612744977229797", "UNITY", "10000" }, - { "15344649963748848799", "DEX", "1" }, - { "6883271355794806507", "PANGEA", "10000" }, - { "17911762572811467637", "JUMBLR", "10000" }, - { "17083334802666450484", "BET", "10000" }, - { "13476425053110940554", "CRYPTO", "1000" }, - { "6932037131189568014", "HODL", "1" }, - { "3006420581923704757", "SHARK", "10000" }, - { "17571711292785902558", "BOTS", "1" }, - { "10524562908394749924", "MGW", "1" }, -}; - -void prices_loop(void *ignore) -{ - char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp,*nxtpp; void *ctx = bitcoin_ctx(); - while ( 1 ) - { - if ( LP_autoprices == 0 ) - { - sleep(60); - continue; - } - if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) - { - sleep(60); - continue; - } - if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); - free(retstr); - if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - LP_pricesparse(ctx,0,retstr,btcpp); - free(retstr); - if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) - { - for (i=0; i<32; i++) - { - if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) - { - if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) - { - //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); - price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); - free_json(retjson); - } - } - } - } - if ( nxtkmd > SMALLVAL ) - { - for (i=0; i (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); - free_json(retjson); - } - } - } - } - sleep(60); - } -} - From c7c2b4d35a174f2949aa49c999c6c5d258e8ceec Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 16:06:01 +0200 Subject: [PATCH 353/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b1147c9a0..cd717a102 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -677,7 +677,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) + if ( (rand() % 10) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); { pubp->matrix[basepp->ind][relpp->ind] = price; From 88d4fbe3c7ac43d551d173074f795f157585c481 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 16:38:05 +0200 Subject: [PATCH 354/682] Test --- iguana/exchanges/LP_commands.c | 11 ++++++++++- iguana/exchanges/LP_nativeDEX.c | 9 +-------- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_portfolio.c | 31 +++++++++++++++++++++++++++++-- iguana/exchanges/goal | 6 +++--- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 1629da8d4..4b4d328b5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -96,6 +96,8 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r available localhost RPC commands:\n \ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ +autofill(base, rel, price, relvolume)\n\ +goal(coin, perc)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ @@ -108,6 +110,7 @@ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ getcoins()\n\ +portfolio()\n\ getpeers()\n\ getutxos()\n\ getutxos(coin, lastn)\n\ @@ -180,6 +183,12 @@ trust(pubkey, trust)\n\ return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"autofill") == 0 ) + { + if ( LP_autofill(base,rel,price,jdouble(argjson,"relvolume")) < 0 ) + return(clonestr("{\"error\":\"couldnt set autofill\"}")); + else return(clonestr("{\"result\":\"success\"}")); + } else if ( strcmp(method,"myprice") == 0 ) { if ( LP_myprice(&bid,&ask,base,rel) > SMALLVAL ) @@ -259,7 +268,7 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"goal") == 0 ) { - return(LP_portfolio_goal(coin,jdouble(argjson,"goal"))); + return(LP_portfolio_goal(coin,jdouble(argjson,"perc"))); } } else if ( strcmp(method,"swapstatus") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 562c8cf82..e7812d7b8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,21 +19,14 @@ // // new features: // stats -// autofill // autoutxo -// fixes: -// -wiftaddr and no flag for importprivkey (XVG) -// -avoid redundant importprivkey -// -put Atxfee and Btxfee into rememberfiles - // bugs: // false detection of bobreclaim // unduplicated bugs: // swap cancel should cleanly cancel -// multiple smartaddresses? enable/disable causes? 250 KMD bounty -// verify bid volumes +// multiple smartaddresses? enable/disable causes? #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 426743def..8d32944af 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -134,7 +134,7 @@ void queue_loop(void *ignore) if ( duplicate > 0 ) { LP_Qfound++; - if ( (LP_Qenqueued % 10) == 0 ) + if ( (LP_Qfound % 10) == 0 ) printf("found.%u Q.%d err.%d match.%d\n",ptr->crc32,LP_Qenqueued,LP_Qerrors,LP_Qfound); flag = 1; } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 9fffa36a3..50300d51e 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -64,7 +64,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) char *LP_portfolio() { - double goalsum = 0.; uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp; + double strongest = 0.,goalsum = 0.; uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp,*strongestcoin=0; array = cJSON_CreateArray(); retjson = cJSON_CreateObject(); for (iter=0; iter<2; iter++) @@ -97,6 +97,11 @@ char *LP_portfolio() if ( (coin->force= (coin->goalperc - coin->perc)) < 0. ) coin->force *= -coin->force; else coin->force *= coin->force; + if ( fabs(coin->force) > fabs(strongest) ) + { + strongest = coin->force; + strongestcoin = coin; + } } else coin->goalperc = coin->force = 0.; jaddi(array,LP_portfolio_entry(coin)); } @@ -104,6 +109,11 @@ char *LP_portfolio() } jaddstr(retjson,"result","success"); jaddnum(retjson,"kmd_equiv",dstr(kmdsum)); + if ( strongestcoin != 0 ) + { + jaddstr(retjson,"strongest",strongestcoin->symbol); + jaddnum(retjson,"force",strongest); + } jadd(retjson,"portfolio",array); return(jprint(retjson,1)); } @@ -118,7 +128,7 @@ char *LP_portfolio_goal(char *symbol,double goal) } else return(clonestr("{\error\":\"cant set goal for inactive coin\"}")); } -int32_t LP_autoprices; +int32_t LP_autoprices,LP_autofills; int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) { @@ -127,6 +137,7 @@ int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) { basepp->maxprices[relpp->ind] = maxprice; basepp->relvols[relpp->ind] = totalrelvolume; + LP_autofills++; return(0); } return(-1); @@ -344,6 +355,22 @@ void prices_loop(void *ignore) } } } + if ( LP_autofills > 0 ) + { + char *strongest; struct iguana_info *coin; + if ( (retstr= LP_portfolio()) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (strongest= jstr(retjson,"strongest")) != 0 && (coin= LP_coinfind(strongest)) != 0 ) + { + printf("strongest.%s force %f\n",strongest,jdouble(retjson,"force")); + } + free_json(retjson); + } + free(retstr); + } + } sleep(60); } } diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal index f054e5ea2..b6dafb282 100755 --- a/iguana/exchanges/goal +++ b/iguana/exchanges/goal @@ -1,4 +1,4 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"goal\":99}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":10}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"goal\":1}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"perc\":99}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"perc\":10}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"perc\":1}" From 0ce93141d8c5155550e4067f5fb34d3c83445646 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 19 Jul 2017 16:51:55 +0200 Subject: [PATCH 355/682] Test --- iguana/exchanges/LP_commands.c | 7 ++++--- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_portfolio.c | 1 + iguana/exchanges/LP_utxos.c | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4b4d328b5..9d25f3d8d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -251,12 +251,13 @@ trust(pubkey, trust)\n\ return(clonestr("{\"error\":\"coin is disabled\"}")); if ( strcmp(method,"inventory") == 0 ) { - struct iguana_info *ptr; bits256 privkey,pubkey; uint8_t pubkey33[33]; + struct iguana_info *ptr; if ( (ptr= LP_coinfind(coin)) != 0 ) { - privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); + //privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR); //LP_utxopurge(0); - LP_privkey_init(-1,ptr,privkey,pubkey,pubkey33); + if ( bits256_nonz(LP_mypriv25519) != 0 ) + LP_privkey_init(-1,ptr,LP_mypriv25519,LP_mypub25519); retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"coin",coin); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a7dad4c24..9e3020e9b 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -185,6 +185,7 @@ struct iguana_info // portfolio double price_kmd,force,perc,goal,goalperc; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; + uint8_t pubkey33[33]; }; struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; }; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e7812d7b8..9dc9fd350 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -26,7 +26,6 @@ // unduplicated bugs: // swap cancel should cleanly cancel -// multiple smartaddresses? enable/disable causes? #include #include "LP_include.h" diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 50300d51e..82f58db5c 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -75,6 +75,7 @@ char *LP_portfolio() continue; if ( iter == 0 ) { + LP_privkey_init(-1,coin,LP_mypriv25519,LP_mypub25519); coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); if ( strcmp(coin->symbol,"KMD") != 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b4d4b4a7d..71f4ab170 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -775,7 +775,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe return(mini); } -uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub,uint8_t *pubkey33) +uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,iambob,vout,depositvout; uint64_t *values=0,satoshis,depositval,targetval,value,total = 0; if ( coin == 0 ) @@ -878,7 +878,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey)); } } - bitcoin_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); + bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) { coin->counter++; @@ -927,7 +927,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 ) privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,""); if ( coin->inactive == 0 && initonly == 0 ) - LP_privkey_init(pubsock,coin,privkey,pubkey,pubkey33); + LP_privkey_init(pubsock,coin,privkey,pubkey); } } From 99a06885063e6c0c7c92603d6af341bb253ccbbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 09:18:34 +0200 Subject: [PATCH 356/682] xmy --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 2b6d9ff6e..17fe0b7f8 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From f256227a2606070868cc9b015273aea14d5a8615 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 10:38:36 +0200 Subject: [PATCH 357/682] Test --- iguana/exchanges/LP_portfolio.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 82f58db5c..20c4278bc 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -64,7 +64,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) char *LP_portfolio() { - double strongest = 0.,goalsum = 0.; uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp,*strongestcoin=0; + double maxval = 0.,minval = 0.,goalsum = 0.; uint64_t kmdsum = 0; int32_t iter; cJSON *retjson,*array; struct iguana_info *coin,*tmp,*sellcoin = 0,*buycoin = 0; array = cJSON_CreateArray(); retjson = cJSON_CreateObject(); for (iter=0; iter<2; iter++) @@ -98,10 +98,15 @@ char *LP_portfolio() if ( (coin->force= (coin->goalperc - coin->perc)) < 0. ) coin->force *= -coin->force; else coin->force *= coin->force; - if ( fabs(coin->force) > fabs(strongest) ) + if ( coin->force > maxval ) { - strongest = coin->force; - strongestcoin = coin; + maxval = coin->force; + buycoin = coin; + } + if ( coin->force < minval ) + { + minval = coin->force; + sellcoin = coin; } } else coin->goalperc = coin->force = 0.; jaddi(array,LP_portfolio_entry(coin)); @@ -110,10 +115,15 @@ char *LP_portfolio() } jaddstr(retjson,"result","success"); jaddnum(retjson,"kmd_equiv",dstr(kmdsum)); - if ( strongestcoin != 0 ) + if ( buycoin != 0 ) + { + jaddstr(retjson,"buycoin",buycoin->symbol); + jaddnum(retjson,"buyforce",maxval); + } + if ( sellcoin != 0 ) { - jaddstr(retjson,"strongest",strongestcoin->symbol); - jaddnum(retjson,"force",strongest); + jaddstr(retjson,"sellcoin",sellcoin->symbol); + jaddnum(retjson,"sellforce",minval); } jadd(retjson,"portfolio",array); return(jprint(retjson,1)); @@ -358,14 +368,14 @@ void prices_loop(void *ignore) } if ( LP_autofills > 0 ) { - char *strongest; struct iguana_info *coin; + char *buycoin,*sellcoin; struct iguana_info *buy,*sell; if ( (retstr= LP_portfolio()) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (strongest= jstr(retjson,"strongest")) != 0 && (coin= LP_coinfind(strongest)) != 0 ) + if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - printf("strongest.%s force %f\n",strongest,jdouble(retjson,"force")); + printf("buy.%s force %f, sell.%s force %f\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce")); } free_json(retjson); } From c07612da9ac4a3ca72313f39fbbb58d0a80fe8d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 10:44:10 +0200 Subject: [PATCH 358/682] Test --- iguana/exchanges/LP_prices.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index cd717a102..24f1bb435 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -202,7 +202,7 @@ char *LP_prices() void LP_prices_parse(cJSON *obj) { - struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; int32_t i,n,relid; char *base,*rel; double askprice; + struct LP_pubkeyinfo *pubp; struct LP_priceinfo *basepp,*relpp; uint32_t timestamp; bits256 pubkey; cJSON *asks,*item; int32_t i,n,relid; char *base,*rel; double askprice; pubkey = jbits256(obj,"pubkey"); if ( bits256_nonz(pubkey) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 ) { @@ -219,6 +219,11 @@ void LP_prices_parse(cJSON *obj) { char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); pubp->matrix[basepp->ind][relid] = askprice; + if ( (relpp= LP_priceinfofind(rel)) != 0 ) + { + dxblend(&basepp->relvals[relpp->ind],askprice,0.9); + dxblend(&relpp->relvals[basepp->ind],1. / askprice,0.9); + } } } } From bb529c3ae0d5337b00722c06841a11fc1781d6ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 10:58:55 +0200 Subject: [PATCH 359/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 20c4278bc..52dde81bd 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -376,7 +376,7 @@ void prices_loop(void *ignore) if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { printf("buy.%s force %f, sell.%s force %f\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce")); - } + } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); free_json(retjson); } free(retstr); From aa1b61018c606cfc0a06c08de0c98e84c007c3bf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 11:03:34 +0200 Subject: [PATCH 360/682] Test --- iguana/exchanges/LP_portfolio.c | 92 ++++++++++++++++----------------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 52dde81bd..67d6d25b6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -298,70 +298,68 @@ void prices_loop(void *ignore) char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp,*nxtpp; void *ctx = bitcoin_ctx(); while ( 1 ) { - if ( LP_autoprices == 0 ) - { - sleep(60); - continue; - } if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { sleep(60); continue; } - if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); - free(retstr); - if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - LP_pricesparse(ctx,0,retstr,btcpp); - free(retstr); - if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) + if ( LP_autoprices != 0 ) { - for (i=0; i<32; i++) + if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) { - if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) + printf("error getting marketsummaries\n"); + sleep(60); + continue; + } + nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); + free(retstr); + if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) + { + printf("error getting marketsummaries\n"); + sleep(60); + continue; + } + LP_pricesparse(ctx,0,retstr,btcpp); + free(retstr); + if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) + { + for (i=0; i<32; i++) { - if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) { - //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); - price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); - free_json(retjson); + if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) + { + //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + price = jdouble(retjson,"price"); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); + free_json(retjson); + } } } } - } - if ( nxtkmd > SMALLVAL ) - { - for (i=0; i SMALLVAL ) { - if ( (nxtpp= LP_priceinfofind(assetids[i][1])) != 0 ) + for (i=0; i (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); + free_json(retjson); } - LP_autopriceset(ctx,1,kmdpp,nxtpp,price); - LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); - //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); - free_json(retjson); } } } From bdbafedce936526e6b07ca8e69dc04c5c52f903e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 11:10:59 +0200 Subject: [PATCH 361/682] Test --- iguana/exchanges/LP_portfolio.c | 122 +++++++++++++++++--------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 67d6d25b6..05e670afd 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -293,80 +293,84 @@ static char *assetids[][3] = { "10524562908394749924", "MGW", "1" }, }; -void prices_loop(void *ignore) +void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) { - char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp,*nxtpp; void *ctx = bitcoin_ctx(); - while ( 1 ) + char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp; + if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) { - if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) - { - sleep(60); - continue; - } - if ( LP_autoprices != 0 ) + printf("error getting marketsummaries\n"); + sleep(60); + return; + } + nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); + free(retstr); + if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) + { + printf("error getting marketsummaries\n"); + sleep(60); + return; + } + LP_pricesparse(ctx,0,retstr,btcpp); + free(retstr); + if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) + { + for (i=0; i<32; i++) { - if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - nxtkmd = LP_pricesparse(ctx,1,retstr,btcpp); - free(retstr); - if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) - { - printf("error getting marketsummaries\n"); - sleep(60); - continue; - } - LP_pricesparse(ctx,0,retstr,btcpp); - free(retstr); - if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) + if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) { - for (i=0; i<32; i++) + if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) { - if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) - { - if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) - { - //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); - price = jdouble(retjson,"price"); - LP_autopriceset(ctx,1,kmdpp,fiatpp,price); - LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); - free_json(retjson); - } - } + //printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); + price = jdouble(retjson,"price"); + LP_autopriceset(ctx,1,kmdpp,fiatpp,price); + LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); + free_json(retjson); } } - if ( nxtkmd > SMALLVAL ) + } + } + if ( nxtkmd > SMALLVAL ) + { + for (i=0; i (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); - free_json(retjson); - } + bidsatoshis = j64bits(bid,"priceNQT") * atoi(assetids[i][2]); + asksatoshis = j64bits(ask,"priceNQT") * atoi(assetids[i][2]); + if ( bidsatoshis != 0 && asksatoshis != 0 ) + price = 0.5 * dstr(bidsatoshis + asksatoshis) * nxtkmd; } + LP_autopriceset(ctx,1,kmdpp,nxtpp,price); + LP_autopriceset(ctx,-1,nxtpp,kmdpp,price); + //printf("%s %s -> (%s) nxtkmd %.8f %.8f %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd,0.5*dstr(bidsatoshis + asksatoshis),price); + free_json(retjson); } } } + } +} + +void prices_loop(void *ignore) +{ + char *buycoin,*sellcoin,*retstr; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + while ( 1 ) + { + printf("prices_loop\n"); + if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) + { + sleep(60); + continue; + } + if ( LP_autoprices != 0 ) + LP_autoprice_iter(ctx,btcpp); if ( LP_autofills > 0 ) { - char *buycoin,*sellcoin; struct iguana_info *buy,*sell; if ( (retstr= LP_portfolio()) != 0 ) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) @@ -379,7 +383,7 @@ void prices_loop(void *ignore) } free(retstr); } - } + } else printf("LP_autofills.%d\n",LP_autofills); sleep(60); } } From 654b1b99ddef6f79de650d4f0047f46ce7de6798 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 11:17:30 +0200 Subject: [PATCH 362/682] Test --- iguana/exchanges/autofill | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/autofill diff --git a/iguana/exchanges/autofill b/iguana/exchanges/autofill new file mode 100755 index 000000000..47afea4f1 --- /dev/null +++ b/iguana/exchanges/autofill @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"autofill\",\"base\":\"KMD\",\"rel\":\"BTC\",\"price\":0.0005,\"relvolume\":0.1}" From b697da6e6b3a54fbe0d775b695417c18138630db Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:05:22 +0200 Subject: [PATCH 363/682] Test --- iguana/exchanges/LP_commands.c | 11 +++--- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_portfolio.c | 67 ++++++++++++++++++++++++--------- iguana/exchanges/LP_prices.c | 4 +- iguana/exchanges/goals | 2 + 5 files changed, 59 insertions(+), 27 deletions(-) create mode 100755 iguana/exchanges/goals diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9d25f3d8d..3c7244f3f 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -96,8 +96,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r available localhost RPC commands:\n \ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ -autofill(base, rel, price, relvolume)\n\ -goal(coin, perc)\n\ +goal(coin=*, perc=)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ @@ -183,12 +182,12 @@ trust(pubkey, trust)\n\ return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); } - else if ( strcmp(method,"autofill") == 0 ) + /*else if ( strcmp(method,"autofill") == 0 ) { if ( LP_autofill(base,rel,price,jdouble(argjson,"relvolume")) < 0 ) return(clonestr("{\"error\":\"couldnt set autofill\"}")); else return(clonestr("{\"result\":\"success\"}")); - } + }*/ else if ( strcmp(method,"myprice") == 0 ) { if ( LP_myprice(&bid,&ask,base,rel) > SMALLVAL ) @@ -268,10 +267,10 @@ trust(pubkey, trust)\n\ } } else if ( strcmp(method,"goal") == 0 ) - { return(LP_portfolio_goal(coin,jdouble(argjson,"perc"))); - } } + else if ( strcmp(method,"goal") == 0 ) + return(LP_portfolio_goal("*",100.)); else if ( strcmp(method,"swapstatus") == 0 ) { uint32_t requestid,quoteid; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 9e3020e9b..295341e05 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -183,7 +183,7 @@ struct iguana_info uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; char symbol[16],smartaddr[64],userpass[1024],serverport[128]; // portfolio - double price_kmd,force,perc,goal,goalperc; + double price_kmd,force,perc,goal,goalperc,relvolume; uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB; uint8_t pubkey33[33]; }; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 05e670afd..30401bf72 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -29,6 +29,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) jaddnum(item,"perc",coin->perc); jaddnum(item,"goal",coin->goal); jaddnum(item,"goalperc",coin->goalperc); + jaddnum(item,"relvolume",coin->relvolume); jaddnum(item,"force",coin->force); jaddnum(item,"balanceA",dstr(coin->balanceA)); jaddnum(item,"valuesumA",dstr(coin->valuesumA)); @@ -90,14 +91,18 @@ char *LP_portfolio() } else { + coin->relvolume = 0.; if ( kmdsum > SMALLVAL ) coin->perc = 100. * coin->kmd_equiv / kmdsum; if ( goalsum > SMALLVAL && coin->goal > SMALLVAL ) { coin->goalperc = 100. * coin->goal / goalsum; if ( (coin->force= (coin->goalperc - coin->perc)) < 0. ) + { coin->force *= -coin->force; - else coin->force *= coin->force; + if ( coin->price_kmd > SMALLVAL ) + coin->relvolume = (coin->kmd_equiv * (coin->goalperc - coin->perc) / 100.) / coin->price_kmd; + } else coin->force *= coin->force; if ( coin->force > maxval ) { maxval = coin->force; @@ -131,17 +136,45 @@ char *LP_portfolio() char *LP_portfolio_goal(char *symbol,double goal) { - struct iguana_info *coin; - if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) + struct iguana_info *coin,*tmp; int32_t iter,n = 0; double kmdbtc = 50.; + if ( strcmp(symbol,"*") == 0 ) + { + if ( (coin= LP_coinfind("KMD")) != 0 ) + coin->goal = 25.; + if ( (coin= LP_coinfind("BTC")) != 0 ) + coin->goal = 25.; + for (iter=0; iter<2; iter++) + { + HASH_ITER(hh,LP_coins,coin,tmp) + { + if ( iter == 0 ) + coin->goal = 0; + if ( coin->inactive == 0 && strcmp(coin->symbol,"KMD") != 0 && strcmp(coin->symbol,"BTC") != 0 ) + { + if ( iter == 0 ) + n++; + else coin->goal = (100. - kmdbtc) / n; + } + } + if ( n == 0 ) + break; + } + if ( (coin= LP_coinfind("KMD")) != 0 ) + coin->goal = kmdbtc * 0.5; + if ( (coin= LP_coinfind("BTC")) != 0 ) + coin->goal = kmdbtc * 0.5; + return(LP_portfolio()); + } + else if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) { coin->goal = goal; return(LP_portfolio()); } else return(clonestr("{\error\":\"cant set goal for inactive coin\"}")); } -int32_t LP_autoprices,LP_autofills; +int32_t LP_autoprices; -int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) +/*int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) { struct LP_priceinfo *basepp,*relpp; if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) @@ -152,7 +185,7 @@ int32_t LP_autofill(char *base,char *rel,double maxprice,double totalrelvolume) return(0); } return(-1); -} +}*/ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *type) { @@ -361,7 +394,6 @@ void prices_loop(void *ignore) char *buycoin,*sellcoin,*retstr; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { - printf("prices_loop\n"); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) { sleep(60); @@ -369,21 +401,20 @@ void prices_loop(void *ignore) } if ( LP_autoprices != 0 ) LP_autoprice_iter(ctx,btcpp); - if ( LP_autofills > 0 ) + if ( (retstr= LP_portfolio()) != 0 ) { - if ( (retstr= LP_portfolio()) != 0 ) + if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) + if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) - { - printf("buy.%s force %f, sell.%s force %f\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce")); - } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); - free_json(retjson); - } - free(retstr); + printf("base buy.%s force %f, rel sell.%s force %f relvolume %f\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume); + //if ( (autxo= LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume)) == 0 ) + // return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); + free_json(retjson); } - } else printf("LP_autofills.%d\n",LP_autofills); + free(retstr); + } sleep(60); } } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 24f1bb435..7995c8cd7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -31,8 +31,8 @@ struct LP_priceinfo double myprices[LP_MAXPRICEINFOS]; double minprices[LP_MAXPRICEINFOS]; // autoprice double margins[LP_MAXPRICEINFOS]; - double maxprices[LP_MAXPRICEINFOS]; // autofill of base/rel - double relvols[LP_MAXPRICEINFOS]; + //double maxprices[LP_MAXPRICEINFOS]; // autofill of base/rel + //double relvols[LP_MAXPRICEINFOS]; FILE *fps[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; diff --git a/iguana/exchanges/goals b/iguana/exchanges/goals new file mode 100755 index 000000000..b9735de5f --- /dev/null +++ b/iguana/exchanges/goals @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\"}" From 81005650e66013cd0f00af569b5fe164d5400ddb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:09:05 +0200 Subject: [PATCH 364/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 30401bf72..bd1193e09 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -101,7 +101,7 @@ char *LP_portfolio() { coin->force *= -coin->force; if ( coin->price_kmd > SMALLVAL ) - coin->relvolume = (coin->kmd_equiv * (coin->goalperc - coin->perc) / 100.) / coin->price_kmd; + coin->relvolume = (coin->maxamount * (coin->perc - coin->goalperc)) / 100.; } else coin->force *= coin->force; if ( coin->force > maxval ) { From 623b4a8d257bfa9f396d31ae7d8caada11b3c8b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:14:18 +0200 Subject: [PATCH 365/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index bd1193e09..822bc25f6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -101,7 +101,7 @@ char *LP_portfolio() { coin->force *= -coin->force; if ( coin->price_kmd > SMALLVAL ) - coin->relvolume = (coin->maxamount * (coin->perc - coin->goalperc)) / 100.; + coin->relvolume = (dstr(coin->maxamount) * (coin->perc - coin->goalperc)) / 100.; } else coin->force *= coin->force; if ( coin->force > maxval ) { From eca0bbbaa6c64add4dfcc323d601ebcd2055a994 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:27:31 +0200 Subject: [PATCH 366/682] Test --- iguana/exchanges/LP_portfolio.c | 5 +++-- iguana/exchanges/forward | 2 -- iguana/exchanges/install | 2 +- iguana/exchanges/lookup | 2 -- 4 files changed, 4 insertions(+), 7 deletions(-) delete mode 100755 iguana/exchanges/forward delete mode 100755 iguana/exchanges/lookup diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 822bc25f6..230bc625c 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -391,7 +391,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) void prices_loop(void *ignore) { - char *buycoin,*sellcoin,*retstr; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *buycoin,*sellcoin,*retstr; double bid,ask,maxprice; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -407,7 +407,8 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - printf("base buy.%s force %f, rel sell.%s force %f relvolume %f\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume); + maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); + printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); //if ( (autxo= LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume)) == 0 ) // return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); diff --git a/iguana/exchanges/forward b/iguana/exchanges/forward deleted file mode 100755 index 966e6af67..000000000 --- a/iguana/exchanges/forward +++ /dev/null @@ -1,2 +0,0 @@ -source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"getprice\",\"base\":\"REVS\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 0e913c346..bd9f680bd 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp goal portfolio autoprice autofill deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable forward myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv lookup pub setprice status utxos ../dexscripts +cp goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/lookup b/iguana/exchanges/lookup deleted file mode 100755 index af9cdd645..000000000 --- a/iguana/exchanges/lookup +++ /dev/null @@ -1,2 +0,0 @@ -source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"lookup\",\"client\":\"$1\"}" From a437aba712ebfb8ae441e7531b488c960dac0213 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:38:45 +0200 Subject: [PATCH 367/682] Test --- iguana/exchanges/LP_portfolio.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 230bc625c..90ce1671d 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -18,6 +18,9 @@ // marketmaker // +char LP_portfolio_base[16],LP_portfolio_rel[16]; +double LP_portfolio_relvolume; + cJSON *LP_portfolio_entry(struct iguana_info *coin) { cJSON *item = cJSON_CreateObject(); @@ -130,6 +133,12 @@ char *LP_portfolio() jaddstr(retjson,"sellcoin",sellcoin->symbol); jaddnum(retjson,"sellforce",minval); } + if ( LP_portfolio_relvolume > SMALLVAL ) + { + jaddstr(retjson,"base",LP_portfolio_base); + jaddstr(retjson,"rel",LP_portfolio_rel); + jaddnum(retjson,"relvolume",LP_portfolio_relvolume); + } jadd(retjson,"portfolio",array); return(jprint(retjson,1)); } @@ -391,7 +400,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) void prices_loop(void *ignore) { - char *buycoin,*sellcoin,*retstr; double bid,ask,maxprice; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -409,8 +418,20 @@ void prices_loop(void *ignore) { maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - //if ( (autxo= LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume)) == 0 ) - // return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); + if ( maxprice > SMALLVAL ) + { + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 ) + { + printf("LP_autotrade.(%s)\n",retstr2); + free(retstr2); + } + } + else + { + strcpy(LP_portfolio_base,buycoin); + strcpy(LP_portfolio_rel,sellcoin); + LP_portfolio_relvolume = sell->relvolume; + } } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); free_json(retjson); } From ac363f189878a070a35f2c811d1ff4a55ebc245a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:48:49 +0200 Subject: [PATCH 368/682] Test --- iguana/exchanges/LP_portfolio.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 90ce1671d..664935955 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -400,7 +400,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) void prices_loop(void *ignore) { - char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice; struct iguana_info *buy,*sell; cJSON *retjson; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -420,10 +420,26 @@ void prices_loop(void *ignore) printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( maxprice > SMALLVAL ) { - if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 ) + relvolume = sell->relvolume; + while ( relvolume > 0.0001 ) { - printf("LP_autotrade.(%s)\n",retstr2); - free(retstr2); + requestid = quoteid = 0; + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 ) + { + if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) + { + if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + { + + } + free_json(retjson2); + } + printf("relvolume %.8f LP_autotrade.(%s)\n",relvolume,retstr2); + free(retstr2); + } + if ( requestid != 0 && quoteid != 0 ) + break; + relvolume *= 0.1; } } else From b669071678ca311684ca768d6e8769a2e38115c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 12:55:35 +0200 Subject: [PATCH 369/682] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++++--- iguana/exchanges/LP_prices.c | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2abe38779..e5e5040b5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -594,7 +594,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh { if ( bestprice == 0. ) // assumes price ordered asks bestprice = price; - //printf("item.[%d] %s\n",i,jprint(item,0)); + printf("item.[%d] %s\n",i,jprint(item,0)); txid = jbits256(item,"txid"); vout = jint(item,"vout"); vol = jdouble(item,"volume"); @@ -634,10 +634,14 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( butxo != 0 ) printf("%llu %llu %d %d %d: ",(long long)(vol*SATOSHIDEN),(long long)butxo->S.satoshis,vol*SATOSHIDEN == butxo->S.satoshis,LP_isavailable(butxo) > 0,LP_ismine(butxo) == 0); printf("cant find butxo.%p or value mismatch %.8f != %.8f or bestflag.%d\n",butxo,vol,butxo!=0?dstr(butxo->S.satoshis):0,butxo->T.bestflag); - //if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) } } else printf("self trading or blacklisted peer\n"); - } else break; + } + else + { + printf("maxprice %.8f vs %.8f\n",maxprice,price); + break; + } } } free_json(orderbook); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7995c8cd7..d85e6d29a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -584,13 +584,13 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) qsort(bids,numbids,sizeof(*bids),_cmp_orderbook); if ( numasks > 1 ) { - for (i=0; iprice); - printf(" -> "); + //for (i=0; iprice); + //printf(" -> "); qsort(asks,numasks,sizeof(*asks),_cmp_orderbook); - for (i=0; iprice); - printf("sorted asks.%d\n",numasks); + //for (i=0; iprice); + //printf("sorted asks.%d\n",numasks); } for (i=0; i Date: Thu, 20 Jul 2017 13:03:08 +0200 Subject: [PATCH 370/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 664935955..2ea1619d9 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -416,7 +416,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); + maxprice = 1.01 * LP_myprice(&bid,&ask,buycoin,sellcoin); printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( maxprice > SMALLVAL ) { From 8f8482d1e66c71ec48d76d3fc1693e5bc8c82298 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 13:18:51 +0200 Subject: [PATCH 371/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2ea1619d9..2d1c0b925 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -416,7 +416,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - maxprice = 1.01 * LP_myprice(&bid,&ask,buycoin,sellcoin); + maxprice = 1.02 * LP_myprice(&bid,&ask,buycoin,sellcoin); printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( maxprice > SMALLVAL ) { From e903a438f5f1ce05550172121731e6cc56fbfa76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 13:37:06 +0200 Subject: [PATCH 372/682] Test --- iguana/exchanges/LP_portfolio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2d1c0b925..fab0b57a1 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -214,10 +214,10 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ double margin,minprice; int32_t changed; if ( (margin= basepp->margins[relpp->ind]) != 0. ) { + printf("%s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); - //printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) { LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); @@ -416,7 +416,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - maxprice = 1.02 * LP_myprice(&bid,&ask,buycoin,sellcoin); + maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( maxprice > SMALLVAL ) { From 92e93ad9ddd853d91ab277dfc4a33d2e4c98daa1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 13:50:43 +0200 Subject: [PATCH 373/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index fab0b57a1..3a4ce8324 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -214,7 +214,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ double margin,minprice; int32_t changed; if ( (margin= basepp->margins[relpp->ind]) != 0. ) { - printf("%s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); + printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d85e6d29a..a81ea73ac 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -344,6 +344,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) *changedp = 1; basepp->myprices[relpp->ind] = price; // ask + printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 ) { From 9fae01f75761b85a966f6c8ec15f87181c235483 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 14:03:19 +0200 Subject: [PATCH 374/682] Test --- iguana/exchanges/LP_portfolio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 3a4ce8324..107137a83 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -211,9 +211,13 @@ int32_t LP_autoprice(char *base,char *rel,double minprice,double margin,char *ty void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_priceinfo *basepp,double price) { - double margin,minprice; int32_t changed; - if ( (margin= basepp->margins[relpp->ind]) != 0. ) + double margin,minprice,oppomargin; int32_t changed; + margin = basepp->margins[relpp->ind]; + oppomargin = relpp->margins[basepp->ind]; + if ( margin != 0. || oppomargin != 0. ) { + if ( margin == 0. ) + margin = oppomargin; printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) price = 1. / (price * (1. - margin)); From c72051a5171a44bef2e17d22ac791f50aa8c4ff1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 14:10:13 +0200 Subject: [PATCH 375/682] Test --- iguana/exchanges/LP_portfolio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 107137a83..840a448eb 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -420,7 +420,8 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) { - maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); + LP_myprice(&bid,&ask,buycoin,sellcoin); + maxprice = ask; printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( maxprice > SMALLVAL ) { From 204f92d6abf16c22e44ec17a0e2e40299a9d91af Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 14:14:17 +0200 Subject: [PATCH 376/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- iguana/exchanges/LP_portfolio.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e5e5040b5..c15ffa618 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -440,13 +440,13 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } - if ( (price= LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin)) <= SMALLVAL || ask <= SMALLVAL ) + if ( (price= LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin)) <= SMALLVAL || bid <= SMALLVAL ) { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); return(clonestr("{\"error\":\"no price set\"}")); } - price = 1. / ask; + price = 1. / bid; if ( qprice > price+0.00000001 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 840a448eb..2d9a26b0f 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -218,7 +218,7 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ { if ( margin == 0. ) margin = oppomargin; - printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); + //printf("min %.8f %s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",basepp->minprices[relpp->ind],relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); if ( dir > 0 ) price = 1. / (price * (1. - margin)); else price = (price * (1. + margin)); From 79d2c680331ee90f273c77181f6bec520c0fb2db Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 14:53:17 +0200 Subject: [PATCH 377/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_portfolio.c | 6 +++--- iguana/exchanges/LP_prices.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 21661ab86..242743d93 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -271,7 +271,7 @@ struct iguana_info *LP_coinfind(char *symbol) assetname = ""; if ( strcmp(symbol,"BTC") == 0 ) { - txfee = 50000; + txfee = 0; estimatedrate = 300; pubtype = 0; p2shtype = 5; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2d9a26b0f..da3956e43 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -404,7 +404,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) void prices_loop(void *ignore) { - char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid,iter; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -423,10 +423,10 @@ void prices_loop(void *ignore) LP_myprice(&bid,&ask,buycoin,sellcoin); maxprice = ask; printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - if ( maxprice > SMALLVAL ) + if ( maxprice > SMALLVAL && LP_utxo_bestfit(sellcoin,sell->relvolume) != 0 ) { relvolume = sell->relvolume; - while ( relvolume > 0.0001 ) + for (iter=0; iter<3; iter++) { requestid = quoteid = 0; if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index a81ea73ac..6cc7a79c8 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -344,7 +344,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) *changedp = 1; basepp->myprices[relpp->ind] = price; // ask - printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); + //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 ) { From d30e1280418fa912d0d6efac9d8a87b72111597d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 15:16:32 +0200 Subject: [PATCH 378/682] Test --- iguana/exchanges/LP_portfolio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index da3956e43..d38f54607 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -75,7 +75,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 ) + if ( coin->inactive != 0 && coin->goal == 0 ) continue; if ( iter == 0 ) { @@ -156,6 +156,8 @@ char *LP_portfolio_goal(char *symbol,double goal) { HASH_ITER(hh,LP_coins,coin,tmp) { + if ( coin->inactive != 0 ) + continue; if ( iter == 0 ) coin->goal = 0; if ( coin->inactive == 0 && strcmp(coin->symbol,"KMD") != 0 && strcmp(coin->symbol,"BTC") != 0 ) From 449d7465f257f849af5ffdf136192f3de295f4ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 15:18:58 +0200 Subject: [PATCH 379/682] Test --- iguana/exchanges/LP_portfolio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index d38f54607..68ad9fb94 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -75,7 +75,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 && coin->goal == 0 ) + if ( coin->inactive != 0 ) continue; if ( iter == 0 ) { @@ -148,10 +148,6 @@ char *LP_portfolio_goal(char *symbol,double goal) struct iguana_info *coin,*tmp; int32_t iter,n = 0; double kmdbtc = 50.; if ( strcmp(symbol,"*") == 0 ) { - if ( (coin= LP_coinfind("KMD")) != 0 ) - coin->goal = 25.; - if ( (coin= LP_coinfind("BTC")) != 0 ) - coin->goal = 25.; for (iter=0; iter<2; iter++) { HASH_ITER(hh,LP_coins,coin,tmp) @@ -170,9 +166,9 @@ char *LP_portfolio_goal(char *symbol,double goal) if ( n == 0 ) break; } - if ( (coin= LP_coinfind("KMD")) != 0 ) + if ( (coin= LP_coinfind("KMD")) != 0 && coin->inactive == 0 ) coin->goal = kmdbtc * 0.5; - if ( (coin= LP_coinfind("BTC")) != 0 ) + if ( (coin= LP_coinfind("BTC")) != 0 && coin->inactive == 0 ) coin->goal = kmdbtc * 0.5; return(LP_portfolio()); } @@ -420,7 +416,7 @@ void prices_loop(void *ignore) { if ( (retjson= cJSON_Parse(retstr)) != 0 ) { - if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) + if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 && buy->inactive == 0 && sell->inactive == 0 ) { LP_myprice(&bid,&ask,buycoin,sellcoin); maxprice = ask; From 6fec1468af7af52e8aee9b096deed49fdf5deb10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 15:31:32 +0200 Subject: [PATCH 380/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/goal | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3c7244f3f..4d1488fff 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -267,7 +267,7 @@ trust(pubkey, trust)\n\ } } else if ( strcmp(method,"goal") == 0 ) - return(LP_portfolio_goal(coin,jdouble(argjson,"perc"))); + return(LP_portfolio_goal(coin,jdouble(argjson,"val"))); } else if ( strcmp(method,"goal") == 0 ) return(LP_portfolio_goal("*",100.)); diff --git a/iguana/exchanges/goal b/iguana/exchanges/goal index b6dafb282..3fd9dee0f 100755 --- a/iguana/exchanges/goal +++ b/iguana/exchanges/goal @@ -1,4 +1,4 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"perc\":99}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"perc\":10}" -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"perc\":1}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"val\":99}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"val\":10}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"val\":1}" From 6197536324a4d1d165dd31ee861da42fe6ffc9ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 15:56:04 +0200 Subject: [PATCH 381/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 68ad9fb94..cead86e0b 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -176,7 +176,7 @@ char *LP_portfolio_goal(char *symbol,double goal) { coin->goal = goal; return(LP_portfolio()); - } else return(clonestr("{\error\":\"cant set goal for inactive coin\"}")); + } else return(clonestr("{\"error\":\"cant set goal for inactive coin\"}")); } int32_t LP_autoprices; From a9838943d22a43bd4059bf89cb9502b8c035d566 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:36:56 +0200 Subject: [PATCH 382/682] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_nativeDEX.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4d1488fff..6b6e97c2e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -171,7 +171,9 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { - if ( LP_mypriceset(&changed,base,rel,price) < 0 ) + //if ( LP_mypriceset(&changed,base,rel,price) < 0 ) + // return(clonestr("{\"error\":\"couldnt set price\"}")); + if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9dc9fd350..ddfe87719 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,10 +19,12 @@ // // new features: // stats +// multidimensional portfolio // autoutxo // bugs: // false detection of bobreclaim +// relax ordermatch constraints? // unduplicated bugs: // swap cancel should cleanly cancel From 5a3e485035f12dfd6641798d06103b860f25fb15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:38:22 +0200 Subject: [PATCH 383/682] Test --- iguana/exchanges/LP_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 6b6e97c2e..35214563d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -171,9 +171,9 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { - //if ( LP_mypriceset(&changed,base,rel,price) < 0 ) - // return(clonestr("{\"error\":\"couldnt set price\"}")); - if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) + if ( LP_mypriceset(&changed,base,rel,price) < 0 ) + return(clonestr("{\"error\":\"couldnt set price\"}")); + else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); From 344a1f4deb20c57dce488a7580d2bf1483ded680 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:40:12 +0200 Subject: [PATCH 384/682] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c15ffa618..e74c93d45 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -440,13 +440,14 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } - if ( (price= LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin)) <= SMALLVAL || bid <= SMALLVAL ) + if ( LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin) <= SMALLVAL || (bid <= SMALLVAL && ask <= SMALLVAL) ) { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); return(clonestr("{\"error\":\"no price set\"}")); } - price = 1. / bid; + if ( (price= ask) == 0. ) + price = 1. / bid; if ( qprice > price+0.00000001 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); From cf7f11fdd0bd56cef4cb0d9de080685f8beb610a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:45:15 +0200 Subject: [PATCH 385/682] Test --- iguana/exchanges/LP_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 35214563d..714e7dc1e 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -173,8 +173,8 @@ trust(pubkey, trust)\n\ { if ( LP_mypriceset(&changed,base,rel,price) < 0 ) return(clonestr("{\"error\":\"couldnt set price\"}")); - else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) - return(clonestr("{\"error\":\"couldnt set price\"}")); + //else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 ) + // return(clonestr("{\"error\":\"couldnt set price\"}")); else return(LP_pricepings(ctx,myipaddr,LP_mypubsock,base,rel,price * LP_profitratio)); } else return(clonestr("{\"error\":\"no price\"}")); } From 37036e062c80a37eb0f82c33f1e23602f300c7d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:49:25 +0200 Subject: [PATCH 386/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e74c93d45..ee7c2d897 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -447,7 +447,7 @@ char *LP_connectedalice(cJSON *argjson) // alice return(clonestr("{\"error\":\"no price set\"}")); } if ( (price= ask) == 0. ) - price = 1. / bid; + price = bid; if ( qprice > price+0.00000001 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); From 66e710c97054bfcac5f7f4c31150aaa1359aedcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:51:41 +0200 Subject: [PATCH 387/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ee7c2d897..884d314e0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -440,7 +440,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } - if ( LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin) <= SMALLVAL || (bid <= SMALLVAL && ask <= SMALLVAL) ) + if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || (bid <= SMALLVAL && ask <= SMALLVAL) ) { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); From 36ce73cc500b833eff0eed4fe61710b859c19c96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:55:13 +0200 Subject: [PATCH 388/682] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 884d314e0..8a687d41f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -446,6 +446,7 @@ char *LP_connectedalice(cJSON *argjson) // alice LP_availableset(autxo); return(clonestr("{\"error\":\"no price set\"}")); } + printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); if ( (price= ask) == 0. ) price = bid; if ( qprice > price+0.00000001 ) From f40fd226fdff14c4bca396b4d3d39692f1d84041 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:57:05 +0200 Subject: [PATCH 389/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 8a687d41f..7f74a8859 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -440,14 +440,14 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } - if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || (bid <= SMALLVAL && ask <= SMALLVAL) ) + if ( LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin) <= SMALLVAL || bid <= SMALLVAL ) { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); return(clonestr("{\"error\":\"no price set\"}")); } printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); - if ( (price= ask) == 0. ) + //if ( (price= ask) == 0. ) price = bid; if ( qprice > price+0.00000001 ) { From 4cd3a1f42eb72c2ff4b5c4ac37d65e5505d77a15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 21 Jul 2017 14:27:57 +0200 Subject: [PATCH 390/682] "Condor" field --- iguana/exchanges/LP_coins.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 242743d93..171bb00a6 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -81,9 +81,9 @@ void LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) free(rpcpassword); } -void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name) +void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name,char *coindir) { - sprintf(fname,"%s",LP_getdatadir()); + sprintf(fname,"%s",(coindir != 0 && coindir[0] != 0) ? coindir : LP_getdatadir()); #ifdef WIN32 strcat(fname,"\\"); #else @@ -138,7 +138,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name strcat(fname,str); } -int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name) +int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name,char *coindir) { FILE *fp; char fname[512],username[512],password[512],confname[512]; userpass[0] = 0; @@ -152,14 +152,14 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c if ( strcmp(&confname[len-4],"coin") == 0 ) confname[len - 4] = 'C'; #endif - LP_statefname(fname,symbol,assetname,confname,name); + LP_statefname(fname,symbol,assetname,confname,name,coindir); if ( (fp= fopen(fname,"rb")) != 0 ) { LP_userpassfp(symbol,username,password,fp); sprintf(userpass,"%s:%s",username,password); fclose(fp); if ( 0 ) - printf("LP_statefname.(%s) <- %s %s %s (%s)\n",fname,name,symbol,assetname,userpass); + printf("LP_statefname.(%s) <- %s %s %s (%s) (%s)\n",fname,name,symbol,assetname,userpass,coindir); return((int32_t)strlen(userpass)); } else printf("cant open.(%s)\n",fname); return(-1); @@ -215,7 +215,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) return(coin); } -int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport) +int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *coindir) { char *name2; memset(coin,0,sizeof(*coin)); @@ -240,7 +240,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); } - return(LP_userpass(coin->userpass,symbol,assetname,name,name2)); + return(LP_userpass(coin->userpass,symbol,assetname,name,name2,coindir)); } int32_t LP_isdisabled(char *base,char *rel) @@ -281,7 +281,7 @@ struct iguana_info *LP_coinfind(char *symbol) else if ( strcmp(symbol,"KMD") == 0 ) name = "komodo"; else return(0); - if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport) > 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport,0) > 0 ) { if ( (coin= LP_coinadd(&cdata)) != 0 ) { @@ -322,7 +322,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; - if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port)) < 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"coindir")) < 0 ) { coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); From 19f2b07979ac6327f427f0bb177e653a05d7b795 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 21 Jul 2017 19:34:37 +0200 Subject: [PATCH 391/682] Mona --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 17fe0b7f8..00f18e21d 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From a6e3b820e5e39590b08c12eb32e645c38269f381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:03:46 +0200 Subject: [PATCH 392/682] MOA --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 00f18e21d..7d448d624 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 57e0d37060b49d8ef5cbee93a268f82e68b0e6a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:08:14 +0200 Subject: [PATCH 393/682] Test --- iguana/exchanges/LP_coins.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 171bb00a6..27da36cd1 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -255,7 +255,7 @@ int32_t LP_isdisabled(char *base,char *rel) struct iguana_info *LP_coinfind(char *symbol) { - struct iguana_info *coin,cdata; int32_t isPoS,longestchain = 1; uint16_t port,busport; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname; + struct iguana_info *coin,cdata; int32_t isinactive,isPoS,longestchain = 1; uint16_t port,busport; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname; if ( (coin= LP_coinsearch(symbol)) != 0 ) return(coin); if ( (port= LP_rpcport(symbol)) == 0 ) @@ -281,17 +281,16 @@ struct iguana_info *LP_coinfind(char *symbol) else if ( strcmp(symbol,"KMD") == 0 ) name = "komodo"; else return(0); - if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport,0) > 0 ) + isinactive = LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0,0,busport,0) < 0; + if ( (coin= LP_coinadd(&cdata)) != 0 ) { - if ( (coin= LP_coinadd(&cdata)) != 0 ) + coin->inactive = isinactive * (uint32_t)time(NULL); + if ( strcmp(symbol,"KMD") == 0 ) + coin->inactive = 0; + else if ( strcmp(symbol,"BTC") == 0 ) { - if ( strcmp(symbol,"KMD") == 0 ) - coin->inactive = 0; - else if ( strcmp(symbol,"BTC") == 0 ) - { - coin->inactive = (uint32_t)time(NULL) * !IAMLP; - printf("BTC inactive.%u\n",coin->inactive); - } + coin->inactive = (uint32_t)time(NULL) * !IAMLP; + printf("BTC inactive.%u\n",coin->inactive); } } return(coin); From 147eb7ca52270af2fc7c0a67d9a1af4053999d2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:27:04 +0200 Subject: [PATCH 394/682] Test --- iguana/exchanges/LP_coins.c | 43 +++++++++++++++++++++++++++------ iguana/exchanges/LP_commands.c | 3 +++ iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/coins | 2 +- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 27da36cd1..09ed0bc1f 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -81,9 +81,14 @@ void LP_userpassfp(char *symbol,char *username,char *password,FILE *fp) free(rpcpassword); } -void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name,char *coindir) +void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name,char *confpath) { - sprintf(fname,"%s",(coindir != 0 && coindir[0] != 0) ? coindir : LP_getdatadir()); + if ( confpath != 0 && confpath[0] != 0 ) + { + strcpy(fname,confpath); + return; + } + sprintf(fname,"%s",LP_getdatadir()); #ifdef WIN32 strcat(fname,"\\"); #else @@ -138,7 +143,7 @@ void LP_statefname(char *fname,char *symbol,char *assetname,char *str,char *name strcat(fname,str); } -int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name,char *coindir) +int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,char *name,char *confpath) { FILE *fp; char fname[512],username[512],password[512],confname[512]; userpass[0] = 0; @@ -152,14 +157,14 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c if ( strcmp(&confname[len-4],"coin") == 0 ) confname[len - 4] = 'C'; #endif - LP_statefname(fname,symbol,assetname,confname,name,coindir); + LP_statefname(fname,symbol,assetname,confname,name,confpath); if ( (fp= fopen(fname,"rb")) != 0 ) { LP_userpassfp(symbol,username,password,fp); sprintf(userpass,"%s:%s",username,password); fclose(fp); if ( 0 ) - printf("LP_statefname.(%s) <- %s %s %s (%s) (%s)\n",fname,name,symbol,assetname,userpass,coindir); + printf("LP_statefname.(%s) <- %s %s %s (%s) (%s)\n",fname,name,symbol,assetname,userpass,confpath); return((int32_t)strlen(userpass)); } else printf("cant open.(%s)\n",fname); return(-1); @@ -194,6 +199,28 @@ cJSON *LP_coinsjson() return(array); } +char *LP_getcoin(char *symbol) +{ + int32_t numenabled,numdisabled; struct iguana_info *coin,*tmp; cJSON *item=0,*retjson; + numenabled = numdisabled = 0; + retjson = cJSON_CreateObject(); + HASH_ITER(hh,LP_coins,coin,tmp) + { + if ( strcmp(symbol,coin->symbol) == 0 ) + item = LP_coinjson(coin); + if ( coin->inactive == 0 ) + numenabled++; + else numdisabled++; + } + jaddstr(retjson,"result","success"); + jaddnum(retjson,"enabled",numenabled); + jaddnum(retjson,"disabled",numdisabled); + if ( item == 0 ) + item = cJSON_CreateObject(); + jadd(retjson,"coin",item); + return(jprint(retjson,1)); +} + struct iguana_info *LP_coinsearch(char *symbol) { struct iguana_info *coin; @@ -215,7 +242,7 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) return(coin); } -int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *coindir) +int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t wiftaddr,uint8_t taddr,uint16_t busport,char *confpath) { char *name2; memset(coin,0,sizeof(*coin)); @@ -240,7 +267,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); } - return(LP_userpass(coin->userpass,symbol,assetname,name,name2,coindir)); + return(LP_userpass(coin->userpass,symbol,assetname,name,name2,confpath)); } int32_t LP_isdisabled(char *base,char *rel) @@ -321,7 +348,7 @@ struct iguana_info *LP_coincreate(cJSON *item) } else if ( (name= jstr(item,"name")) == 0 ) name = symbol; - if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"coindir")) < 0 ) + if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"confpath")) < 0 ) { coin = LP_coinadd(&cdata); coin->inactive = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 714e7dc1e..44ec89f0f 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -109,6 +109,7 @@ swapstatus()\n\ swapstatus(requestid, quoteid)\n\ public API:\n \ getcoins()\n\ +getcoin(coin)\n\ portfolio()\n\ getpeers()\n\ getutxos()\n\ @@ -270,6 +271,8 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"goal") == 0 ) return(LP_portfolio_goal(coin,jdouble(argjson,"val"))); + else if ( strcmp(method,"getcoin") == 0 ) + return(LP_getcoin(coin)); } else if ( strcmp(method,"goal") == 0 ) return(LP_portfolio_goal("*",100.)); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index cead86e0b..082d8a7e7 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -451,7 +451,7 @@ void prices_loop(void *ignore) strcpy(LP_portfolio_rel,sellcoin); LP_portfolio_relvolume = sell->relvolume; } - } else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); + } //else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); free_json(retjson); } free(retstr); diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 7d448d624..45bcd6fec 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":1, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":1, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":/${HOME#"/"}/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 1c2553ed63c7b931070e8a87592f9c07f0f08616 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:32:25 +0200 Subject: [PATCH 395/682] Get coin --- iguana/exchanges/getcoin | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/getcoin diff --git a/iguana/exchanges/getcoin b/iguana/exchanges/getcoin new file mode 100755 index 000000000..88ce8912e --- /dev/null +++ b/iguana/exchanges/getcoin @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getcoin\",\"coin\":\"LTC\"}" From d89e8f9d8771484d596b054d5a67dd175baad476 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:54:31 +0200 Subject: [PATCH 396/682] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 295341e05..40fdf150d 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -42,7 +42,7 @@ #define LP_MINPEER_GOOD 20 #define LP_PEERGOOD_ERRORDECAY 0.9 -#define LP_SWAPSTEP_TIMEOUT 3 +#define LP_SWAPSTEP_TIMEOUT 30 #define LP_AUTOTRADE_TIMEOUT 60 #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 From c38ef91607b548dee539e8b8bc0bca0bab22bb2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 11:58:05 +0200 Subject: [PATCH 397/682] Test --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 45bcd6fec..bc0319d02 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":/${HOME#"/"}/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"/root/muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 17ec4b0e920983ee9a6c101b8a0aaceeca14fbee Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:08:05 +0200 Subject: [PATCH 398/682] Test --- iguana/exchanges/LP_commands.c | 9 ++-- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_prices.c | 95 ++++++++++++++++++++++++++++++++- iguana/exchanges/pricearray | 2 + 4 files changed, 100 insertions(+), 7 deletions(-) create mode 100755 iguana/exchanges/pricearray diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 44ec89f0f..35ffde0ec 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -94,6 +94,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ +pricearray(base, rel, timescale=60)\n\ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ goal(coin=*, perc=)\n\ @@ -185,12 +186,10 @@ trust(pubkey, trust)\n\ return(clonestr("{\"error\":\"couldnt set autoprice\"}")); else return(clonestr("{\"result\":\"success\"}")); } - /*else if ( strcmp(method,"autofill") == 0 ) + else if ( strcmp(method,"pricearray") == 0 ) { - if ( LP_autofill(base,rel,price,jdouble(argjson,"relvolume")) < 0 ) - return(clonestr("{\"error\":\"couldnt set autofill\"}")); - else return(clonestr("{\"result\":\"success\"}")); - }*/ + return(jprint(LP_pricearray(base,rel,jint(argjson,"timescale")),1)); + } else if ( strcmp(method,"myprice") == 0 ) { if ( LP_myprice(&bid,&ask,base,rel) > SMALLVAL ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index ddfe87719..4b7dc9e5b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -24,7 +24,6 @@ // bugs: // false detection of bobreclaim -// relax ordermatch constraints? // unduplicated bugs: // swap cancel should cleanly cancel diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6cc7a79c8..f07ae793e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -649,6 +649,99 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas LP_priceinfoupdate(base,rel,price); } +void LP_pricefname(char *fname,char *base,char *rel) +{ + sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel); + OS_compatible_path(fname); +} + +void LP_priceitemadd(cJSON *retarray,uint32_t timestamp,double avebid,double aveask,double highbid,double lowask) +{ + cJSON *item = cJSON_CreateArray(); + jaddinum(item,timestamp); + jaddinum(item,avebid); + jaddinum(item,aveask); + jaddinum(item,highbid); + jaddinum(item,lowask); + jaddi(retarray,item); +} + +cJSON *LP_pricearray(char *base,char *rel,int32_t timescale) +{ + cJSON *retarray; char askfname[1024],bidfname[1024]; uint64_t bidprice64,askprice64; uint32_t bidnow,asknow,bidi,aski,firstbidi,firstaski,lastbidi,lastaski; int32_t numbids,numasks; double bidemit,askemit,bidsum,asksum,bid,ask,highbid,lowbid,highask,lowask; FILE *askfp=0,*bidfp=0; + if ( timescale <= 0 ) + timescale = 60; + LP_pricefname(askfname,base,rel); + LP_pricefname(bidfname,rel,base); + retarray = cJSON_CreateArray(); + firstbidi = firstaski = lastbidi = lastaski = 0; + numbids = numasks = 0; + bidsum = asksum = askemit = bidemit = highbid = lowbid = highask = lowask = 0.; + if ( (bidfp= fopen(bidfname,"rb")) != 0 && (askfp= fopen(askfname,"rb")) != 0 ) + { + bidi = aski = 0; + bidemit = askemit = 0.; + if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) && bidnow != 0 && bidprice64 != 0 ) + { + bidi = bidnow / timescale; + if ( bidi != lastbidi ) + { + if ( bidsum != 0 && numbids != 0 ) + bidemit = bidsum / numbids; + bidsum = 0.; + numbids = 0; + } + bid = dstr(bidprice64); + bidsum += bid; + numbids++; + } else fclose(bidfp), bidfp = 0; + if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) && asknow != 0 && askprice64 != 0 ) + { + aski = asknow / timescale; + if ( aski != lastaski ) + { + if ( asksum != 0 && numasks != 0 ) + askemit = asksum / numasks; + asksum = 0.; + numasks = 0; + } + ask = dstr(askprice64); + asksum += ask; + numasks++; + } else fclose(askfp), askfp = 0; + if ( bidemit != 0. || askemit != 0. ) + { + if ( bidemit != 0. && askemit != 0. && lastbidi == lastaski ) + { + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,askemit,highbid,lowask); + highbid = lowbid = highask = lowask = 0.; + } + else + { + if ( bidemit != 0. ) + { + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,highbid,0.); + highbid = lowbid = 0.; + } + if ( askemit != 0. ) + { + LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,lowask); + highask = lowask = 0.; + } + } + } + if ( bidi != 0 ) + lastbidi = bidi; + if ( aski != 0 ) + lastaski = aski; + } + if ( bidfp != 0 ) + fclose(bidfp); + if ( askfp != 0 ) + fclose(askfp); + return(retarray); +} + void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; @@ -657,7 +750,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { if ( (fp= basepp->fps[relpp->ind]) == 0 ) { - sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel); + LP_pricefname(fname,base,rel); fp = basepp->fps[relpp->ind] = OS_appendfile(fname); } if ( fp != 0 && price > SMALLVAL ) diff --git a/iguana/exchanges/pricearray b/iguana/exchanges/pricearray new file mode 100755 index 000000000..2d151eb56 --- /dev/null +++ b/iguana/exchanges/pricearray @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"REVS\",\"rel\":\"KMD\",\"timescale\":60}" From 82c754e52bd6926b2e8858035a9d4112f48d6ca1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:15:58 +0200 Subject: [PATCH 399/682] Test --- iguana/exchanges/LP_commands.c | 4 +-- iguana/exchanges/LP_prices.c | 66 ++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 35ffde0ec..cb0289d8c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -94,7 +94,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ -pricearray(base, rel, timescale=60)\n\ +pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60)\n\ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ goal(coin=*, perc=)\n\ @@ -188,7 +188,7 @@ trust(pubkey, trust)\n\ } else if ( strcmp(method,"pricearray") == 0 ) { - return(jprint(LP_pricearray(base,rel,jint(argjson,"timescale")),1)); + return(jprint(LP_pricearray(base,rel,juint(argjson,"firsttime"),juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); } else if ( strcmp(method,"myprice") == 0 ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f07ae793e..5895e5715 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -666,48 +666,68 @@ void LP_priceitemadd(cJSON *retarray,uint32_t timestamp,double avebid,double ave jaddi(retarray,item); } -cJSON *LP_pricearray(char *base,char *rel,int32_t timescale) +cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,int32_t timescale) { - cJSON *retarray; char askfname[1024],bidfname[1024]; uint64_t bidprice64,askprice64; uint32_t bidnow,asknow,bidi,aski,firstbidi,firstaski,lastbidi,lastaski; int32_t numbids,numasks; double bidemit,askemit,bidsum,asksum,bid,ask,highbid,lowbid,highask,lowask; FILE *askfp=0,*bidfp=0; + cJSON *retarray; char askfname[1024],bidfname[1024]; uint64_t bidprice64,askprice64; uint32_t bidnow,asknow,bidi,aski,lastbidi,lastaski; int32_t numbids,numasks; double bidemit,askemit,bidsum,asksum,bid,ask,highbid,lowbid,highask,lowask; FILE *askfp=0,*bidfp=0; if ( timescale <= 0 ) timescale = 60; + if ( lasttime == 0 ) + lasttime = (uint32_t)-1; LP_pricefname(askfname,base,rel); LP_pricefname(bidfname,rel,base); retarray = cJSON_CreateArray(); - firstbidi = firstaski = lastbidi = lastaski = 0; + lastbidi = lastaski = 0; numbids = numasks = 0; bidsum = asksum = askemit = bidemit = highbid = lowbid = highask = lowask = 0.; if ( (bidfp= fopen(bidfname,"rb")) != 0 && (askfp= fopen(askfname,"rb")) != 0 ) { bidi = aski = 0; bidemit = askemit = 0.; - if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) && bidnow != 0 && bidprice64 != 0 ) + if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) { - bidi = bidnow / timescale; - if ( bidi != lastbidi ) + if ( bidnow != 0 && bidprice64 != 0 && bidnow >= firsttime && bidnow <= lasttime ) { - if ( bidsum != 0 && numbids != 0 ) - bidemit = bidsum / numbids; - bidsum = 0.; - numbids = 0; + bidi = bidnow / timescale; + if ( bidi != lastbidi ) + { + if ( bidsum != 0. && numbids != 0 ) + bidemit = bidsum / numbids; + bidsum = 0.; + numbids = 0; + } + if ( (bid= dstr(bidprice64)) != 0. ) + { + if ( bid > highbid ) + highbid = bid; + if ( lowbid == 0. || bid < lowbid ) + lowbid = bid; + bidsum += bid; + numbids++; + } } - bid = dstr(bidprice64); - bidsum += bid; - numbids++; } else fclose(bidfp), bidfp = 0; - if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) && asknow != 0 && askprice64 != 0 ) + if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) ) { - aski = asknow / timescale; - if ( aski != lastaski ) + if ( asknow != 0 && askprice64 != 0 && asknow >= firsttime && asknow <= lasttime ) { - if ( asksum != 0 && numasks != 0 ) - askemit = asksum / numasks; - asksum = 0.; - numasks = 0; + aski = asknow / timescale; + if ( aski != lastaski ) + { + if ( asksum != 0. && numasks != 0 ) + askemit = asksum / numasks; + asksum = 0.; + numasks = 0; + } + if ( (ask= dstr(askprice64)) != 0. ) + { + if ( ask > highask ) + highask = ask; + if ( lowask == 0. || ask < lowask ) + lowask = ask; + asksum += ask; + numasks++; + } } - ask = dstr(askprice64); - asksum += ask; - numasks++; } else fclose(askfp), askfp = 0; if ( bidemit != 0. || askemit != 0. ) { From 5288622ddc112afe6c51df727b808deeda46cd6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:19:57 +0200 Subject: [PATCH 400/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/pricearray | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index cb0289d8c..3bb040fc4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -94,7 +94,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r else if ( strcmp(method,"help") == 0 ) return(clonestr("{\"result\":\" \ available localhost RPC commands:\n \ -pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60)\n\ +pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ goal(coin=*, perc=)\n\ diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5895e5715..ffe235d6e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -754,7 +754,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i lastbidi = bidi; if ( aski != 0 ) lastaski = aski; - } + } else printf("couldnt open either %s %p or %s %p\n",bidfname,bidfp,askfname,askfp); if ( bidfp != 0 ) fclose(bidfp); if ( askfp != 0 ) diff --git a/iguana/exchanges/pricearray b/iguana/exchanges/pricearray index 2d151eb56..8a01248af 100755 --- a/iguana/exchanges/pricearray +++ b/iguana/exchanges/pricearray @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"REVS\",\"rel\":\"KMD\",\"timescale\":60}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"pricearray\",\"base\":\"KMD\",\"rel\":\"BTC\",\"timescale\":60}" From 3556f4547e8c025c6e4c4d1e86acacc32d952078 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:21:50 +0200 Subject: [PATCH 401/682] Test --- iguana/exchanges/LP_prices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ffe235d6e..65f21076d 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -685,6 +685,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i bidemit = askemit = 0.; if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) { + printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); if ( bidnow != 0 && bidprice64 != 0 && bidnow >= firsttime && bidnow <= lasttime ) { bidi = bidnow / timescale; @@ -708,6 +709,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i } else fclose(bidfp), bidfp = 0; if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) ) { + printf("asknow.%u %.8f\n",asknow,dstr(askprice64)); if ( asknow != 0 && askprice64 != 0 && asknow >= firsttime && asknow <= lasttime ) { aski = asknow / timescale; From 595b75d76615773c915827ffa5ff568219f5e85d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:24:55 +0200 Subject: [PATCH 402/682] Test --- iguana/exchanges/LP_prices.c | 125 ++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 61 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 65f21076d..6e1006391 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -681,81 +681,84 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i bidsum = asksum = askemit = bidemit = highbid = lowbid = highask = lowask = 0.; if ( (bidfp= fopen(bidfname,"rb")) != 0 && (askfp= fopen(askfname,"rb")) != 0 ) { - bidi = aski = 0; - bidemit = askemit = 0.; - if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) + while ( bidfp != 0 || askfp != 0 ) { - printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); - if ( bidnow != 0 && bidprice64 != 0 && bidnow >= firsttime && bidnow <= lasttime ) + bidi = aski = 0; + bidemit = askemit = 0.; + if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) { - bidi = bidnow / timescale; - if ( bidi != lastbidi ) + printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); + if ( bidnow != 0 && bidprice64 != 0 && bidnow >= firsttime && bidnow <= lasttime ) { - if ( bidsum != 0. && numbids != 0 ) - bidemit = bidsum / numbids; - bidsum = 0.; - numbids = 0; - } - if ( (bid= dstr(bidprice64)) != 0. ) - { - if ( bid > highbid ) - highbid = bid; - if ( lowbid == 0. || bid < lowbid ) - lowbid = bid; - bidsum += bid; - numbids++; + bidi = bidnow / timescale; + if ( bidi != lastbidi ) + { + if ( bidsum != 0. && numbids != 0 ) + bidemit = bidsum / numbids; + bidsum = 0.; + numbids = 0; + } + if ( (bid= dstr(bidprice64)) != 0. ) + { + if ( bid > highbid ) + highbid = bid; + if ( lowbid == 0. || bid < lowbid ) + lowbid = bid; + bidsum += bid; + numbids++; + } } - } - } else fclose(bidfp), bidfp = 0; - if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) ) - { - printf("asknow.%u %.8f\n",asknow,dstr(askprice64)); - if ( asknow != 0 && askprice64 != 0 && asknow >= firsttime && asknow <= lasttime ) + } else fclose(bidfp), bidfp = 0; + if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) ) { - aski = asknow / timescale; - if ( aski != lastaski ) - { - if ( asksum != 0. && numasks != 0 ) - askemit = asksum / numasks; - asksum = 0.; - numasks = 0; - } - if ( (ask= dstr(askprice64)) != 0. ) + printf("asknow.%u %.8f\n",asknow,dstr(askprice64)); + if ( asknow != 0 && askprice64 != 0 && asknow >= firsttime && asknow <= lasttime ) { - if ( ask > highask ) - highask = ask; - if ( lowask == 0. || ask < lowask ) - lowask = ask; - asksum += ask; - numasks++; + aski = asknow / timescale; + if ( aski != lastaski ) + { + if ( asksum != 0. && numasks != 0 ) + askemit = asksum / numasks; + asksum = 0.; + numasks = 0; + } + if ( (ask= dstr(askprice64)) != 0. ) + { + if ( ask > highask ) + highask = ask; + if ( lowask == 0. || ask < lowask ) + lowask = ask; + asksum += ask; + numasks++; + } } - } - } else fclose(askfp), askfp = 0; - if ( bidemit != 0. || askemit != 0. ) - { - if ( bidemit != 0. && askemit != 0. && lastbidi == lastaski ) + } else fclose(askfp), askfp = 0; + if ( bidemit != 0. || askemit != 0. ) { - LP_priceitemadd(retarray,lastbidi * timescale,bidemit,askemit,highbid,lowask); - highbid = lowbid = highask = lowask = 0.; - } - else - { - if ( bidemit != 0. ) + if ( bidemit != 0. && askemit != 0. && lastbidi == lastaski ) { - LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,highbid,0.); - highbid = lowbid = 0.; + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,askemit,highbid,lowask); + highbid = lowbid = highask = lowask = 0.; } - if ( askemit != 0. ) + else { - LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,lowask); - highask = lowask = 0.; + if ( bidemit != 0. ) + { + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,highbid,0.); + highbid = lowbid = 0.; + } + if ( askemit != 0. ) + { + LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,lowask); + highask = lowask = 0.; + } } } + if ( bidi != 0 ) + lastbidi = bidi; + if ( aski != 0 ) + lastaski = aski; } - if ( bidi != 0 ) - lastbidi = bidi; - if ( aski != 0 ) - lastaski = aski; } else printf("couldnt open either %s %p or %s %p\n",bidfname,bidfp,askfname,askfp); if ( bidfp != 0 ) fclose(bidfp); From 6c5b09b18a6fd81b2782296dcc94aa74edc3c034 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:25:31 +0200 Subject: [PATCH 403/682] Test --- iguana/exchanges/LP_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 6e1006391..ac9556f03 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -698,7 +698,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i bidsum = 0.; numbids = 0; } - if ( (bid= dstr(bidprice64)) != 0. ) + if ( (bid= 1. / dstr(bidprice64)) != 0. ) { if ( bid > highbid ) highbid = bid; From cdeab9a90704582d8eca25347299eed61863554c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:31:55 +0200 Subject: [PATCH 404/682] Test --- iguana/exchanges/LP_prices.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ac9556f03..986f2101a 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -687,7 +687,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i bidemit = askemit = 0.; if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) { - printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); + //printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); if ( bidnow != 0 && bidprice64 != 0 && bidnow >= firsttime && bidnow <= lasttime ) { bidi = bidnow / timescale; @@ -706,12 +706,13 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i lowbid = bid; bidsum += bid; numbids++; + printf("bidi.%u num.%d %.8f [%.8f %.8f]\n",bidi,numbids,bid,lowbid,highbid); } } } else fclose(bidfp), bidfp = 0; if ( askfp != 0 && fread(&asknow,1,sizeof(asknow),askfp) == sizeof(asknow) && fread(&askprice64,1,sizeof(askprice64),askfp) == sizeof(askprice64) ) { - printf("asknow.%u %.8f\n",asknow,dstr(askprice64)); + //printf("asknow.%u %.8f\n",asknow,dstr(askprice64)); if ( asknow != 0 && askprice64 != 0 && asknow >= firsttime && asknow <= lasttime ) { aski = asknow / timescale; @@ -730,6 +731,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i lowask = ask; asksum += ask; numasks++; + printf("aski.%u num.%d %.8f [%.8f %.8f]\n",aski,numasks,ask,lowask,highask); } } } else fclose(askfp), askfp = 0; @@ -744,11 +746,13 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i { if ( bidemit != 0. ) { + printf("bidonly %.8f %.8f\n",bidemit,highbid); LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,highbid,0.); highbid = lowbid = 0.; } if ( askemit != 0. ) { + printf("askonly %.8f %.8f\n",askemit,lowask); LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,lowask); highask = lowask = 0.; } From 230a65b6ab27312a81a843d3e1f204ed0258ba6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:38:54 +0200 Subject: [PATCH 405/682] Test --- iguana/exchanges/LP_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 543b3e99a..f96dbe962 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -592,7 +592,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } - } else printf("%s ERROR.(%s)\n",rawtx->name,jprint(txobj,0)); + } else printf("%s ERROR.(%s) txfees.[%.8f %.8f: %.8f] amount.%.8f -> %.8f\n",rawtx->name,jprint(txobj,0),dstr(swap->I.Atxfee),dstr(swap->I.Btxfee),dstr(txfee),dstr(rawtx->I.amount),dstr(rawtx->I.amount)-dstr(txfee)); } free_json(txobj); } From 2c9ba2c52b8b39f9b03ea5d9453a7abdf60a610f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:49:45 +0200 Subject: [PATCH 406/682] Test --- iguana/exchanges/LP_prices.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 986f2101a..9b6d08a41 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -668,7 +668,7 @@ void LP_priceitemadd(cJSON *retarray,uint32_t timestamp,double avebid,double ave cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,int32_t timescale) { - cJSON *retarray; char askfname[1024],bidfname[1024]; uint64_t bidprice64,askprice64; uint32_t bidnow,asknow,bidi,aski,lastbidi,lastaski; int32_t numbids,numasks; double bidemit,askemit,bidsum,asksum,bid,ask,highbid,lowbid,highask,lowask; FILE *askfp=0,*bidfp=0; + cJSON *retarray; char askfname[1024],bidfname[1024]; uint64_t bidprice64,askprice64; uint32_t bidnow,asknow,bidi,aski,lastbidi,lastaski; int32_t numbids,numasks; double bidemit,askemit,bidsum,asksum,bid,ask,highbid,lowbid,highask,lowask,bidemit2,askemit2; FILE *askfp=0,*bidfp=0; if ( timescale <= 0 ) timescale = 60; if ( lasttime == 0 ) @@ -684,7 +684,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i while ( bidfp != 0 || askfp != 0 ) { bidi = aski = 0; - bidemit = askemit = 0.; + bidemit = askemit = bidemit2 = askemit2 = 0.; if ( bidfp != 0 && fread(&bidnow,1,sizeof(bidnow),bidfp) == sizeof(bidnow) && fread(&bidprice64,1,sizeof(bidprice64),bidfp) == sizeof(bidprice64) ) { //printf("bidnow.%u %.8f\n",bidnow,dstr(bidprice64)); @@ -694,8 +694,11 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i if ( bidi != lastbidi ) { if ( bidsum != 0. && numbids != 0 ) + { bidemit = bidsum / numbids; - bidsum = 0.; + bidemit2 = highbid; + } + bidsum = highbid = lowbid = 0.; numbids = 0; } if ( (bid= 1. / dstr(bidprice64)) != 0. ) @@ -719,8 +722,11 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i if ( aski != lastaski ) { if ( asksum != 0. && numasks != 0 ) + { askemit = asksum / numasks; - asksum = 0.; + askemit2 = lowask; + } + asksum = highask = lowask = 0.; numasks = 0; } if ( (ask= dstr(askprice64)) != 0. ) @@ -739,7 +745,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i { if ( bidemit != 0. && askemit != 0. && lastbidi == lastaski ) { - LP_priceitemadd(retarray,lastbidi * timescale,bidemit,askemit,highbid,lowask); + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,askemit,bidemit2,askemit2); highbid = lowbid = highask = lowask = 0.; } else @@ -747,13 +753,13 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i if ( bidemit != 0. ) { printf("bidonly %.8f %.8f\n",bidemit,highbid); - LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,highbid,0.); + LP_priceitemadd(retarray,lastbidi * timescale,bidemit,0.,bidemit2,0.); highbid = lowbid = 0.; } if ( askemit != 0. ) { printf("askonly %.8f %.8f\n",askemit,lowask); - LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,lowask); + LP_priceitemadd(retarray,lastaski * timescale,0.,askemit,0.,askemit2); highask = lowask = 0.; } } From a16d2217c511f013cd2149b5828b1855ecda4f69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:52:43 +0200 Subject: [PATCH 407/682] Test --- iguana/exchanges/LP_prices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 9b6d08a41..2d7df7f39 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -709,7 +709,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i lowbid = bid; bidsum += bid; numbids++; - printf("bidi.%u num.%d %.8f [%.8f %.8f]\n",bidi,numbids,bid,lowbid,highbid); + //printf("bidi.%u num.%d %.8f [%.8f %.8f]\n",bidi,numbids,bid,lowbid,highbid); } } } else fclose(bidfp), bidfp = 0; @@ -737,7 +737,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i lowask = ask; asksum += ask; numasks++; - printf("aski.%u num.%d %.8f [%.8f %.8f]\n",aski,numasks,ask,lowask,highask); + //printf("aski.%u num.%d %.8f [%.8f %.8f]\n",aski,numasks,ask,lowask,highask); } } } else fclose(askfp), askfp = 0; From f351d28aac0d306b3f824c1773980ca162702e75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 13:59:53 +0200 Subject: [PATCH 408/682] Test --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index bc0319d02..f2334d836 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"/root/muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 5fecf310a60260ccb78aeacb4c4868e269c65f5e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 14:47:04 +0200 Subject: [PATCH 409/682] DASH --- iguana/exchanges/LP_swap.c | 1 - iguana/exchanges/coins | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index f96dbe962..5c914b351 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -588,7 +588,6 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba { char str[65]; LP_swap_coinaddr(swap,rawtx->coin,rawtx->p2shaddr,data,datalen); - printf("got %s txid.%s (%s) -> %s\n",rawtx->name,bits256_str(str,rawtx->I.signedtxid),jprint(txobj,0),rawtx->p2shaddr); } else bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen); } diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index f2334d836..8abce716e 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":1, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"DASH\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 95a08b1e1d87ac68a5d930e3ee6e5793e9f7f366 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Jul 2017 14:48:25 +0200 Subject: [PATCH 410/682] DASH conf --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 8abce716e..cbb7544fe 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"DASH\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From ddb81a46db864784d0fafd1356d794b519a1afe1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 09:55:38 +0200 Subject: [PATCH 411/682] IOC --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index cbb7544fe..2d65bdeea 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From b09e4b0634196110abc59f4ea106403c88884f9d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 11:02:55 +0200 Subject: [PATCH 412/682] Test --- iguana/exchanges/LP_ordermatch.c | 6 ++++++ iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7f74a8859..563d40c22 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -574,9 +574,15 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( maxprice <= 0. || LP_priceinfofind(base) == 0 ) return(0); if ( (desttxfee= LP_getestimatedrate(autxo->coin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + { + printf("dest.%s txfee %.8f\n",autxo->coin,dstr(desttxfee)); desttxfee = LP_MIN_TXFEE; + } if ( (txfee= LP_getestimatedrate(base) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + { + printf("src.%s txfee %.8f\n",base,dstr(txfee)); txfee = LP_MIN_TXFEE; + } if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 82629b767..e6f8a6478 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -337,7 +337,7 @@ double LP_getestimatedrate(char *symbol) if ( retstr[0] != '-' ) { coin->estimatedrate = rate = atof(retstr) / 1024.; - //printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); + printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); } free(retstr); } From 203b976a9ee8786df1bd8742ff558448066d74fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 11:09:07 +0200 Subject: [PATCH 413/682] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e6f8a6478..20b07a2e4 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -341,8 +341,8 @@ double LP_getestimatedrate(char *symbol) } free(retstr); } - } else rate = coin->txfee / LP_AVETXSIZE; - return(rate); + } else rate = (double)coin->txfee / LP_AVETXSIZE; + return(SATOSHIDEN * rate); } uint64_t LP_txfee(char *symbol) From abcb68d8614ac730d5554b212346b5f6827e3200 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 11:11:50 +0200 Subject: [PATCH 414/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 20b07a2e4..37278137d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -341,7 +341,7 @@ double LP_getestimatedrate(char *symbol) } free(retstr); } - } else rate = (double)coin->txfee / LP_AVETXSIZE; + } else return((double)coin->txfee / LP_AVETXSIZE); return(SATOSHIDEN * rate); } From 9e6495827def35aa1003a796cc152f056547fb98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 11:38:40 +0200 Subject: [PATCH 415/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 2e8310de8..354d1a2e6 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -121,7 +121,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf } else printf("LP_txinterestvalue no addresses found?\n"); //char str[65]; printf("%.8f <- %s.(%s) txobj.(%s)\n",dstr(value),symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); - } + } else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); } From fec40139c210af952fbf428f5e83c297633aedb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 17:19:26 +0200 Subject: [PATCH 416/682] SYS and EMC2 --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 2d65bdeea..59e5f51f9 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\“coin\“:\“SYS\“, \“name\“: \“syscoin\“,\“rpcport\“:8368,\“pubtype\“:0, \“p2shtype\“:5, \“wiftype\“:128, \“txfee\“:10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 49eed2acd6d69846fb049e5d6069031d9873a5c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 17:21:34 +0200 Subject: [PATCH 417/682] Test --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 59e5f51f9..019b40efc 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\“coin\“:\“SYS\“, \“name\“: \“syscoin\“,\“rpcport\“:8368,\“pubtype\“:0, \“p2shtype\“:5, \“wiftype\“:128, \“txfee\“:10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From e16348b19d803aaab1905f76465e253452833186 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Jul 2017 22:50:38 +0200 Subject: [PATCH 418/682] MOON --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 019b40efc..ec5e3565d 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 0d0bd3b99ed46bf95b8045a9f7f887853f44b777 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 10:47:48 +0200 Subject: [PATCH 419/682] Test --- iguana/exchanges/LP_coins.c | 5 ++--- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_swap.c | 27 ++++++++++++++++----------- iguana/exchanges/LP_transaction.c | 8 ++++---- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 09ed0bc1f..f4b58b89f 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -290,7 +290,7 @@ struct iguana_info *LP_coinfind(char *symbol) if ( (busport= LP_busport(port)) == 0 ) return(0); isPoS = 0; - txfee = 10000; + txfee = LP_MIN_TXFEE; estimatedrate = 20; pubtype = 60; p2shtype = 85; @@ -332,8 +332,7 @@ struct iguana_info *LP_coincreate(cJSON *item) if ( (symbol= jstr(item,"coin")) != 0 && symbol[0] != 0 && strlen(symbol) < 16 && LP_coinfind(symbol) == 0 && (port= juint(item,"rpcport")) != 0 ) { isPoS = jint(item,"isPoS"); - if ( (txfee= j64bits(item,"txfee")) == 0 ) - txfee = 10000; + txfee = j64bits(item,"txfee"); if ( (estimatedrate= jdouble(item,"estimatedrate")) == 0. ) estimatedrate = 20; pubtype = juint(item,"pubtype"); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 37278137d..198d8f1f3 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -349,7 +349,7 @@ uint64_t LP_txfee(char *symbol) { uint64_t txfee = 0; if ( strcmp(symbol,"BTC") != 0 ) - txfee = 10000; + txfee = LP_MIN_TXFEE; return(txfee); } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 5c914b351..485b7ef12 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -570,11 +570,16 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba if ( (vouts= jarray(&n,txobj,"vout")) != 0 && v < n ) { vout = jitem(vouts,v); - if ( strcmp(rawtx->coin->symbol,swap->bobcoin.symbol) == 0 ) - txfee = swap->I.Btxfee; - else if ( strcmp(rawtx->coin->symbol,swap->alicecoin.symbol) == 0 ) - txfee = swap->I.Atxfee; - else txfee = 10000; + if ( strcmp("BTC",rawtx->coin->symbol) == 0 && rawtx == &swap->otherfee ) + txfee = LP_MIN_TXFEE; + else + { + if ( strcmp(rawtx->coin->symbol,swap->bobcoin.symbol) == 0 ) + txfee = swap->I.Btxfee; + else if ( strcmp(rawtx->coin->symbol,swap->alicecoin.symbol) == 0 ) + txfee = swap->I.Atxfee; + else txfee = LP_MIN_TXFEE; + } if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) @@ -899,8 +904,8 @@ void basilisk_rawtx_setparms(char *name,uint32_t quoteid,struct basilisk_rawtx * rawtx->coin = coin; strcpy(rawtx->I.coinstr,coin->symbol); rawtx->I.numconfirms = numconfirms; - if ( (rawtx->I.amount= satoshis) < 10000 ) - rawtx->I.amount = 10000; + if ( (rawtx->I.amount= satoshis) < LP_MIN_TXFEE ) + rawtx->I.amount = LP_MIN_TXFEE; rawtx->I.vintype = vintype; // 0 -> std, 2 -> 2of2, 3 -> spend bobpayment, 4 -> spend bobdeposit rawtx->I.vouttype = vouttype; // 0 -> fee, 1 -> std, 2 -> 2of2, 3 -> bobpayment, 4 -> bobdeposit if ( rawtx->I.vouttype == 0 ) @@ -936,10 +941,10 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256 swap->I.callduration += optionduration; swap->I.bobsatoshis = swap->I.req.srcamount; swap->I.alicesatoshis = swap->I.req.destamount; - if ( (swap->I.bobinsurance= (swap->I.bobsatoshis / INSTANTDEX_INSURANCEDIV)) < 10000 ) - swap->I.bobinsurance = 10000; - if ( (swap->I.aliceinsurance= (swap->I.alicesatoshis / INSTANTDEX_INSURANCEDIV)) < 10000 ) - swap->I.aliceinsurance = 10000; + if ( (swap->I.bobinsurance= (swap->I.bobsatoshis / INSTANTDEX_INSURANCEDIV)) < LP_MIN_TXFEE ) + swap->I.bobinsurance = LP_MIN_TXFEE; + if ( (swap->I.aliceinsurance= (swap->I.alicesatoshis / INSTANTDEX_INSURANCEDIV)) < LP_MIN_TXFEE ) + swap->I.aliceinsurance = LP_MIN_TXFEE; strcpy(swap->I.bobstr,swap->I.req.src); strcpy(swap->I.alicestr,swap->I.req.dest); swap->I.started = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a570b381d..64c433c3c 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -714,7 +714,7 @@ int32_t basilisk_rawtx_sign(char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t locktime = swap->bobdeposit.I.locktime + 1, sequenceid = 0; else if ( dest == &swap->bobreclaim ) locktime = swap->bobpayment.I.locktime + 1, sequenceid = 0; - txfee = strcmp("BTC",symbol) == 0 ? 0 : 10000; + txfee = strcmp("BTC",symbol) == 0 ? 0 : LP_MIN_TXFEE; if ( changermd160 != 0 ) { changeaddr = _changeaddr; @@ -1302,7 +1302,7 @@ void basilisk_alicepayment(struct basilisk_swap *swap,struct iguana_info *coin,s printf(" rmd160, ");*/ bitcoin_address(coinaddr,coin->taddr,coin->pubtype,swap->changermd160,20); //printf("%s suppress.%d fee.%d\n",coinaddr,alicepayment->I.suppress_pubkeys,swap->myfee.I.suppress_pubkeys); - basilisk_rawtx_gen(swap->ctx,"alicepayment",swap->I.started,swap->persistent_pubkey33,0,1,alicepayment,alicepayment->I.locktime,alicepayment->spendscript,alicepayment->I.spendlen,coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); + basilisk_rawtx_gen(swap->ctx,"alicepayment",swap->I.started,swap->persistent_pubkey33,0,1,alicepayment,alicepayment->I.locktime,alicepayment->spendscript,alicepayment->I.spendlen,strcmp(coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); } int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) @@ -1329,9 +1329,9 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d { printf("generate fee\n"); bitcoin_address(coinaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->changermd160,20); - if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,0,swap->myfee.spendscript,swap->myfee.I.spendlen,swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) + if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,0,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) { - printf("rawtxsend\n"); + printf("rawtxsend %s %.8f\n",swap->myfee.coin->symbol,dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); LP_unspents_mark(swap->I.iambob!=0?swap->bobcoin.symbol:swap->alicecoin.symbol,swap->myfee.vins); //basilisk_txlog(swap,&swap->myfee,-1); From 5ded19dadfd621f70f85a2460579733d35b30a1e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 11:50:32 +0200 Subject: [PATCH 420/682] Test --- iguana/exchanges/LP_ordermatch.c | 53 +++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 563d40c22..01651380a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -128,7 +128,9 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); if ( (qp->txfee= LP_getestimatedrate(utxo->coin)*LP_AVETXSIZE) < LP_MIN_TXFEE ) qp->txfee = LP_MIN_TXFEE; - qp->satoshis = destsatoshis / price + 0.49; + if ( (qp->desttxfee= LP_getestimatedrate(qp->destcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + qp->desttxfee = LP_MIN_TXFEE; + qp->satoshis = (destsatoshis / price) + 0.49; if ( utxo->iambob == 0 || qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) { printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); @@ -139,8 +141,6 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * qp->txid2 = utxo->deposit.txid; qp->vout2 = utxo->deposit.vout; qp->destsatoshis = destsatoshis; - if ( (qp->desttxfee= LP_getestimatedrate(qp->destcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - qp->desttxfee = LP_MIN_TXFEE; if ( qp->desttxfee >= qp->destsatoshis ) { printf("quoteinit desttxfee %.8f < %.8f destsatoshis\n",dstr(qp->desttxfee),dstr(qp->destsatoshis)); @@ -274,12 +274,12 @@ double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop qprice = ((double)qp->destsatoshis / qp->satoshis); if ( qp->satoshis < (srcvalue / LP_MINVOL) ) { - printf("utxo payment %.8f is less than half covered by Q %.8f\n",dstr(srcvalue),dstr(qp->satoshis)); + printf("utxo payment %.8f is less than %f covered by Q %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis)); return(-12); } if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) ) { - printf("destsatoshis %.8f is less than half of value %.8f\n",dstr(qp->destsatoshis),dstr(destvalue)); + printf("destsatoshis %.8f is less than %f of value %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue)); return(-13); } printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee)); @@ -537,15 +537,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, jaddbits256(retjson,"desthash",butxo->S.otherpubkey); jaddbits256(retjson,"pubkey",butxo->S.otherpubkey); jaddstr(retjson,"method","reserved"); - /*if ( pubsock >= 0 ) - { - msg = jprint(retjson,0); - /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); - } - jdelete(retjson,"method"); - jaddstr(retjson,"method2","reserved"); - jaddstr(retjson,"method","forward"); - /LP_forward(ctx,myipaddr,pubsock,butxo->S.otherpubkey,jprint(retjson,1),1);*/ msg = jprint(retjson,1); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)",butxo->T.swappending,qprice,price,msg); LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); @@ -564,9 +555,26 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } +double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) +{ + uint64_t destsatoshis,satoshis; + a_value -= (desttxfee + 1); + destsatoshis = ((b_satoshis - txfee) * price); + if ( destsatoshis > a_value ) + destsatoshis = a_value; + if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) + destsatoshis = maxdestsatoshis-desttxfee-1; + satoshis = (destsatoshis / price + 0.49) - txfee; + *destsatoshisp = destsatoshis; + *satoshisp = satoshis; + if ( satoshis > 0 ) + return((double)destsatoshis / satoshis); + else return(0.); +} + struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee,uint64_t maxdestsatoshis) { - int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,vout,numasks; double bestmetric=0.,metric,vol,price,bestprice = 0.; struct LP_pubkeyinfo *pubp; + int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; *bestdestsatoshisp = 0; if ( duration <= 0 ) @@ -612,11 +620,20 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { destsatoshis = ((butxo->S.satoshis - txfee) * price); - if ( destsatoshis > autxo->payment.value-desttxfee-1 ) + /*if ( destsatoshis > autxo->payment.value-desttxfee-1 ) destsatoshis = autxo->payment.value-desttxfee-1; if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) - destsatoshis = maxdestsatoshis-desttxfee-1; - satoshis = (destsatoshis / price + 0.0000000049) - txfee; + destsatoshis = maxdestsatoshis-desttxfee-1;*/ + satoshis = (destsatoshis / price + 0.49) - txfee; + if ( satoshis <= 0 ) + continue; + qprice = (double)destsatoshis / satoshis; + for (j=0; j<10; j++) + { + if ( (qprice= LP_qprice_calc(&destsatoshis,&satoshis,(price*(100.+j))/100.,butxo->S.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) + break; + } + printf("j.%d qprice %.8f vs price %.8f\n",j,qprice,price); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); From 2d4609121bc05693cbef5678cdbd89062dc41d08 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 11:52:56 +0200 Subject: [PATCH 421/682] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 01651380a..07a94d306 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -574,7 +574,7 @@ double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uin struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee,uint64_t maxdestsatoshis) { - int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; + int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; *bestdestsatoshisp = 0; if ( duration <= 0 ) @@ -628,12 +628,16 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( satoshis <= 0 ) continue; qprice = (double)destsatoshis / satoshis; - for (j=0; j<10; j++) + n = (int32_t)((double)destsatoshis / desttxfee); + if ( n < 10 ) + n = 10; + else n = 3; + for (j=0; jS.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) break; } - printf("j.%d qprice %.8f vs price %.8f\n",j,qprice,price); + printf("j.%d/%d qprice %.8f vs price %.8f\n",j,n,qprice,price); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); From c7eff23b29419a7157a9f875795fe647b3d8f405 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 11:59:57 +0200 Subject: [PATCH 422/682] Test --- iguana/exchanges/LP_scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 354d1a2e6..4fa563d91 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -119,7 +119,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - //char str[65]; printf("%.8f <- %s.(%s) txobj.(%s)\n",dstr(value),symbol,bits256_str(str,txid),jprint(txobj,0)); + char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); @@ -231,7 +231,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { value = LP_txinterestvalue(&tx->outpoints[vout].interest,coinaddr,coin,txid,vout); } - //printf("return value %.8f + interest %.8f\n",dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + printf("return value %.8f + interest %.8f\n",dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); @@ -241,7 +241,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( coinaddr == 0 ) coinaddr = _coinaddr; value = LP_txinterestvalue(&interest,coinaddr,coin,txid,vout); - //printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); + printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); return(value + interest); } From 9738cf6f259818b0ff998bdb3c5b781c1e1d3de3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 12:08:46 +0200 Subject: [PATCH 423/682] Test --- iguana/exchanges/LP_scan.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4fa563d91..3e6db8f00 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -227,11 +227,9 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } else { - if ( coinaddr != 0 && strcmp(symbol,"KMD") == 0 ) - { + if ( coinaddr != 0 ) value = LP_txinterestvalue(&tx->outpoints[vout].interest,coinaddr,coin,txid,vout); - } - printf("return value %.8f + interest %.8f\n",dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); + //printf("return value %.8f + interest %.8f\n",dstr(tx->outpoints[vout].value),dstr(tx->outpoints[vout].interest)); return(tx->outpoints[vout].value + tx->outpoints[vout].interest); } } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); @@ -241,7 +239,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) if ( coinaddr == 0 ) coinaddr = _coinaddr; value = LP_txinterestvalue(&interest,coinaddr,coin,txid,vout); - printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); + //printf("coinaddr.(%s) value %.8f interest %.8f\n",coinaddr,dstr(value),dstr(interest)); return(value + interest); } From 9316c71d4c15dc1552126e67ba4a6edbce300fc1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 12:33:07 +0200 Subject: [PATCH 424/682] Test --- iguana/exchanges/LP_scan.c | 8 ++++---- iguana/exchanges/LP_statemachine.c | 12 ++++++------ iguana/exchanges/LP_swap.c | 8 ++++---- iguana/exchanges/LP_transaction.c | 2 +- iguana/exchanges/LP_utxos.c | 18 +++++++++++++++++- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 3e6db8f00..cc712e78e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -119,7 +119,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf if ( n > 1 ) printf("LP_txinterestvalue warning: violation of 1 output assumption n.%d\n",n); } else printf("LP_txinterestvalue no addresses found?\n"); - char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); + //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); } else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); @@ -128,7 +128,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; - if ( (txobj=LP_gettx(coin->symbol,txid)) != 0 ) + if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { height = LP_txheight(×tamp,&blocktime,coin,txid); if ( timestamp == 0 && height > 0 ) @@ -288,7 +288,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) return(-1); } -int32_t LP_numconfirms(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx) +int32_t LP_numconfirms(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx,int32_t mempool) { struct iguana_info *coin; int32_t numconfirms = 100; //#ifndef BASILISK_DISABLEWAITTX @@ -301,7 +301,7 @@ int32_t LP_numconfirms(struct basilisk_swap *swap,struct basilisk_rawtx *rawtx) numconfirms = jint(txobj,"confirmations"); free_json(txobj); } - else if ( LP_mempoolscan(rawtx->coin->symbol,rawtx->I.signedtxid) >= 0 ) + else if ( mempool != 0 && LP_mempoolscan(rawtx->coin->symbol,rawtx->I.signedtxid) >= 0 ) numconfirms = 0; //#endif return(numconfirms); diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 1daa90920..dcb67c8a9 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -788,7 +788,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t } else if ( (swap->I.statebits & 0x2000) == 0 ) { - if ( (swap->I.aliceconfirms == 0 && swap->aliceunconf != 0) || LP_numconfirms(swap,&swap->alicepayment) >= swap->I.aliceconfirms ) + if ( (swap->I.aliceconfirms == 0 && swap->aliceunconf != 0) || LP_numconfirms(swap,&swap->alicepayment,1) >= swap->I.aliceconfirms ) { swap->I.statebits |= 0x2000; printf("alicepayment confirmed\n"); @@ -814,7 +814,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t tradebot_swap_balancingtrade(swap,1); printf("Bob spends alicepayment aliceconfirms.%d\n",swap->I.aliceconfirms); swap->I.statebits |= 0x40000; - if ( LP_numconfirms(swap,&swap->bobspend) >= swap->I.aliceconfirms ) + if ( LP_numconfirms(swap,&swap->bobspend,1) >= swap->I.aliceconfirms ) { printf("bobspend confirmed\n"); swap->I.statebits |= 0x80000; @@ -837,7 +837,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t printf("Bob reclaimed own payment\n"); while ( 0 && (swap->I.statebits & 0x100000) == 0 ) // why wait for own tx? { - if ( LP_numconfirms(swap,&swap->bobreclaim) >= 1 ) + if ( LP_numconfirms(swap,&swap->bobreclaim,1) >= 1 ) { printf("bobreclaim confirmed\n"); swap->I.statebits |= 0x100000; @@ -865,7 +865,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t } else if ( (swap->I.statebits & 0x400) == 0 ) { - if ( basilisk_istrustedbob(swap) != 0 || (swap->I.bobconfirms == 0 && swap->depositunconf != 0) || LP_numconfirms(swap,&swap->bobdeposit) >= swap->I.bobconfirms ) + if ( basilisk_istrustedbob(swap) != 0 || (swap->I.bobconfirms == 0 && swap->depositunconf != 0) || LP_numconfirms(swap,&swap->bobdeposit,1) >= swap->I.bobconfirms ) { printf("bobdeposit confirmed\n"); swap->I.statebits |= 0x400; @@ -889,7 +889,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t } else if ( (swap->I.statebits & 0x10000) == 0 ) { - if ( basilisk_istrustedbob(swap) != 0 || (swap->I.bobconfirms == 0 && swap->paymentunconf != 0) || LP_numconfirms(swap,&swap->bobpayment) >= swap->I.bobconfirms ) + if ( basilisk_istrustedbob(swap) != 0 || (swap->I.bobconfirms == 0 && swap->paymentunconf != 0) || LP_numconfirms(swap,&swap->bobpayment,1) >= swap->I.bobconfirms ) { printf("bobpayment confirmed\n"); swap->I.statebits |= 0x10000; @@ -906,7 +906,7 @@ int32_t basilisk_swapiteration(struct basilisk_swap *swap,uint8_t *data,int32_t else if ( (swap->I.statebits & 0x40000) == 0 ) { int32_t numconfs; - if ( (numconfs= LP_numconfirms(swap,&swap->alicespend)) >= swap->I.bobconfirms ) + if ( (numconfs= LP_numconfirms(swap,&swap->alicespend,1)) >= swap->I.bobconfirms ) { for (j=datalen=0; j<32; j++) data[datalen++] = swap->I.privAm.bytes[j]; diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 485b7ef12..00bbe692c 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -728,7 +728,7 @@ void LP_bobloop(void *_swap) printf("error bobscripts payment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->alicepayment)) < 1 ) // sync with alice + while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < 1 ) // sync with alice { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); @@ -778,7 +778,7 @@ void LP_aliceloop(void *_swap) printf("error sending alicepayment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->alicepayment)) < 1 ) + while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < 1 ) { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); @@ -788,14 +788,14 @@ void LP_aliceloop(void *_swap) printf("error waiting for bobpayment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->bobpayment)) < swap->I.bobconfirms ) + while ( (n= LP_numconfirms(swap,&swap->bobpayment,1)) < swap->I.bobconfirms ) { char str[65];printf("%d waiting for bobpayment to be confirmed.%d %s %s\n",n,swap->I.bobconfirms,swap->bobcoin.symbol,bits256_str(str,swap->bobpayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); } if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x20000,data,maxlen,&swap->alicespend,0x40000,0) == 0 ) printf("error sending alicespend\n"); - while ( (n= LP_numconfirms(swap,&swap->alicespend)) < swap->I.aliceconfirms ) + while ( (n= LP_numconfirms(swap,&swap->alicespend,1)) < swap->I.aliceconfirms ) { char str[65];printf("%d waiting for alicespend to be confirmed.%d %s %s\n",n,swap->I.aliceconfirms,swap->bobcoin.symbol,bits256_str(str,swap->alicespend.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 64c433c3c..4674fcd7a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1302,7 +1302,7 @@ void basilisk_alicepayment(struct basilisk_swap *swap,struct iguana_info *coin,s printf(" rmd160, ");*/ bitcoin_address(coinaddr,coin->taddr,coin->pubtype,swap->changermd160,20); //printf("%s suppress.%d fee.%d\n",coinaddr,alicepayment->I.suppress_pubkeys,swap->myfee.I.suppress_pubkeys); - basilisk_rawtx_gen(swap->ctx,"alicepayment",swap->I.started,swap->persistent_pubkey33,0,1,alicepayment,alicepayment->I.locktime,alicepayment->spendscript,alicepayment->I.spendlen,strcmp(coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); + basilisk_rawtx_gen(swap->ctx,"alicepayment",swap->I.started,swap->persistent_pubkey33,0,1,alicepayment,alicepayment->I.locktime,alicepayment->spendscript,alicepayment->I.spendlen,swap->I.Atxfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr); } int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 71f4ab170..efaa8e96e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -509,7 +509,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { - uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; cJSON *txobj; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); @@ -534,6 +534,22 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("iambob.%d utxoadd %s inactive.%u got ineligible txid value %.8f, value2 %.8f, tmpsatoshis %.8f\n",iambob,symbol,coin->inactive,dstr(value),dstr(value2),dstr(tmpsatoshis)); return(0); } + numconfirms = -1; + if ( (txobj= LP_gettx(symbol,txid)) != 0 ) + { + numconfirms = jint(txobj,"confirmations"); + free_json(txobj); + } + if ( numconfirms <= 0 ) + return(0); + numconfirms = -1; + if ( (txobj= LP_gettx(symbol,txid2)) != 0 ) + { + numconfirms = jint(txobj,"confirmations"); + free_json(txobj); + } + if ( numconfirms <= 0 ) + return(0); if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; From 3eb89d2ddc7fec37680713c445353472b1676ddf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 12:51:38 +0200 Subject: [PATCH 425/682] Test --- iguana/exchanges/LP_coins.c | 2 - iguana/exchanges/LP_include.h | 3 +- iguana/exchanges/LP_ordermatch.c | 63 ++++++++++++------------------- iguana/exchanges/LP_remember.c | 6 +-- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_transaction.c | 6 +-- 6 files changed, 30 insertions(+), 52 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index f4b58b89f..992e36e19 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -184,7 +184,6 @@ cJSON *LP_coinjson(struct iguana_info *coin) jaddnum(item,"pubtype",coin->pubtype); jaddnum(item,"p2shtype",coin->p2shtype); jaddnum(item,"wiftype",coin->wiftype); - jaddnum(item,"estimatedrate",coin->estimatedrate); jaddnum(item,"txfee",coin->txfee); return(item); } @@ -253,7 +252,6 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset coin->wiftaddr = wiftaddr; coin->longestchain = longestchain; coin->txfee = txfee; - coin->estimatedrate = estimatedrate; coin->pubtype = pubtype; coin->p2shtype = p2shtype; coin->wiftype = wiftype; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 40fdf150d..e2be89c69 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -177,7 +177,7 @@ struct iguana_info { UT_hash_handle hh; portable_mutex_t txmutex; struct LP_transaction *transactions; - uint64_t txfee; double estimatedrate; + uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; uint32_t counter,inactive,lastmempool,lastgetinfo; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag; @@ -274,6 +274,7 @@ int32_t LP_coinbus(uint16_t coin_busport); struct iguana_info *LP_coinfind(char *symbol); int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32); char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price); +uint64_t LP_txfeecalc(char *symbol,uint64_t txfee); #endif diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 07a94d306..2e4678180 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -19,6 +19,18 @@ // marketmaker // +uint64_t LP_txfeecalc(char *symbol,uint64_t txfee) +{ + if ( txfee == 0 && (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + txfee = LP_MIN_TXFEE; + return(txfee); +} + +void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) +{ + *txfeep = LP_txfeecalc(base,0); + *desttxfeep = LP_txfeecalc(rel,0); +} struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srchash,bits256 desthash,char *src,uint64_t srcsatoshis,char *dest,uint64_t destsatoshis,uint32_t timestamp,uint32_t quotetime,int32_t DEXselector) { @@ -126,10 +138,7 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * if ( qp->timestamp == 0 ) qp->timestamp = (uint32_t)time(NULL); safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); - if ( (qp->txfee= LP_getestimatedrate(utxo->coin)*LP_AVETXSIZE) < LP_MIN_TXFEE ) - qp->txfee = LP_MIN_TXFEE; - if ( (qp->desttxfee= LP_getestimatedrate(qp->destcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - qp->desttxfee = LP_MIN_TXFEE; + LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); qp->satoshis = (destsatoshis / price) + 0.49; if ( utxo->iambob == 0 || qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) { @@ -184,19 +193,6 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); jaddnum(reqjson,"price",price); - /*if ( pubsock >= 0 ) - { - jaddstr(reqjson,"method","postprice"); - //printf("%d pricepings.(%s)\n",pubsock,jprint(reqjson,0)); - msg = jprint(reqjson,1); - /LP_send(pubsock,msg,(int32_t)strlen(msg)+1,1); - } - else - { - jaddstr(reqjson,"method","forward"); - jaddstr(reqjson,"method2","postprice"); - /LP_forward(ctx,myipaddr,pubsock,zero,jprint(reqjson,1),1); - }*/ jaddstr(reqjson,"method","postprice"); msg = jprint(reqjson,1); LP_broadcast_message(pubsock,base,rel,zero,msg); @@ -237,7 +233,7 @@ int32_t LP_quote_checkmempool(struct LP_quoteinfo *qp) double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop,struct LP_quoteinfo *qp,int32_t iambob) { - double qprice; uint64_t srcvalue,srcvalue2,destvalue,destvalue2; + double qprice; uint64_t txfee,desttxfee,srcvalue,srcvalue2,destvalue,destvalue2; *autxop = *butxop = 0; if ( LP_iseligible(&srcvalue,&srcvalue2,1,qp->srccoin,qp->txid,qp->vout,qp->satoshis,qp->txid2,qp->vout2) == 0 ) { @@ -282,7 +278,10 @@ double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop printf("destsatoshis %.8f is less than %f of value %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue)); return(-13); } - printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee)); + LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); + printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); + if ( qp->txfee < 0.95*txfee || qp->desttxfee < 0.95*desttxfee ) + return(-14); return(qprice); } @@ -572,7 +571,7 @@ double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uin else return(0.); } -struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,int64_t txfee,int64_t desttxfee,uint64_t maxdestsatoshis) +struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) { int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; @@ -581,16 +580,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh duration = LP_ORDERBOOK_DURATION; if ( maxprice <= 0. || LP_priceinfofind(base) == 0 ) return(0); - if ( (desttxfee= LP_getestimatedrate(autxo->coin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - { - printf("dest.%s txfee %.8f\n",autxo->coin,dstr(desttxfee)); - desttxfee = LP_MIN_TXFEE; - } - if ( (txfee= LP_getestimatedrate(base) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - { - printf("src.%s txfee %.8f\n",base,dstr(txfee)); - txfee = LP_MIN_TXFEE; - } + LP_txfees(&txfee,&desttxfee,base,autxo->coin); if ( (obookstr= LP_orderbook(base,autxo->coin,duration)) != 0 ) { if ( (orderbook= cJSON_Parse(obookstr)) != 0 ) @@ -695,10 +685,8 @@ char *LP_bestfit(char *rel,double relvolume) char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { struct LP_quoteinfo Q; int64_t bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; - if ( desttxfee == 0 && (desttxfee= LP_getestimatedrate(rel) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - desttxfee = LP_MIN_TXFEE; - if ( txfee == 0 && (txfee= LP_getestimatedrate(base) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - txfee = LP_MIN_TXFEE; + txfee = LP_txfeecalc(base,txfee); + desttxfee = LP_txfeecalc(rel,desttxfee); if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) @@ -769,7 +757,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) { - int64_t desttxfee,txfee,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + uint64_t desttxfee,txfee; int64_t bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) @@ -778,10 +766,7 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *r return(clonestr("{\"error\":\"invalid parameter\"}")); if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); - if ( (desttxfee= LP_getestimatedrate(rel) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - desttxfee = LP_MIN_TXFEE; - if ( (txfee= LP_getestimatedrate(base) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - txfee = LP_MIN_TXFEE; + LP_txfees(&txfee,&desttxfee,base,rel); if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 292bc7100..9d9ad1efb 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -597,10 +597,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Adest = Bdest = AAdest = ABdest = 0; if ( bobcoin[0] == 0 || alicecoin[0] == 0 ) return(0); - if ( Atxfee == 0 && (Atxfee= LP_getestimatedrate(alicecoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - Atxfee = LP_MIN_TXFEE; - if ( Btxfee == 0 && (Btxfee= LP_getestimatedrate(bobcoin) * LP_AVETXSIZE) < LP_MIN_TXFEE ) - Btxfee = LP_MIN_TXFEE; + Atxfee = LP_txfeecalc(alicecoin,Atxfee); + Btxfee = LP_txfeecalc(bobcoin,Btxfee); //printf("%s %.8f txfee, %s %.8f txfee\n",alicecoin,dstr(Atxfee),bobcoin,dstr(Btxfee)); //printf("privAm.(%s) %p/%p\n",bits256_str(str,privAm),Adest,AAdest); //printf("privBn.(%s) %p/%p\n",bits256_str(str,privBn),Bdest,ABdest); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 198d8f1f3..1aaa96921 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -336,7 +336,7 @@ double LP_getestimatedrate(char *symbol) { if ( retstr[0] != '-' ) { - coin->estimatedrate = rate = atof(retstr) / 1024.; + rate = atof(retstr) / 1024.; printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); } free(retstr); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 4674fcd7a..f6648b7ee 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -694,11 +694,7 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub if ( strcmp(coin->symbol,"BTC") != 0 ) return(retval); len = rawtx->I.datalen; - if ( coin->estimatedrate == 0. ) - coin->estimatedrate = LP_getestimatedrate(coin->symbol); - newtxfee = coin->estimatedrate * len; - if ( newtxfee < LP_MIN_TXFEE ) - newtxfee = LP_MIN_TXFEE; + newtxfee = LP_txfeecalc(coin->symbol,0); printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; } From defeb31c15f2b053d6faab621d7c5dd3394739ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 13:17:49 +0200 Subject: [PATCH 426/682] Test --- iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_swap.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 8d32944af..5a39285aa 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -178,7 +178,7 @@ void _LP_queuesend(uint32_t crc32,int32_t sock0,int32_t sock1,uint8_t *msg,int32 printf("_LP_queuesend0 sent %d instead of %d\n",sentbytes,msglen); else { - printf("Q sent %u\n",crc32); + //printf("Q sent %u\n",crc32); sock0 = -1; } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 2e4678180..e2e4754e0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -378,10 +378,10 @@ int32_t LP_nanobind(void *ctx,char *pairstr) return(pairsock); } -int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *myipaddr,char *base,char *rel,double price,struct LP_quoteinfo *qp) +int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjson,char *base,char *rel,double price,struct LP_quoteinfo *qp) { char pairstr[512],*msg; cJSON *retjson; bits256 privkey; int32_t pair=-1,retval = -1,DEXselector = 0; struct basilisk_swap *swap; struct iguana_info *coin; - printf("LP_connectstartbob.(%s) with.(%s) %s\n",myipaddr,jprint(argjson,0),LP_myipaddr); + printf("LP_connectstartbob.(%s) with.(%s) %s\n",LP_myipaddr,jprint(argjson,0),LP_myipaddr); qp->quotetime = (uint32_t)time(NULL); if ( (coin= LP_coinfind(utxo->coin)) == 0 ) { @@ -546,7 +546,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, { retval = 4; if ( butxo->T.swappending != 0 && butxo->S.swap == 0 ) - LP_connectstartbob(ctx,pubsock,butxo,argjson,myipaddr,Q.srccoin,Q.destcoin,qprice,&Q); + LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); } } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 00bbe692c..a8ca0e1ae 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -580,7 +580,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba txfee = swap->I.Atxfee; else txfee = LP_MIN_TXFEE; } - if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) + if ( j64bits(vout,"satoshis") >= rawtx->I.amount && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) { if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) { From c032065398bbd5de4b58a6ba2d2da4aa8d93733b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 13:42:45 +0200 Subject: [PATCH 427/682] Test --- iguana/exchanges/LP_include.h | 2 ++ iguana/exchanges/LP_ordermatch.c | 29 ++++++----------------------- iguana/exchanges/LP_utxos.c | 19 ++++++++++++++----- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index e2be89c69..6dc854d34 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -47,6 +47,8 @@ #define LP_MIN_TXFEE 10000 #define LP_MINVOL 20 #define LP_MINCLIENTVOL 100 +#define LP_MINSIZE_TXFEEMULT 10 +#define LP_REQUIRED_TXFEE 0.95 #define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV) #define LP_DEPOSITSATOSHIS(satoshis) ((satoshis) + (satoshis >> 3)) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e2e4754e0..d1e066444 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -268,19 +268,19 @@ double LP_quote_validate(struct LP_utxoinfo **autxop,struct LP_utxoinfo **butxop return(-11); } qprice = ((double)qp->destsatoshis / qp->satoshis); - if ( qp->satoshis < (srcvalue / LP_MINVOL) ) + if ( qp->satoshis < (srcvalue / LP_MINVOL) || srcvalue < qp->txfee*LP_MINSIZE_TXFEEMULT ) { - printf("utxo payment %.8f is less than %f covered by Q %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis)); + printf("utxo payment %.8f is less than %f covered by Q %.8f or <10x txfee %.8f\n",dstr(srcvalue),1./LP_MINVOL,dstr(qp->satoshis),dstr(qp->txfee)); return(-12); } - if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) ) + if ( qp->destsatoshis < (destvalue / LP_MINCLIENTVOL) || destvalue < qp->desttxfee*LP_MINSIZE_TXFEEMULT ) { - printf("destsatoshis %.8f is less than %f of value %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue)); + printf("destsatoshis %.8f is less than %f of value %.8f or < 10x txfee %.8f\n",dstr(qp->destsatoshis),1./LP_MINCLIENTVOL,dstr(destvalue),dstr(qp->desttxfee)); return(-13); } LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); printf("qprice %.8f <- %.8f/%.8f txfees.(%.8f %.8f) vs (%.8f %.8f)\n",qprice,dstr(qp->destsatoshis),dstr(qp->satoshis),dstr(qp->txfee),dstr(qp->desttxfee),dstr(txfee),dstr(desttxfee)); - if ( qp->txfee < 0.95*txfee || qp->desttxfee < 0.95*desttxfee ) + if ( qp->txfee < LP_REQUIRED_TXFEE*txfee || qp->desttxfee < LP_REQUIRED_TXFEE*desttxfee ) return(-14); return(qprice); } @@ -313,19 +313,6 @@ double LP_query(void *ctx,char *myipaddr,int32_t mypubsock,char *method,struct L reqjson = LP_quotejson(qp); if ( bits256_nonz(qp->desthash) != 0 ) flag = 1; - /*if ( IAMLP != 0 ) - { - jaddstr(reqjson,"method",method); - msg = jprint(reqjson,1); - /LP_send(LP_mypubsock,msg,(int32_t)strlen(msg)+1,1); - } - else - { - jaddstr(reqjson,"method2",method); - jaddstr(reqjson,"method","forward"); - jaddbits256(reqjson,"pubkey",qp->srchash); - /LP_forward(ctx,myipaddr,mypubsock,qp->srchash,jprint(reqjson,1),1); - }*/ jaddbits256(reqjson,"pubkey",qp->srchash); jaddstr(reqjson,"method",method); msg = jprint(reqjson,1); @@ -600,7 +587,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh { if ( bestprice == 0. ) // assumes price ordered asks bestprice = price; - printf("item.[%d] %s\n",i,jprint(item,0)); + //printf("item.[%d] %s\n",i,jprint(item,0)); txid = jbits256(item,"txid"); vout = jint(item,"vout"); vol = jdouble(item,"volume"); @@ -610,10 +597,6 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { destsatoshis = ((butxo->S.satoshis - txfee) * price); - /*if ( destsatoshis > autxo->payment.value-desttxfee-1 ) - destsatoshis = autxo->payment.value-desttxfee-1; - if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) - destsatoshis = maxdestsatoshis-desttxfee-1;*/ satoshis = (destsatoshis / price + 0.49) - txfee; if ( satoshis <= 0 ) continue; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index efaa8e96e..8ba54a616 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -288,14 +288,15 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; struct iguana_info *coin = LP_coinfind(symbol); + uint64_t val,val2=0,txfee,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; if ( bypass != 0 ) val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); - if ( val >= satoshis ) + txfee = LP_txfeecalc(symbol,0); + if ( val >= satoshis && val > 10*txfee ) { threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : LP_DEXFEE(satoshis); if ( bypass != 0 ) @@ -315,7 +316,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2); + char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) @@ -793,7 +794,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub) { - char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,iambob,vout,depositvout; uint64_t *values=0,satoshis,depositval,targetval,value,total = 0; + char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,iambob,vout,depositvout; uint64_t *values=0,satoshis,txfee,depositval,targetval,value,total = 0; if ( coin == 0 ) { printf("coin not active\n"); @@ -802,6 +803,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr); if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 ) { + txfee = LP_txfeecalc(coin->symbol,0); if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (iambob=0; iambob<=1; iambob++) @@ -835,10 +837,17 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = 0, used++; if ( iambob == 0 ) targetval = (depositval / 776) + 100000; - else targetval = (depositval / 9) * 8 + 100000; + else + { + if ( depositval < LP_MINSIZE_TXFEEMULT*txfee ) + continue; + targetval = (depositval / 9) * 8 + 100000; + } //printf("i.%d %.8f target %.8f\n",i,dstr(depositval),dstr(targetval)); if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 && iambob != 0 ) targetval /= 4; + if ( iambob != 0 && targetval < txfee*LP_MINSIZE_TXFEEMULT ) + continue; if ( (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { item = jitem(array,i); From cc099dc9ebae4a804e9deed7da06885c9ec3663e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 13:46:21 +0200 Subject: [PATCH 428/682] Test --- iguana/exchanges/LP_transaction.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f6648b7ee..0f927d550 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -564,7 +564,14 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch printf("utxo %.8f, destamount %.8f change %.8f txfee %.8f\n",dstr(value),dstr(satoshis),dstr(change),dstr(txfee)); } else if ( value > txfee ) satoshis = value - txfee; - else printf("unexpected small value %.8f vs txfee %.8f\n",dstr(value),dstr(txfee)); + else + { + printf("unexpected small value %.8f vs txfee %.8f\n",dstr(value),dstr(txfee)); + change = 0; + satoshis = value >> 1; + txfee = (value - satoshis); + printf("unexpected small value %.8f vs txfee %.8f -> %.8f %.8f\n",dstr(value),dstr(txfee),dstr(satoshis),dstr(txfee)); + } if ( change < 6000 ) { satoshis += change; From 32613a060f100670e88726041064d7c8a4f7b537 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 13:49:12 +0200 Subject: [PATCH 429/682] Test --- iguana/exchanges/LP_remember.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 9d9ad1efb..dcb14fe7e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -630,6 +630,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti ABdest = Adestaddr; } } + if ( bob == 0 || alice == 0 ) + { + printf("Bob.%p is null or Alice.%p is null\n",bob,alice); + return(0); + } + if ( alice->inactive != 0 || bob->inactive != 0 ) + { + printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",alicecoin,alice->inactive,bobcoin,bob->inactive); + return(0); + } if ( sentflags[BASILISK_ALICEPAYMENT] == 0 && bits256_nonz(txids[BASILISK_ALICEPAYMENT]) != 0 ) { printf("txbytes.%p Apayment.%s\n",txbytes[BASILISK_ALICEPAYMENT],bits256_str(str,txids[BASILISK_ALICEPAYMENT])); From af6d41fa34041b703aa443bfd2358bede0130101 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 13:52:36 +0200 Subject: [PATCH 430/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1aaa96921..bcf62e237 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -337,7 +337,7 @@ double LP_getestimatedrate(char *symbol) if ( retstr[0] != '-' ) { rate = atof(retstr) / 1024.; - printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); + //printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); } free(retstr); } From b45a450219ee0e546fda53345b1f52330a0c0264 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 15:09:36 +0200 Subject: [PATCH 431/682] Test --- iguana/exchanges/LP_ordermatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d1e066444..7293079a1 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -627,6 +627,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh } else { + printf("ineligible.(%.8f %.8f)\n",price,dstr(butxo->S.satoshis)); if ( butxo->T.spentflag == 0 ) butxo->T.spentflag = (uint32_t)time(NULL); } From 2a57c5ff68bed641bb73ee8823c71921d68f7130 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 16:58:23 +0200 Subject: [PATCH 432/682] Test --- iguana/exchanges/LP_ordermatch.c | 59 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7293079a1..f76526cac 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -32,6 +32,23 @@ void LP_txfees(uint64_t *txfeep,uint64_t *desttxfeep,char *base,char *rel) *desttxfeep = LP_txfeecalc(rel,0); } +double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) +{ + uint64_t destsatoshis,satoshis; + a_value -= (desttxfee + 1); + destsatoshis = ((b_satoshis - txfee) * price); + if ( destsatoshis > a_value ) + destsatoshis = a_value; + if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) + destsatoshis = maxdestsatoshis-desttxfee-1; + satoshis = (destsatoshis / price + 0.49) - txfee; + *destsatoshisp = destsatoshis; + *satoshisp = satoshis; + if ( satoshis > 0 ) + return((double)destsatoshis / satoshis); + else return(0.); +} + struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srchash,bits256 desthash,char *src,uint64_t srcsatoshis,char *dest,uint64_t destsatoshis,uint32_t timestamp,uint32_t quotetime,int32_t DEXselector) { struct basilisk_request R; @@ -132,14 +149,15 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) return(0); } -int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char *destcoin,double price,uint64_t destsatoshis) +int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char *destcoin,double price,uint64_t satoshis,uint64_t destsatoshis) { memset(qp,0,sizeof(*qp)); if ( qp->timestamp == 0 ) qp->timestamp = (uint32_t)time(NULL); safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); LP_txfees(&qp->txfee,&qp->desttxfee,utxo->coin,qp->destcoin); - qp->satoshis = (destsatoshis / price) + 0.49; + qp->satoshis = satoshis;//(destsatoshis / price) + 0.49; + qp->destsatoshis = destsatoshis; if ( utxo->iambob == 0 || qp->txfee >= qp->satoshis || qp->txfee >= utxo->deposit.value || utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis) ) { printf("quoteinit error.(%d %d %d %d) %.8f vs %.8f\n",utxo->iambob == 0,qp->txfee >= qp->satoshis,qp->txfee >= utxo->deposit.value,utxo->deposit.value < LP_DEPOSITSATOSHIS(qp->satoshis),dstr(utxo->deposit.value),dstr(LP_DEPOSITSATOSHIS(qp->satoshis))); @@ -149,7 +167,6 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * qp->vout = utxo->payment.vout; qp->txid2 = utxo->deposit.txid; qp->vout2 = utxo->deposit.vout; - qp->destsatoshis = destsatoshis; if ( qp->desttxfee >= qp->destsatoshis ) { printf("quoteinit desttxfee %.8f < %.8f destsatoshis\n",dstr(qp->desttxfee),dstr(qp->destsatoshis)); @@ -541,28 +558,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } -double LP_qprice_calc(int64_t *destsatoshisp,int64_t *satoshisp,double price,uint64_t b_satoshis,uint64_t txfee,uint64_t a_value,uint64_t maxdestsatoshis,uint64_t desttxfee) -{ - uint64_t destsatoshis,satoshis; - a_value -= (desttxfee + 1); - destsatoshis = ((b_satoshis - txfee) * price); - if ( destsatoshis > a_value ) - destsatoshis = a_value; - if ( maxdestsatoshis != 0 && destsatoshis > maxdestsatoshis-desttxfee-1 ) - destsatoshis = maxdestsatoshis-desttxfee-1; - satoshis = (destsatoshis / price + 0.49) - txfee; - *destsatoshisp = destsatoshis; - *satoshisp = satoshis; - if ( satoshis > 0 ) - return((double)destsatoshis / satoshis); - else return(0.); -} - -struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) +struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp,int64_t *bestdestsatoshisp,struct LP_utxoinfo *autxo,char *base,double maxprice,int32_t duration,uint64_t txfee,uint64_t desttxfee,uint64_t maxdestsatoshis) { int64_t satoshis,destsatoshis; uint64_t val,val2; bits256 txid,pubkey; char *obookstr; cJSON *orderbook,*asks,*item; struct LP_utxoinfo *butxo,*bestutxo = 0; int32_t i,n,j,vout,numasks; double bestmetric=0.,metric,vol,price,qprice,bestprice = 0.; struct LP_pubkeyinfo *pubp; *ordermatchpricep = 0.; - *bestdestsatoshisp = 0; + *bestsatoshisp = *bestdestsatoshisp = 0; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( maxprice <= 0. || LP_priceinfofind(base) == 0 ) @@ -610,7 +610,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh if ( (qprice= LP_qprice_calc(&destsatoshis,&satoshis,(price*(100.+j))/100.,butxo->S.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) break; } - printf("j.%d/%d qprice %.8f vs price %.8f\n",j,n,qprice,price); + printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); @@ -620,6 +620,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestdestsatosh bestutxo = butxo; *ordermatchpricep = price; *bestdestsatoshisp = destsatoshis; + *bestsatoshisp = satoshis; bestmetric = metric; printf("set best!\n"); } @@ -668,14 +669,14 @@ char *LP_bestfit(char *rel,double relvolume) char *LP_ordermatch(char *base,int64_t txfee,double maxprice,double maxvolume,char *rel,bits256 txid,int32_t vout,bits256 feetxid,int32_t feevout,int64_t desttxfee,int32_t duration) { - struct LP_quoteinfo Q; int64_t bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; + struct LP_quoteinfo Q; int64_t bestsatoshis=0,bestdestsatoshis = 0; double ordermatchprice = 0.; struct LP_utxoinfo *autxo,*bestutxo; txfee = LP_txfeecalc(base,txfee); desttxfee = LP_txfeecalc(rel,desttxfee); if ( (autxo= LP_utxopairfind(0,txid,vout,feetxid,feevout)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxopair\"}")); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*maxvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestdestsatoshis) < 0 ) + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); @@ -741,7 +742,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration) { - uint64_t desttxfee,txfee; int64_t bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; + uint64_t desttxfee,txfee; int64_t bestsatoshis=0,bestdestsatoshis=0; struct LP_utxoinfo *autxo,*butxo,*bestutxo = 0; double qprice,ordermatchprice=0.; struct LP_quoteinfo Q; if ( duration <= 0 ) duration = LP_ORDERBOOK_DURATION; if ( timeout <= 0 ) @@ -751,12 +752,12 @@ char *LP_autotrade(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *r if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 ) return(clonestr("{\"error\":\"cant find utxo that is big enough\"}")); LP_txfees(&txfee,&desttxfee,base,rel); - if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) + if ( (bestutxo= LP_bestutxo(&ordermatchprice,&bestsatoshis,&bestdestsatoshis,autxo,base,maxprice,duration,txfee,desttxfee,SATOSHIDEN*relvolume)) == 0 || ordermatchprice == 0. || bestdestsatoshis == 0 ) { printf("bestutxo.%p ordermatchprice %.8f bestdestsatoshis %.8f\n",bestutxo,ordermatchprice,dstr(bestdestsatoshis)); return(clonestr("{\"error\":\"cant find ordermatch utxo\"}")); } - if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestdestsatoshis) < 0 ) + if ( LP_quoteinfoinit(&Q,bestutxo,rel,ordermatchprice,bestsatoshis,bestdestsatoshis) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote\"}")); if ( LP_quotedestinfo(&Q,autxo->payment.txid,autxo->payment.vout,autxo->fee.txid,autxo->fee.vout,LP_mypub25519,autxo->coinaddr) < 0 ) return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); From 3a6058be3f3cfc15a6218d0f4c616a2f02897bdc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 17:07:22 +0200 Subject: [PATCH 433/682] Test --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6dc854d34..fde210b83 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -68,7 +68,7 @@ #define LP_PROPAGATION_SLACK 100 // txid ordering is not enforced, so getting extra recent txid #define LP_RESERVETIME 60 -#define LP_AVETXSIZE 200 +#define LP_AVETXSIZE 256 #define LP_CACHEDURATION 60 #define BASILISK_DEFAULT_NUMCONFIRMS 1 #define DEX_SLEEP 3 From 1148ddda8e3dbf0f811ab414dd86cbd44c7c480e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 17:48:39 +0200 Subject: [PATCH 434/682] Test --- iguana/exchanges/LP_ordermatch.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f76526cac..ae73099cb 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -21,7 +21,15 @@ uint64_t LP_txfeecalc(char *symbol,uint64_t txfee) { - if ( txfee == 0 && (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + struct iguana_info *coin; + if ( strcmp(symbol,"BTC") == 0 ) + { + if ( txfee == 0 && (txfee= LP_getestimatedrate(symbol) * LP_AVETXSIZE) < LP_MIN_TXFEE ) + txfee = LP_MIN_TXFEE; + } + else if ( (coin= LP_coinfind(symbol)) != 0 ) + txfee = coin->txfee; + if ( txfee < LP_MIN_TXFEE ) txfee = LP_MIN_TXFEE; return(txfee); } From 38fd836d6c15d3d103d3548bc2d6171f6888d9be Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 24 Jul 2017 18:00:30 +0200 Subject: [PATCH 435/682] Test --- iguana/exchanges/LP_prices.c | 81 ++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 2d7df7f39..4bc86796b 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -172,7 +172,7 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) base = LP_priceinfos[baseid].symbol; for (relid=0; relidmatrix[baseid][relid]) > SMALLVAL ) + if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { item = cJSON_CreateArray(); jaddistr(item,base); @@ -215,14 +215,17 @@ void LP_prices_parse(cJSON *obj) base = jstri(item,0); rel = jstri(item,1); askprice = jdoublei(item,2); - if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) + if ( askprice > SMALLVAL && isnan(askprice) == 0 && askprice < SATOSHIDEN ) { - char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); - pubp->matrix[basepp->ind][relid] = askprice; - if ( (relpp= LP_priceinfofind(rel)) != 0 ) + if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { - dxblend(&basepp->relvals[relpp->ind],askprice,0.9); - dxblend(&relpp->relvals[basepp->ind],1. / askprice,0.9); + char str[65]; printf("%s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice); + pubp->matrix[basepp->ind][relid] = askprice; + if ( (relpp= LP_priceinfofind(rel)) != 0 ) + { + dxblend(&basepp->relvals[relpp->ind],askprice,0.9); + dxblend(&relpp->relvals[basepp->ind],1. / askprice,0.9); + } } } } @@ -259,6 +262,8 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i { printf("LP_pricecache: null ptr->price? "); ptr->price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; + if ( ptr->price < SMALLVAL || isnan(ptr->price) != 0 || ptr->price >= SATOSHIDEN ) + ptr->price = 0.; } //printf("found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); @@ -270,12 +275,15 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i void LP_priceinfoupdate(char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; - if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { - //dxblend(&basepp->relvals[relpp->ind],price,0.9); - //dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); - basepp->relvals[relpp->ind] = price; - relpp->relvals[basepp->ind] = 1. / price; + if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + { + //dxblend(&basepp->relvals[relpp->ind],price,0.9); + //dxblend(&relpp->relvals[basepp->ind],1. / price,0.9); + basepp->relvals[relpp->ind] = price; + relpp->relvals[basepp->ind] = 1. / price; + } } } @@ -285,9 +293,9 @@ double LP_myprice(double *bidp,double *askp,char *base,char *rel) *bidp = *askp = 0.; if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( (*askp= basepp->myprices[relpp->ind]) > SMALLVAL ) + if ( (*askp= basepp->myprices[relpp->ind]) > SMALLVAL && isnan(*askp) == 0 && *askp < SATOSHIDEN ) { - if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL ) + if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL && isnan(val) == 0 && val < SATOSHIDEN ) { *bidp = 1. / val; return((*askp + *bidp) * 0.5); @@ -300,7 +308,7 @@ double LP_myprice(double *bidp,double *askp,char *base,char *rel) } else { - if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL ) + if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL && isnan(val) == 0 && val < SATOSHIDEN ) { *bidp = 1. / val; *askp = 0.; @@ -339,7 +347,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; *changedp = 0; - if ( base != 0 && rel != 0 && price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + if ( base != 0 && rel != 0 && price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 && isnan(price) == 0 && price < SATOSHIDEN ) { if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) *changedp = 1; @@ -439,24 +447,27 @@ struct LP_cacheinfo *LP_cacheadd(char *base,char *rel,bits256 txid,int32_t vout, char str[65]; struct LP_cacheinfo *ptr=0; if ( base == 0 || rel == 0 ) return(0); - if ( (ptr= LP_cachefind(base,rel,txid,vout)) == 0 ) + if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { - ptr = calloc(1,sizeof(*ptr)); - if ( LP_cachekey(ptr->key,base,rel,txid,vout) == sizeof(ptr->key) ) + if ( (ptr= LP_cachefind(base,rel,txid,vout)) == 0 ) + { + ptr = calloc(1,sizeof(*ptr)); + if ( LP_cachekey(ptr->key,base,rel,txid,vout) == sizeof(ptr->key) ) + { + portable_mutex_lock(&LP_cachemutex); + HASH_ADD(hh,LP_cacheinfos,key,sizeof(ptr->key),ptr); + portable_mutex_unlock(&LP_cachemutex); + } else printf("LP_cacheadd keysize mismatch?\n"); + } + ptr->Q = *qp; + ptr->timestamp = (uint32_t)time(NULL); + if ( price != ptr->price ) { - portable_mutex_lock(&LP_cachemutex); - HASH_ADD(hh,LP_cacheinfos,key,sizeof(ptr->key),ptr); - portable_mutex_unlock(&LP_cachemutex); - } else printf("LP_cacheadd keysize mismatch?\n"); + ptr->price = price; + LP_priceinfoupdate(base,rel,price); + printf("updated %s/v%d %s/%s %llu price %.8f\n",bits256_str(str,txid),vout,base,rel,(long long)qp->satoshis,price); + } else ptr->price = price; } - ptr->Q = *qp; - ptr->timestamp = (uint32_t)time(NULL); - if ( price != ptr->price ) - { - ptr->price = price; - LP_priceinfoupdate(base,rel,price); - printf("updated %s/v%d %s/%s %llu price %.8f\n",bits256_str(str,txid),vout,base,rel,(long long)qp->satoshis,price); - } else ptr->price = price; return(ptr); } @@ -489,7 +500,7 @@ static int _cmp_orderbook(const void *a,const void *b) cJSON *LP_orderbookjson(struct LP_orderbookentry *op) { cJSON *item = cJSON_CreateObject(); - if ( op->price > SMALLVAL ) + if ( op->price > SMALLVAL && isnan(op->price) == 0 && op->price < SATOSHIDEN ) { jaddnum(item,"price",op->price); jaddnum(item,"volume",dstr(op->basesatoshis)); @@ -629,7 +640,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) if ( origprice > SMALLVAL && origprice < price ) price = origprice; } - if ( price > SMALLVAL ) + if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); @@ -788,7 +799,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) LP_pricefname(fname,base,rel); fp = basepp->fps[relpp->ind] = OS_appendfile(fname); } - if ( fp != 0 && price > SMALLVAL ) + if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { now = (uint32_t)time(NULL); price64 = price * SATOSHIDEN; @@ -801,7 +812,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,rel,base); fp = relpp->fps[basepp->ind] = OS_appendfile(fname); } - if ( fp != 0 && price > SMALLVAL ) + if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) { now = (uint32_t)time(NULL); price64 = (1. / price) * SATOSHIDEN; From fadd624ecccd36e455403c87bda0c18417214a5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 08:53:41 +0200 Subject: [PATCH 436/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_prices.c | 6 +++--- iguana/exchanges/LP_utxos.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4b7dc9e5b..2dd574410 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,10 +19,11 @@ // // new features: // stats -// multidimensional portfolio +// multidimensional portfolio, percentage among active vs all // autoutxo // bugs: +// getutxos lastn field // false detection of bobreclaim // unduplicated bugs: diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 4bc86796b..874a257e9 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -792,14 +792,14 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); - if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( (fp= basepp->fps[relpp->ind]) == 0 ) { LP_pricefname(fname,base,rel); fp = basepp->fps[relpp->ind] = OS_appendfile(fname); } - if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + if ( fp != 0 ) { now = (uint32_t)time(NULL); price64 = price * SATOSHIDEN; @@ -812,7 +812,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,rel,base); fp = relpp->fps[basepp->ind] = OS_appendfile(fname); } - if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + if ( fp != 0 ) { now = (uint32_t)time(NULL); price64 = (1. / price) * SATOSHIDEN; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8ba54a616..b49efddb6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -359,7 +359,7 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la if ( lastn >= n ) firsti = -1; else firsti = (lastn - n); - //printf("LP_utxos iambob.%d symbol.%s firsti.%d lastn.%d\n",iambob,symbol==0?"":symbol,firsti,lastn); + printf("LP_utxos iambob.%d symbol.%s firsti.%d lastn.%d\n",iambob,symbol==0?"":symbol,firsti,lastn); HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) { //char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid)); From 47fb296c197361d489c3e4c6a86f236e53cd19f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 08:58:09 +0200 Subject: [PATCH 437/682] Test --- iguana/exchanges/LP_utxos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b49efddb6..0ee2c656a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -373,6 +373,8 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); continue; } else jaddi(utxosjson,LP_utxojson(utxo)); + if ( n++ > lastn ) + break; } } return(jprint(utxosjson,1)); From c5ec65d16d48c8f2aa788612bb3e959a786f36a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 09:04:16 +0200 Subject: [PATCH 438/682] Test --- iguana/exchanges/LP_utxos.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0ee2c656a..745aff2e8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -351,20 +351,13 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) { - int32_t i,firsti,n; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); - i = 0; - n = mypeer != 0 ? mypeer->numutxos : 0; + int32_t i,n,m; uint64_t val,val2; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); + //n = mypeer != 0 ? mypeer->numutxos : 0; if ( lastn <= 0 ) lastn = LP_PROPAGATION_SLACK * 2; - if ( lastn >= n ) - firsti = -1; - else firsti = (lastn - n); - printf("LP_utxos iambob.%d symbol.%s firsti.%d lastn.%d\n",iambob,symbol==0?"":symbol,firsti,lastn); HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) { //char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid)); - if ( i++ < firsti ) - continue; if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 ) { u = (iambob != 0) ? utxo->deposit : utxo->fee; @@ -373,10 +366,14 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la char str[65]; printf("iambob.%d not eligible (%.8f %.8f) %s %s/v%d\n",iambob,dstr(val),dstr(val2),utxo->coin,bits256_str(str,utxo->payment.txid),utxo->payment.vout); continue; } else jaddi(utxosjson,LP_utxojson(utxo)); - if ( n++ > lastn ) - break; } } + if ( (n= cJSON_GetArraySize(utxosjson)) > lastn ) + { + m = n - lastn; + for (i=0; i Date: Tue, 25 Jul 2017 10:08:14 +0200 Subject: [PATCH 439/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2dd574410..7e7354169 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -425,7 +425,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+60 ) + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+600 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); From e6b962f2b9a1d5da3b21c5ce40ca7ba2c1768b44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 10:56:13 +0200 Subject: [PATCH 440/682] Test --- iguana/exchanges/LP_portfolio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 082d8a7e7..e93664313 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -175,6 +175,7 @@ char *LP_portfolio_goal(char *symbol,double goal) else if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) { coin->goal = goal; + printf("set %s goal %f\n",coin->symbol,goal); return(LP_portfolio()); } else return(clonestr("{\"error\":\"cant set goal for inactive coin\"}")); } From 23653763c7093ce3be300cc96e20918fe12dd8b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 11:18:13 +0200 Subject: [PATCH 441/682] Test --- iguana/exchanges/LP_portfolio.c | 6 +++--- iguana/exchanges/LP_prices.c | 35 ++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index e93664313..734c599b8 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -422,13 +422,13 @@ void prices_loop(void *ignore) LP_myprice(&bid,&ask,buycoin,sellcoin); maxprice = ask; printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - if ( maxprice > SMALLVAL && LP_utxo_bestfit(sellcoin,sell->relvolume) != 0 ) + if ( LP_pricevalid(maxprice) > 0 && LP_utxo_bestfit(sellcoin,sell->relvolume) != 0 ) { relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { requestid = quoteid = 0; - if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 ) + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { @@ -438,7 +438,7 @@ void prices_loop(void *ignore) } free_json(retjson2); } - printf("relvolume %.8f LP_autotrade.(%s)\n",relvolume,retstr2); + printf("%s relvolume %.8f LP_autotrade.(%s)\n",sellcoin,relvolume,retstr2); free(retstr2); } if ( requestid != 0 && quoteid != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 874a257e9..ffc70f2cf 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -54,6 +54,13 @@ struct LP_pubkeyinfo uint32_t timestamp,istrusted,numerrors; } *LP_pubkeyinfos; +int32_t LP_pricevalid(double price) +{ + if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + return(1); + else return(0); +} + struct LP_priceinfo *LP_priceinfofind(char *symbol) { int32_t i; struct LP_priceinfo *pp; uint64_t coinbits; @@ -172,7 +179,8 @@ cJSON *LP_pubkeyjson(struct LP_pubkeyinfo *pubp) base = LP_priceinfos[baseid].symbol; for (relid=0; relidmatrix[baseid][relid]) > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + price = pubp->matrix[baseid][relid]; + if ( LP_pricevalid(price) > 0 ) { item = cJSON_CreateArray(); jaddistr(item,base); @@ -215,7 +223,7 @@ void LP_prices_parse(cJSON *obj) base = jstri(item,0); rel = jstri(item,1); askprice = jdoublei(item,2); - if ( askprice > SMALLVAL && isnan(askprice) == 0 && askprice < SATOSHIDEN ) + if ( LP_pricevalid(askprice) > 0 ) { if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) { @@ -262,7 +270,7 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i { printf("LP_pricecache: null ptr->price? "); ptr->price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; - if ( ptr->price < SMALLVAL || isnan(ptr->price) != 0 || ptr->price >= SATOSHIDEN ) + if ( LP_pricevalid(ptr->price) <= 0 ) ptr->price = 0.; } //printf("found %s/%s %.8f\n",base,rel,ptr->price); @@ -275,7 +283,7 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i void LP_priceinfoupdate(char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; - if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + if ( LP_pricevalid(price) > 0 ) { if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { @@ -293,9 +301,11 @@ double LP_myprice(double *bidp,double *askp,char *base,char *rel) *bidp = *askp = 0.; if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( (*askp= basepp->myprices[relpp->ind]) > SMALLVAL && isnan(*askp) == 0 && *askp < SATOSHIDEN ) + *askp = basepp->myprices[relpp->ind]; + if ( LP_pricevalid(*askp) > 0 ) { - if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL && isnan(val) == 0 && val < SATOSHIDEN ) + val = relpp->myprices[basepp->ind]; + if ( LP_pricevalid(val) > 0 ) { *bidp = 1. / val; return((*askp + *bidp) * 0.5); @@ -308,7 +318,8 @@ double LP_myprice(double *bidp,double *askp,char *base,char *rel) } else { - if ( (val= relpp->myprices[basepp->ind]) > SMALLVAL && isnan(val) == 0 && val < SATOSHIDEN ) + val = relpp->myprices[basepp->ind]; + if ( LP_pricevalid(val) > 0 ) { *bidp = 1. / val; *askp = 0.; @@ -347,7 +358,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; *changedp = 0; - if ( base != 0 && rel != 0 && price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 && isnan(price) == 0 && price < SATOSHIDEN ) + if ( base != 0 && rel != 0 && LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL ) *changedp = 1; @@ -447,7 +458,7 @@ struct LP_cacheinfo *LP_cacheadd(char *base,char *rel,bits256 txid,int32_t vout, char str[65]; struct LP_cacheinfo *ptr=0; if ( base == 0 || rel == 0 ) return(0); - if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + if ( LP_pricevalid(price) > 0 ) { if ( (ptr= LP_cachefind(base,rel,txid,vout)) == 0 ) { @@ -500,7 +511,7 @@ static int _cmp_orderbook(const void *a,const void *b) cJSON *LP_orderbookjson(struct LP_orderbookentry *op) { cJSON *item = cJSON_CreateObject(); - if ( op->price > SMALLVAL && isnan(op->price) == 0 && op->price < SATOSHIDEN ) + if ( LP_pricevalid(op->price) > 0 ) { jaddnum(item,"price",op->price); jaddnum(item,"volume",dstr(op->basesatoshis)); @@ -640,7 +651,7 @@ char *LP_pricestr(char *base,char *rel,double origprice) if ( origprice > SMALLVAL && origprice < price ) price = origprice; } - if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN ) + if ( LP_pricevalid(price) > 0 ) { retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); @@ -792,7 +803,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) { struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp; //printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey)); - if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) + if ( LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { if ( (fp= basepp->fps[relpp->ind]) == 0 ) { From 6939f6038b84e54dfb2424822fd4a09e43ff4b63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 11:36:00 +0200 Subject: [PATCH 442/682] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_prices.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ae73099cb..4ac6a6109 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -201,7 +201,7 @@ char *LP_quotereceived(cJSON *argjson) { struct LP_cacheinfo *ptr; double price; struct LP_quoteinfo Q; LP_quoteparse(&Q,argjson); - price = (double)(Q.destsatoshis + Q.desttxfee) / (Q.satoshis + Q.txfee); + price = (double)Q.destsatoshis / Q.satoshis; if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) { ptr->Q = Q; @@ -618,7 +618,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, if ( (qprice= LP_qprice_calc(&destsatoshis,&satoshis,(price*(100.+j))/100.,butxo->S.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) break; } - printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); + //printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); @@ -706,7 +706,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q // free(retstr); price = LP_query(ctx,myipaddr,mypubsock,"request",qp); bestitem = LP_quotejson(qp); - if ( price > SMALLVAL ) + if ( LP_pricevalid(price) > 0 ) { if ( price <= maxprice ) { diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ffc70f2cf..7c78752c7 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -268,12 +268,12 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i (*qp) = ptr->Q; if ( ptr->price == 0. && ptr->Q.satoshis != 0 ) { - printf("LP_pricecache: null ptr->price? "); ptr->price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; if ( LP_pricevalid(ptr->price) <= 0 ) ptr->price = 0.; + printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); } - //printf("found %s/%s %.8f\n",base,rel,ptr->price); + printf("found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); } //char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); From ac9dfb252233a64598f4a0eb7599dfa65c6d7adb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 11:48:29 +0200 Subject: [PATCH 443/682] Test --- iguana/exchanges/LP_commands.c | 2 -- iguana/exchanges/LP_ordermatch.c | 2 ++ iguana/exchanges/LP_prices.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3bb040fc4..1a98996a2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -221,8 +221,6 @@ trust(pubkey, trust)\n\ { if ( price > SMALLVAL ) { - printf("price set (%s/%s) <- %.8f\n",rel,base,1./price); - LP_mypriceset(&changed,rel,base,1./price); return(LP_autotrade(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 4ac6a6109..6e6257849 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -662,6 +662,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, } if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); + int32_t changed; + LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 7c78752c7..bbd71582e 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -271,9 +271,9 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i ptr->price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; if ( LP_pricevalid(ptr->price) <= 0 ) ptr->price = 0.; - printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); + //printf("LP_pricecache: set %s/%s ptr->price %.8f\n",base,rel,ptr->price); } - printf("found %s/%s %.8f\n",base,rel,ptr->price); + //printf("found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); } //char str[65]; printf("cachemiss %s/%s %s/v%d\n",base,rel,bits256_str(str,txid),vout); From 949ffac5e6a527dcb6cec8e6e0bd0e4dff28f444 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 11:54:48 +0200 Subject: [PATCH 444/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6e6257849..b179c794f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -528,7 +528,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("quote validate error %.0f\n",qprice); return(-4); } - if ( qprice < price-0.00000001 ) + if ( qprice < (price - 0.00000001) * 0.9999 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(-5); From 2ef6881bb9ff04489277be2684736cb13902e979 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:04:30 +0200 Subject: [PATCH 445/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b179c794f..7593a83e0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -618,7 +618,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, if ( (qprice= LP_qprice_calc(&destsatoshis,&satoshis,(price*(100.+j))/100.,butxo->S.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) break; } - //printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); + printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); From f01cc526753b6e709845e6f587bcd0287ee803ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:09:42 +0200 Subject: [PATCH 446/682] Test --- iguana/exchanges/LP_portfolio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 734c599b8..4ecfe5808 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -421,13 +421,18 @@ void prices_loop(void *ignore) { LP_myprice(&bid,&ask,buycoin,sellcoin); maxprice = ask; + strcpy(LP_portfolio_base,""); + strcpy(LP_portfolio_rel,""); + LP_portfolio_relvolume = 0.; printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - if ( LP_pricevalid(maxprice) > 0 && LP_utxo_bestfit(sellcoin,sell->relvolume) != 0 ) + if ( LP_pricevalid(maxprice) > 0 ) { relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { requestid = quoteid = 0; + if ( LP_utxo_bestfit(sellcoin,relvolume) == 0 ) + continue; if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) From 6a6311bfea8a6e723480110f42338ee05fd75c44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:12:22 +0200 Subject: [PATCH 447/682] Test --- iguana/exchanges/LP_portfolio.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 4ecfe5808..4294e0850 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -431,23 +431,24 @@ void prices_loop(void *ignore) for (iter=0; iter<3; iter++) { requestid = quoteid = 0; - if ( LP_utxo_bestfit(sellcoin,relvolume) == 0 ) - continue; - if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) + if ( LP_utxo_bestfit(sellcoin,relvolume) != 0 ) { - if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) { - if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { - + if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + { + + } + free_json(retjson2); } - free_json(retjson2); + printf("%s relvolume %.8f LP_autotrade.(%s)\n",sellcoin,relvolume,retstr2); + free(retstr2); } - printf("%s relvolume %.8f LP_autotrade.(%s)\n",sellcoin,relvolume,retstr2); - free(retstr2); - } - if ( requestid != 0 && quoteid != 0 ) - break; + if ( requestid != 0 && quoteid != 0 ) + break; + } else printf("cant find alice %.8f %s\n",relvolume,sellcoin); relvolume *= 0.1; } } From b74888b8e40bf26dceafb933ac20de345e28f531 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:21:53 +0200 Subject: [PATCH 448/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 745aff2e8..6a5f7d8a3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -403,7 +403,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { - if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || utxo->S.satoshis < bestutxo->S.satoshis) ) + if ( utxo->S.satoshis >= destsatoshis/2 && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { @@ -412,7 +412,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } + } else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); } } return(bestutxo); From 1f2355e2739ba6a15ed8360ed10ce1e5dfe43bb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:25:30 +0200 Subject: [PATCH 449/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6a5f7d8a3..3145d9352 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -400,7 +400,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( strcmp(symbol,utxo->coin) != 0 ) continue; - //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { if ( utxo->S.satoshis >= destsatoshis/2 && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) From cfec2cb04aa54e7f87abbdb920b0e8293c935782 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:29:16 +0200 Subject: [PATCH 450/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3145d9352..25fb43311 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -398,9 +398,9 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) return(0); HASH_ITER(hh,LP_utxoinfos[0],utxo,tmp) { + char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( strcmp(symbol,utxo->coin) != 0 ) continue; - char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) { if ( utxo->S.satoshis >= destsatoshis/2 && (bestutxo == 0 || (bestutxo->S.satoshis < destsatoshis && utxo->S.satoshis >= destsatoshis) || (bestutxo->S.satoshis >= destsatoshis && utxo->S.satoshis < bestutxo->S.satoshis)) ) From 48acf5f17f09c485b1709cd84512b11fcb69668d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:33:37 +0200 Subject: [PATCH 451/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_utxos.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 4294e0850..433bfd31c 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -424,9 +424,9 @@ void prices_loop(void *ignore) strcpy(LP_portfolio_base,""); strcpy(LP_portfolio_rel,""); LP_portfolio_relvolume = 0.; - printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); if ( LP_pricevalid(maxprice) > 0 ) { + printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 25fb43311..34b3ad9b1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -395,7 +395,10 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { uint64_t srcvalue,srcvalue2; struct LP_utxoinfo *utxo,*tmp,*bestutxo = 0; if ( symbol == 0 || destsatoshis == 0 ) + { + printf("LP_utxo_bestfit error symbol.%p %.8f\n",symbol,dstr(destsatoshis)); return(0); + } HASH_ITER(hh,LP_utxoinfos[0],utxo,tmp) { char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); From d6a6e59d5ead5454760aa39f5d102186512775b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:36:01 +0200 Subject: [PATCH 452/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 433bfd31c..d1cedecc4 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -431,7 +431,7 @@ void prices_loop(void *ignore) for (iter=0; iter<3; iter++) { requestid = quoteid = 0; - if ( LP_utxo_bestfit(sellcoin,relvolume) != 0 ) + if ( LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume) != 0 ) { if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) { From fbf9f23fa65b30c934b3f8c13795b6d34e15459a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:54:53 +0200 Subject: [PATCH 453/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 9 +++++++- iguana/exchanges/LP_portfolio.c | 37 +++++++++++++++++--------------- iguana/exchanges/LP_utxos.c | 4 ++-- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7e7354169..2b570d600 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -52,7 +52,7 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; -int32_t USERPASS_COUNTER,IAMLP = 0; +int32_t LP_pendingswaps,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; bits256 LP_mypub25519,LP_mypriv25519; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 7593a83e0..6f72529bd 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -448,6 +448,7 @@ char *LP_connectedalice(cJSON *argjson) // alice if ( (qprice= LP_quote_validate(&autxo,&butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo); + LP_pendingswaps--; printf("quote validate error %.0f\n",qprice); return(clonestr("{\"error\":\"quote validation error\"}")); } @@ -455,6 +456,7 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); LP_availableset(autxo); + LP_pendingswaps--; return(clonestr("{\"error\":\"no price set\"}")); } printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); @@ -464,10 +466,12 @@ char *LP_connectedalice(cJSON *argjson) // alice { printf("qprice %.8f too big vs %.8f\n",qprice,price); LP_availableset(autxo); + LP_pendingswaps--; return(clonestr("{\"error\":\"quote price too expensive\"}")); } if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { + LP_pendingswaps++; return(clonestr("{\"error\":\"cant get alicecoin\"}")); } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); @@ -498,11 +502,13 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) LP_availableset(autxo); + else LP_pendingswaps--; return(jprint(retjson,1)); } else { LP_availableset(autxo); + LP_pendingswaps--; printf("no privkey found\n"); return(clonestr("{\"error\",\"no privkey\"}")); } @@ -618,7 +624,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, if ( (qprice= LP_qprice_calc(&destsatoshis,&satoshis,(price*(100.+j))/100.,butxo->S.satoshis,txfee,autxo->payment.value,maxdestsatoshis,desttxfee)) > price+SMALLVAL ) break; } - printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); + //printf("j.%d/%d qprice %.8f vs price %.8f best.(%.8f %.8f)\n",j,n,qprice,price,dstr(satoshis),dstr(destsatoshis)); if ( metric < 1.2 && destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL) && satoshis-txfee > (butxo->S.satoshis / LP_MINVOL) && satoshis <= butxo->payment.value-txfee ) { printf("value %.8f price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",dstr(autxo->payment.value),price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); @@ -747,6 +753,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } if ( aliceutxo->S.swap == 0 ) LP_availableset(aliceutxo); + else LP_pendingswaps++; return(jprint(bestitem,0)); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index d1cedecc4..8098759ff 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -426,30 +426,33 @@ void prices_loop(void *ignore) LP_portfolio_relvolume = 0.; if ( LP_pricevalid(maxprice) > 0 ) { - printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - relvolume = sell->relvolume; - for (iter=0; iter<3; iter++) + printf("pending.%d base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); + if ( LP_pendingswaps == 0 ) { - requestid = quoteid = 0; - if ( LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume) != 0 ) + relvolume = sell->relvolume; + for (iter=0; iter<3; iter++) { - if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) + requestid = quoteid = 0; + if ( LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume) != 0 ) { - if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,relvolume,60,24*3600)) != 0 ) { - if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { - + if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + { + + } + free_json(retjson2); } - free_json(retjson2); + printf("%s relvolume %.8f LP_autotrade.(%s)\n",sellcoin,relvolume,retstr2); + free(retstr2); } - printf("%s relvolume %.8f LP_autotrade.(%s)\n",sellcoin,relvolume,retstr2); - free(retstr2); - } - if ( requestid != 0 && quoteid != 0 ) - break; - } else printf("cant find alice %.8f %s\n",relvolume,sellcoin); - relvolume *= 0.1; + if ( requestid != 0 && quoteid != 0 ) + break; + } else printf("cant find alice %.8f %s\n",relvolume,sellcoin); + relvolume *= 0.1; + } } } else diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 34b3ad9b1..b7fbceca3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -401,7 +401,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) } HASH_ITER(hh,LP_utxoinfos[0],utxo,tmp) { - char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); + //char str[65]; printf("s%u %d [%.8f vs %.8f] check %s.%s avail.%d ismine.%d >= %d\n",utxo->T.spentflag,LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout),dstr(destsatoshis),dstr(utxo->S.satoshis),utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis); if ( strcmp(symbol,utxo->coin) != 0 ) continue; if ( LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 ) @@ -415,7 +415,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) continue; } bestutxo = utxo; - } else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); + } //else printf("skip alice utxo %.8f vs dest %.8f\n",dstr(utxo->S.satoshis),dstr(destsatoshis)); } } return(bestutxo); From 9329db81bdef78b07faa909a61c9544762394d65 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 12:57:09 +0200 Subject: [PATCH 454/682] Test --- iguana/exchanges/LP_portfolio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 8098759ff..fa1fb0360 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -432,6 +432,8 @@ void prices_loop(void *ignore) relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { + if ( relvolume < LP_MIN_TXFEE ) + break; requestid = quoteid = 0; if ( LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume) != 0 ) { From e8c2d7996ffc30ead6ec5f7c32c0ff3bc1d7bc21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 13:15:08 +0200 Subject: [PATCH 455/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index fa1fb0360..36ce949ab 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -432,7 +432,7 @@ void prices_loop(void *ignore) relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { - if ( relvolume < LP_MIN_TXFEE ) + if ( relvolume < dstr(LP_MIN_TXFEE) ) break; requestid = quoteid = 0; if ( LP_utxo_bestfit(sellcoin,SATOSHIDEN * relvolume) != 0 ) From b3d8d706783d98259fbe6deabf56844f2d698541 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 13:19:27 +0200 Subject: [PATCH 456/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6f72529bd..6f8dfeff0 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -462,7 +462,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); //if ( (price= ask) == 0. ) price = bid; - if ( qprice > price+0.00000001 ) + if ( SATOSHIDEN*qprice > SATOSHIDEN*price+1 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); LP_availableset(autxo); From b000af9d55e442d47ce892f1e4646086e53d2f72 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 13:22:16 +0200 Subject: [PATCH 457/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 6f8dfeff0..1b4d85148 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -462,7 +462,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); //if ( (price= ask) == 0. ) price = bid; - if ( SATOSHIDEN*qprice > SATOSHIDEN*price+1 ) + if ( SATOSHIDEN*qprice > SATOSHIDEN*price+10 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); LP_availableset(autxo); From 93891850376ac6c25ca4410e1c0b0a345efc303a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 13:31:05 +0200 Subject: [PATCH 458/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_ordermatch.c | 6 ++---- iguana/exchanges/LP_portfolio.c | 4 ++-- iguana/exchanges/LP_prices.c | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 2b570d600..c528514e0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -184,7 +184,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( duplicate != 0 ) dup++; else uniq++; - if ( (rand() % 100) == 0 ) + if ( (rand() % 1000) == 0 ) printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1); if ( duplicate == 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 1b4d85148..9d983512b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -471,7 +471,7 @@ char *LP_connectedalice(cJSON *argjson) // alice } if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { - LP_pendingswaps++; + LP_pendingswaps--; return(clonestr("{\"error\":\"cant get alicecoin\"}")); } Q.privkey = LP_privkey(Q.destaddr,coin->taddr); @@ -502,13 +502,12 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("connected result.(%s)\n",jprint(retjson,0)); if ( jobj(retjson,"error") != 0 ) LP_availableset(autxo); - else LP_pendingswaps--; + else LP_pendingswaps++; return(jprint(retjson,1)); } else { LP_availableset(autxo); - LP_pendingswaps--; printf("no privkey found\n"); return(clonestr("{\"error\",\"no privkey\"}")); } @@ -753,7 +752,6 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q } if ( aliceutxo->S.swap == 0 ) LP_availableset(aliceutxo); - else LP_pendingswaps++; return(jprint(bestitem,0)); } diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 36ce949ab..512b90ea4 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -343,7 +343,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp; if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 ) { - printf("error getting marketsummaries\n"); + printf("trex error getting marketsummaries\n"); sleep(60); return; } @@ -351,7 +351,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) free(retstr); if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 ) { - printf("error getting marketsummaries\n"); + printf("cryptopia error getting marketsummaries\n"); sleep(60); return; } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index bbd71582e..8e177e6e0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -833,7 +833,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } if ( (pubp= LP_pubkeyadd(pubkey)) != 0 ) { - if ( (rand() % 10) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) + if ( (rand() % 100) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL ) printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price); { pubp->matrix[basepp->ind][relpp->ind] = price; From 7c06e37be8c58b7f1eafdfe4d285babc5527e751 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 14:58:14 +0200 Subject: [PATCH 459/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_remember.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 512b90ea4..c6c89f3f9 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -427,7 +427,7 @@ void prices_loop(void *ignore) if ( LP_pricevalid(maxprice) > 0 ) { printf("pending.%d base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - if ( LP_pendingswaps == 0 ) + //if ( LP_pendingswaps == 0 ) { relvolume = sell->relvolume; for (iter=0; iter<3; iter++) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index dcb14fe7e..0accb65c5 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -823,7 +823,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti depositspent = txids[BASILISK_BOBREFUND]; } } - } else printf("time %u vs expiration %u\n",(uint32_t)time(NULL),expiration); + } else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),expiration); } } } From 043e9f93d22174f6384247d1ab5e9c8e1574c197 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:22:44 +0200 Subject: [PATCH 460/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c528514e0..b06da2a8b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -229,7 +229,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, } else { - printf("packet not for this node\n"); + printf("packet not for this node %u\n",crc32); } } else printf("error (%s) method is %s\n",jsonstr,method); } From 008899bc6048d3514afe8667e8949967e131a669 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:36:30 +0200 Subject: [PATCH 461/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- iguana/exchanges/LP_transaction.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9d983512b..98a2f6065 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -462,7 +462,7 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); //if ( (price= ask) == 0. ) price = bid; - if ( SATOSHIDEN*qprice > SATOSHIDEN*price+10 ) + if ( SATOSHIDEN*qprice > (SATOSHIDEN * price) * 1.001 + 10 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); LP_availableset(autxo); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 0f927d550..57f5e17cc 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1330,7 +1330,7 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d } if ( swap->myfee.I.datalen == 0 ) { - printf("generate fee\n"); + printf("generate fee %.8f\n",dstr(strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee)); bitcoin_address(coinaddr,swap->alicecoin.taddr,swap->alicecoin.pubtype,swap->changermd160,20); if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,0,swap->myfee.spendscript,swap->myfee.I.spendlen,strcmp(swap->myfee.coin->symbol,"BTC") == 0 ? LP_MIN_TXFEE : swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) { From 56da780709658fbee94e59ad8f762ab5b177769a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:37:36 +0200 Subject: [PATCH 462/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 98a2f6065..c7dd23c86 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -462,13 +462,13 @@ char *LP_connectedalice(cJSON *argjson) // alice printf("%s/%s bid %.8f ask %.8f\n",Q.srccoin,Q.destcoin,bid,ask); //if ( (price= ask) == 0. ) price = bid; - if ( SATOSHIDEN*qprice > (SATOSHIDEN * price) * 1.001 + 10 ) + /*if ( SATOSHIDEN*qprice > (SATOSHIDEN * price) * 1.001 + 10 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price); LP_availableset(autxo); LP_pendingswaps--; return(clonestr("{\"error\":\"quote price too expensive\"}")); - } + }*/ if ( (coin= LP_coinfind(Q.destcoin)) == 0 ) { LP_pendingswaps--; From d37d03990605d69bc037e8c0e672979de69ba033 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:37:56 +0200 Subject: [PATCH 463/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c7dd23c86..b8329ffd5 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -533,11 +533,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("quote validate error %.0f\n",qprice); return(-4); } - if ( qprice < (price - 0.00000001) * 0.9999 ) + /*if ( qprice < (price - 0.00000001) * 0.9999 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(-5); - } + }*/ if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) butxo->T.swappending = 0; if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's From af8a7301e6ae90a711c4bd49313a549274b04d37 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:38:31 +0200 Subject: [PATCH 464/682] Test --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b8329ffd5..c7dd23c86 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -533,11 +533,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, printf("quote validate error %.0f\n",qprice); return(-4); } - /*if ( qprice < (price - 0.00000001) * 0.9999 ) + if ( qprice < (price - 0.00000001) * 0.9999 ) { printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); return(-5); - }*/ + } if ( butxo->S.swap == 0 && time(NULL) > butxo->T.swappending ) butxo->T.swappending = 0; if ( strcmp(method,"request") == 0 ) // bob needs apayment + fee tx's From af016b986484de7a1628be51b623f01a39309015 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:40:21 +0200 Subject: [PATCH 465/682] Test --- iguana/exchanges/LP_transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 57f5e17cc..0d0dc4edd 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -704,6 +704,8 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub newtxfee = LP_txfeecalc(coin->symbol,0); printf("txfee %.8f -> newtxfee %.8f\n",dstr(txfee),dstr(newtxfee)); } else break; + if ( strcmp(str,"myfee") == 0 ) + break; } return(retval); } From cc850916289e69678916dc4ae9da6ca49d4a4875 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:42:48 +0200 Subject: [PATCH 466/682] Test --- iguana/exchanges/LP_transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 0d0dc4edd..b496db61e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -686,6 +686,8 @@ int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pub bitcoin_address(changeaddr,coin->taddr,coin->pubtype,changermd160,20); //printf("changeaddr.(%s) vs destaddr.(%s)\n",changeaddr,rawtx->I.destaddr); } + if ( strcmp(str,"myfee") == 0 && strcmp(coin->symbol,"BTC") == 0 ) + txfee = LP_MIN_TXFEE; for (iter=0; iter<2; iter++) { if ( (signedtx= basilisk_swap_bobtxspend(&rawtx->I.signedtxid,iter == 0 ? txfee : newtxfee,str,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->wiftype,ctx,privkey,0,0,0,0,0,rawtx->utxotxid,rawtx->utxovout,rawtx->I.destaddr,pubkey33,1,0,&destamount,rawtx->I.amount,changeaddr,vinaddr,rawtx->I.suppress_pubkeys)) != 0 ) From 46a2edc92ba319f02650c883ab01c1d4489ee542 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:51:32 +0200 Subject: [PATCH 467/682] Test --- iguana/exchanges/LP_ordermatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c7dd23c86..eb051e86b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -590,7 +590,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, for (i=0; i SMALLVAL && price <= maxprice ) + price = jdouble(item,"price"); + if ( LP_pricevalid(price) > 0 && price*1.0001 <= maxprice ) { price *= 1.0001; if ( price > maxprice ) From 36af4d34b5fa96393c3878b08555d2ac51f73aaa Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 15:54:13 +0200 Subject: [PATCH 468/682] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index eb051e86b..383f46a1d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -638,7 +638,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, bestmetric = metric; printf("set best!\n"); } - } else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); + } // else printf("skip.(%d %d %d %d %d) metric %f destsatoshis %.8f value %.8f destvalue %.8f txfees %.8f %.8f sats %.8f\n",metric < 1.2,destsatoshis > desttxfee,destsatoshis-desttxfee > (autxo->payment.value / LP_MINCLIENTVOL),satoshis-txfee > (butxo->S.satoshis / LP_MINVOL),satoshis < butxo->payment.value-txfee,metric,dstr(destsatoshis),dstr(butxo->S.satoshis),dstr(autxo->payment.value),dstr(txfee),dstr(desttxfee),dstr(satoshis)); } else { @@ -657,7 +657,8 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, } else { - printf("maxprice %.8f vs %.8f\n",maxprice,price); + if ( i == 0 ) + printf("maxprice %.8f vs %.8f\n",maxprice,price); break; } } From 8e389bbf15822c98898ce1700cebe4ea7ba948c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 16:04:19 +0200 Subject: [PATCH 469/682] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 383f46a1d..46b79b55a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -591,7 +591,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, { item = jitem(asks,i); price = jdouble(item,"price"); - if ( LP_pricevalid(price) > 0 && price*1.0001 <= maxprice ) + if ( LP_pricevalid(price) > 0 && price <= maxprice ) { price *= 1.0001; if ( price > maxprice ) From 78b4aa38ec99ec20404c576b7b0e33548d99b71d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 16:04:59 +0200 Subject: [PATCH 470/682] Test --- iguana/exchanges/LP_ordermatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 46b79b55a..e32930cda 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -593,9 +593,9 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, price = jdouble(item,"price"); if ( LP_pricevalid(price) > 0 && price <= maxprice ) { - price *= 1.0001; - if ( price > maxprice ) - price = maxprice; + //price *= 1.0001; + //if ( price > maxprice ) + // price = maxprice; pubkey = jbits256(item,"pubkey"); if ( bits256_cmp(pubkey,LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 && pubp->numerrors < LP_MAXPUBKEY_ERRORS ) { From 060121dc795028f4cdd2b5126a1db6e46dabaaa9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 17:38:09 +0200 Subject: [PATCH 471/682] Fix DOGE --- iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/coins | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b7fbceca3..48c0e9e7f 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -316,7 +316,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } } // else printf("no val2\n"); } - char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); + // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index ec5e3565d..aec28dcf8 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":10000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 48c6dec9e4211db997ae34a1db9e9a9fea5c7a0f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 18:07:41 +0200 Subject: [PATCH 472/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b06da2a8b..9473991fe 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -425,7 +425,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+600 ) + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+180 ) { printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); From 309e14bc3a838b1ee97825a88f2276b4ae03998c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:17:23 +0200 Subject: [PATCH 473/682] DOGE txfee fix --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index aec28dcf8..d45b24b12 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":10000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From b725a9d0eb544b5eaa2694a62b021b6735fd921d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:34:19 +0200 Subject: [PATCH 474/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 48c0e9e7f..03148459b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -845,7 +845,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr continue; targetval = (depositval / 9) * 8 + 100000; } - //printf("i.%d %.8f target %.8f\n",i,dstr(depositval),dstr(targetval)); + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 && iambob != 0 ) targetval /= 4; if ( iambob != 0 && targetval < txfee*LP_MINSIZE_TXFEEMULT ) From 08ff1fa5480097989afbee20e511c2b8e2746f1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:37:21 +0200 Subject: [PATCH 475/682] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 03148459b..911100dd7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -785,6 +785,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; + printf("%.8f ",dstr(dist)); if ( dist >= 0 && dist < mindist ) { mini = i; From 318b4cc717d79c873394bd1e27ba94b437608462 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:39:59 +0200 Subject: [PATCH 476/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 911100dd7..958583fec 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -785,7 +785,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("%.8f ",dstr(dist)); + printf("(%.8f %.8f).%d",dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; From 5843ba8c9c131507fc956bc7f8d88fb6bd8fb7ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:46:00 +0200 Subject: [PATCH 477/682] Test --- iguana/exchanges/LP_utxos.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 958583fec..232a88fd3 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -785,7 +785,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f).%d",dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f).%d",dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -847,10 +847,13 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr targetval = (depositval / 9) * 8 + 100000; } printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); - if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 && iambob != 0 ) - targetval /= 4; - if ( iambob != 0 && targetval < txfee*LP_MINSIZE_TXFEEMULT ) - continue; + if ( iambob != 0 ) + { + if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 ) + targetval /= 4; + if ( targetval < txfee*LP_MINSIZE_TXFEEMULT ) + continue; + } if ( (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { item = jitem(array,i); @@ -875,7 +878,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr } portable_mutex_unlock(&LP_UTXOmutex); total += value; - } + } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); } } else break; } From 471329b99a0793dcc44e663b1437d968134ce232 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 21:59:47 +0200 Subject: [PATCH 478/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 232a88fd3..0f9379eba 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -785,7 +785,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - //printf("(%.8f %.8f).%d",dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -879,7 +879,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } + } else printf("i.%d\n",i); } else break; } if ( iambob == 1 ) From 4d968fa8c206b327b9d4053b18cd9eb7ffad0f20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 22:03:21 +0200 Subject: [PATCH 479/682] Test --- iguana/exchanges/LP_utxos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 0f9379eba..fffb89196 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -544,7 +544,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit free_json(txobj); } if ( numconfirms <= 0 ) + { + printf("numconfirms.%d\n",numconfirms); return(0); + } numconfirms = -1; if ( (txobj= LP_gettx(symbol,txid2)) != 0 ) { @@ -552,7 +555,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit free_json(txobj); } if ( numconfirms <= 0 ) + { + printf("numconfirms.%d\n",numconfirms); return(0); + } if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; From 5d3737cc8ac96ec9b36f312117750145bb6fc895 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 22:09:37 +0200 Subject: [PATCH 480/682] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fffb89196..8ef71ca5e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -559,12 +559,13 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("numconfirms.%d\n",numconfirms); return(0); } + dispflag = 1; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,symbol,txid,vout,txid2,vout2)) >= 0 ) { - printf("utxoadd selector.%d in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); + printf("utxoadd selector.%d spent in mempool %s vini.%d",selector,bits256_str(str,spendtxid),spendvini); return(0); } if ( (utxo= LP_utxofinds(iambob,txid,vout,txid2,vout2)) != 0 ) From fbe7c63cff918abc51a6d190acb76d14d44dce09 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 22:16:27 +0200 Subject: [PATCH 481/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8ef71ca5e..4e1d3f894 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -828,7 +828,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { item = jitem(array,i); satoshis = SATOSHIDEN * jdouble(item,"amount"); - if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 ) + if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) values[i] = satoshis; else used++; //printf("%.8f ",dstr(satoshis)); From 3409a753e2ac8b2fa515aec920a8c27fbf9f9c76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 22:17:10 +0200 Subject: [PATCH 482/682] Test --- iguana/exchanges/LP_utxos.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4e1d3f894..ff37f8f6b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -559,7 +559,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("numconfirms.%d\n",numconfirms); return(0); } - dispflag = 1; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; @@ -792,7 +791,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -886,7 +885,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } else printf("i.%d\n",i); + } } else break; } if ( iambob == 1 ) From f886021e909e0fdd20c4ea1633563a221a87489b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 25 Jul 2017 22:22:25 +0200 Subject: [PATCH 483/682] Test --- iguana/exchanges/LP_utxos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index ff37f8f6b..97ad1ac5d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -852,7 +852,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr continue; targetval = (depositval / 9) * 8 + 100000; } - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); if ( iambob != 0 ) { if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 ) @@ -885,7 +885,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } + } } else break; } if ( iambob == 1 ) From dd0d65f48caca9ddfe1213eb6ce6c81e0f7761b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 10:57:57 +0200 Subject: [PATCH 484/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_utxos.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9473991fe..b02efedc4 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,11 +19,11 @@ // // new features: // stats +// PoW, JS // multidimensional portfolio, percentage among active vs all // autoutxo // bugs: -// getutxos lastn field // false detection of bobreclaim // unduplicated bugs: diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 97ad1ac5d..545d097de 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -317,7 +317,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - for (iter=0; iter<2; iter++) + /*for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { @@ -343,7 +343,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } - } + }*/ *valp = val; *val2p = val2; return(0); @@ -410,8 +410,8 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis) { if ( LP_iseligible(&srcvalue,&srcvalue2,utxo->iambob,symbol,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->fee.txid,utxo->fee.vout) == 0 ) { - if ( utxo->T.spentflag == 0 ) - utxo->T.spentflag = (uint32_t)time(NULL); + //if ( utxo->T.spentflag == 0 ) + // utxo->T.spentflag = (uint32_t)time(NULL); continue; } bestutxo = utxo; From 79b2ba1b2f4ddd8cb05ac3558201a3f6c00c6b7d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:04:56 +0200 Subject: [PATCH 485/682] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 545d097de..72ff5a91b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -288,7 +288,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,txfee,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct LP_utxoinfo *utxo; struct iguana_info *coin = LP_coinfind(symbol); + uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; @@ -559,6 +559,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("numconfirms.%d\n",numconfirms); return(0); } + dispflag = 1; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; From 75f6e4463462f8b3a65316447621b777ceb6d3d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:10:12 +0200 Subject: [PATCH 486/682] Test --- iguana/exchanges/LP_utxos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 72ff5a91b..f0e537ea5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -853,7 +853,8 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr continue; targetval = (depositval / 9) * 8 + 100000; } - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + i = -1; if ( iambob != 0 ) { if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 ) @@ -861,7 +862,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( targetval < txfee*LP_MINSIZE_TXFEEMULT ) continue; } - if ( (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) + if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) { item = jitem(array,i); txid = jbits256(item,"txid"); From 8945dd76517e8667e39288a6ba0a8b1e01cb7812 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:16:21 +0200 Subject: [PATCH 487/682] Test --- iguana/exchanges/LP_swap.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index a8ca0e1ae..e40160387 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -694,7 +694,7 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t void LP_bobloop(void *_swap) { - uint8_t *data; int32_t maxlen,n; uint32_t expiration; struct basilisk_swap *swap = _swap; + uint8_t *data; int32_t maxlen,m,n; uint32_t expiration; struct basilisk_swap *swap = _swap; fprintf(stderr,"start swap iambob\n"); maxlen = 1024*1024 + sizeof(*swap); data = malloc(maxlen); @@ -728,7 +728,10 @@ void LP_bobloop(void *_swap) printf("error bobscripts payment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < 1 ) // sync with alice + if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) + m = 0; + else m = 1; + while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < m ) // sync with alice { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(3); @@ -752,7 +755,7 @@ void LP_bobloop(void *_swap) void LP_aliceloop(void *_swap) { - uint8_t *data; int32_t maxlen,n; uint32_t expiration; struct basilisk_swap *swap = _swap; + uint8_t *data; int32_t maxlen,n,m; uint32_t expiration; struct basilisk_swap *swap = _swap; maxlen = 1024*1024 + sizeof(*swap); data = malloc(maxlen); expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT; @@ -778,7 +781,10 @@ void LP_aliceloop(void *_swap) printf("error sending alicepayment\n"); else { - while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < 1 ) + if ( strcmp(swap->alicecoin.symbol,"BTC") == 0 ) + m = 0; + else m = 1; + while ( (n= LP_numconfirms(swap,&swap->alicepayment,1)) < m ) { char str[65];printf("%d waiting for alicepayment to be confirmed.%d %s %s\n",n,1,swap->alicecoin.symbol,bits256_str(str,swap->alicepayment.I.signedtxid)); sleep(LP_SWAPSTEP_TIMEOUT); From 509785472b388c818d4eb0e3358cccd8fc01f6f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:36:17 +0200 Subject: [PATCH 488/682] Test --- iguana/exchanges/LP_utxos.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f0e537ea5..b6dff352e 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -519,7 +519,10 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit return(0); } if ( (coin= LP_coinfind(symbol)) == 0 || (IAMLP == 0 && coin->inactive != 0) ) + { + printf("LP_utxoadd reject inactive %s\n",symbol); return(0); + } if ( iambob != 0 && value2 < 9 * (value >> 3) + bigtxfee ) // big txfee padding { if ( value2 > bigtxfee+20000 ) @@ -545,7 +548,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - printf("numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); return(0); } numconfirms = -1; @@ -556,7 +559,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - printf("numconfirms.%d\n",numconfirms); + printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); } dispflag = 1; @@ -887,7 +890,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } + } else printf("nothing near i.%d\n",i); } else break; } if ( iambob == 1 ) From 32c78a02e17efb7ac5e899023bf1aac87b3ae122 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:39:35 +0200 Subject: [PATCH 489/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b6dff352e..2b0d55eb8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - //printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; From 333bb66c1e5b275c1d533395e5d874201cb56d9e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:44:49 +0200 Subject: [PATCH 490/682] Test --- iguana/exchanges/LP_utxos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 2b0d55eb8..5511fe6bf 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f).%d ",dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -831,6 +831,8 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { item = jitem(array,i); satoshis = SATOSHIDEN * jdouble(item,"amount"); + if ( satoshis == 0 ) + satoshis = SATOSHIDEN * jdouble(item,"value"); if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) values[i] = satoshis; else used++; From 3cf2c3ddc78b9047d862fe95bb6a01a685443640 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:48:05 +0200 Subject: [PATCH 491/682] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5511fe6bf..f083488c1 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -837,6 +837,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr values[i] = satoshis; else used++; //printf("%.8f ",dstr(satoshis)); + printf("%s\n",jprint(item,0)); } //printf("array.%d\n",n); while ( used < n-1 ) From cefafbb3e5bc9584546b07380dadda8bf626499a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 11:53:59 +0200 Subject: [PATCH 492/682] Test --- iguana/exchanges/LP_utxos.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f083488c1..6e22b1af5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -834,15 +834,18 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr if ( satoshis == 0 ) satoshis = SATOSHIDEN * jdouble(item,"value"); if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) + { + printf("%s\n",jprint(item,0)); values[i] = satoshis; - else used++; + } else used++; //printf("%.8f ",dstr(satoshis)); - printf("%s\n",jprint(item,0)); } //printf("array.%d\n",n); while ( used < n-1 ) { - //printf("used.%d of n.%d\n",used,n); + for (i=0; i= 0 ) { item = jitem(array,i); From 4505bbf3dd7e5d9336ea7607ce20f9e4e115a69b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 12:54:22 +0200 Subject: [PATCH 493/682] Test --- iguana/exchanges/LP_utxos.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6e22b1af5..fc7f65b5a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -855,14 +855,11 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr depositval = values[i]; values[i] = 0, used++; if ( iambob == 0 ) - targetval = (depositval / 776) + 100000; - else - { - if ( depositval < LP_MINSIZE_TXFEEMULT*txfee ) - continue; - targetval = (depositval / 9) * 8 + 100000; - } - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + targetval = (depositval / 776) + txfee; + else targetval = (depositval / 9) * 8 + txfee; + if ( depositval < LP_MINSIZE_TXFEEMULT*txfee && targetval < LP_MINSIZE_TXFEEMULT*txfee ) + continue; + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 842bfc77e0bf02676548bda19edc6f9c7b87992d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 12:54:42 +0200 Subject: [PATCH 494/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index fc7f65b5a..81632df40 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -843,9 +843,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); From a05a2a03865d580a00dbb2901559ed45d1cd8355 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 12:55:58 +0200 Subject: [PATCH 495/682] Test --- iguana/exchanges/LP_utxos.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 81632df40..e55dbaf89 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -512,7 +512,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) { - uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; cJSON *txobj; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; + uint64_t val,val2=0,tmpsatoshis,txfee; cJSON *txobj; int32_t spendvini,numconfirms,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 || sessionid == 0 ) { printf("session.%u malformed addutxo %d %d %d %d %d %d %d %d %d\n",sessionid,symbol == 0,spendscript == 0,coinaddr == 0,bits256_nonz(txid) == 0,bits256_nonz(txid2) == 0,vout < 0,vout2 < 0,value <= 0,value2 <= 0); @@ -523,10 +523,11 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("LP_utxoadd reject inactive %s\n",symbol); return(0); } - if ( iambob != 0 && value2 < 9 * (value >> 3) + bigtxfee ) // big txfee padding + txfee = LP_txfeecalc(coin->symbol,0); + if ( iambob != 0 && value2 < 9 * (value >> 3) + txfee ) // big txfee padding { - if ( value2 > bigtxfee+20000 ) - tmpsatoshis = (((value2 - bigtxfee) / 9) << 3); + if ( value2 > txfee ) + tmpsatoshis = (((value2 - txfee) / 9) << 3); else return(0); } else tmpsatoshis = value; char str[65],str2[65],dispflag = (iambob == 0); From 347506967ca2d142b4b4d8305c518afb04b3f658 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 12:56:20 +0200 Subject: [PATCH 496/682] Test --- iguana/exchanges/LP_utxos.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index e55dbaf89..58e2a0770 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -563,7 +563,6 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit printf("LP_utxoadd reject2 numconfirms.%d\n",numconfirms); return(0); } - dispflag = 1; if ( dispflag != 0 ) printf("%.8f %.8f %s iambob.%d %s utxoadd.(%.8f %.8f) %s %s\n",dstr(val),dstr(val2),coinaddr,iambob,symbol,dstr(value),dstr(value2),bits256_str(str,txid),bits256_str(str2,txid2)); dispflag = 1; @@ -894,7 +893,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } else printf("nothing near i.%d\n",i); + } //else printf("nothing near i.%d\n",i); } else break; } if ( iambob == 1 ) From 60427508900aa9ad8671a813af21b962ca267063 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 13:02:14 +0200 Subject: [PATCH 497/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 58e2a0770..712ae8b85 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -835,7 +835,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr satoshis = SATOSHIDEN * jdouble(item,"value"); if ( LP_inventory_prevent(iambob,jbits256(item,"txid"),juint(item,"vout")) == 0 && jint(item,"confirmations") > 0 ) { - printf("%s\n",jprint(item,0)); + //printf("%s\n",jprint(item,0)); values[i] = satoshis; } else used++; //printf("%.8f ",dstr(satoshis)); From b2f93f57954c4f6e421214362d2318fb97e867df Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 13:09:02 +0200 Subject: [PATCH 498/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c6c89f3f9..2d0124d4e 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -430,7 +430,7 @@ void prices_loop(void *ignore) //if ( LP_pendingswaps == 0 ) { relvolume = sell->relvolume; - for (iter=0; iter<3; iter++) + for (iter=0; iter<2; iter++) { if ( relvolume < dstr(LP_MIN_TXFEE) ) break; From 269c2720f3a5bc5236392cb0b30baae043e4df2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 13:31:43 +0200 Subject: [PATCH 499/682] Test --- iguana/exchanges/LP_remember.c | 23 ++++++++++++++++++++--- iguana/exchanges/LP_scan.c | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 0accb65c5..9d8a60c3e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -395,10 +395,13 @@ uint32_t LP_extract(uint32_t requestid,uint32_t quoteid,char *rootfname,char *fi cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid) { static void *ctx; - FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee=0,Btxfee=0; + FILE *fp; int32_t sentflags[sizeof(txnames)/sizeof(*txnames)],i,n,j,Predeemlen,Dredeemlen,len,needflag,secretstart,redeemlen,addflag,origfinishedflag = 0,finishedflag = 0,iambob = -1; int64_t srcamount,destamount=0,value,values[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],pubkey33[33],Predeemscript[1024],Dredeemscript[1024],redeemscript[1024],userdata[1024]; uint32_t plocktime,dlocktime,expiration=0,r,q,state,otherstate; char *secretstr,*srcstr,*deststr,str[65],src[64],dest[64],fname[512],*fstr,*dest33,*rstr,*symbol,*txname,*Adest,*Bdest,*AAdest,*ABdest,destaddr[64],Adestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; long fsize; cJSON *txobj,*item,*sentobj,*array; bits256 checktxid,txid,pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,zero,privkey,rev,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)],signedtxid; struct iguana_info *bob=0,*alice=0; uint64_t Atxfee=0,Btxfee=0; if ( ctx == 0 ) ctx = bitcoin_ctx(); bobpaymentaddr[0] = bobdepositaddr[0] = alicepaymentaddr[0] = 0; + memset(Predeemscript,0,sizeof(Predeemscript)); + memset(Dredeemscript,0,sizeof(Dredeemscript)); + Predeemlen = Dredeemlen = 0; memset(values,0,sizeof(values)); memset(txids,0,sizeof(txids)); memset(secretAm,0,sizeof(secretAm)); @@ -550,6 +553,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti txbytes[i] = clonestr(jstr(txobj,"tx")); //printf("[%s] TX.(%s)\n",txnames[i],txbytes[i]); } + if ( strcmp(txnames[i],"bobpayment") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (Predeemlen= is_hexstr(rstr,0)) > 0 ) + { + Predeemlen >>= 1; + decode_hex(Predeemscript,Predeemlen,rstr); + } + else if ( strcmp(txnames[i],"bobdeposit") == 0 && (rstr= jstr(txobj,"redeem")) != 0 && (Dredeemlen= is_hexstr(rstr,0)) > 0 ) + { + Dredeemlen >>= 1; + decode_hex(Dredeemscript,Dredeemlen,rstr); + } if ( (value= jdouble(txobj,"amount") * SATOSHIDEN) == 0 ) value = jdouble(txobj,"value") * SATOSHIDEN; values[i] = value; @@ -670,7 +683,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti rev.bytes[j] = privAm.bytes[31 - j]; //revcalc_rmd160_sha256(secretAm,rev);//privAm); //vcalc_sha256(0,secretAm256,rev.bytes,sizeof(rev)); - redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,plocktime,pubA0,pubB0,pubB1,rev,privBn,secretAm,secretAm256,secretBn,secretBn256); + if ( Predeemlen != 0 ) + redeemlen = Predeemlen, memcpy(redeemscript,Predeem,Predeemlen); + else redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,plocktime,pubA0,pubB0,pubB1,rev,privBn,secretAm,secretAm256,secretBn,secretBn256); len = basilisk_swapuserdata(userdata,rev,0,myprivs[0],redeemscript,redeemlen); { char privaddr[64]; uint8_t privpub33[33]; @@ -701,7 +716,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti { //if ( txbytes[BASILISK_ALICECLAIM] == 0 ) { - redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,zero,secretAm,secretAm256,secretBn,secretBn256); + if ( Dredeemlen != 0 ) + redeemlen = Dredeemlen, memcpy(redeemscript,Dredeem,Dredeemlen); + else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,zero,secretAm,secretAm256,secretBn,secretBn256); if ( redeemlen > 0 ) { len = basilisk_swapuserdata(userdata,zero,1,myprivs[0],redeemscript,redeemlen); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cc712e78e..045d4092e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -222,7 +222,7 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) { if ( bits256_nonz(tx->outpoints[vout].spendtxid) != 0 ) { - char str[65]; printf("%s/v%d is spent\n",bits256_str(str,txid),vout); + //char str[65]; printf("%s/v%d is spent\n",bits256_str(str,txid),vout); return(0); } else From 22b5bfaaa10fa61ef442e135c1534abd4040a665 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 13:33:28 +0200 Subject: [PATCH 500/682] Test --- iguana/exchanges/LP_remember.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 9d8a60c3e..bcdeef1d1 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -684,7 +684,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti //revcalc_rmd160_sha256(secretAm,rev);//privAm); //vcalc_sha256(0,secretAm256,rev.bytes,sizeof(rev)); if ( Predeemlen != 0 ) - redeemlen = Predeemlen, memcpy(redeemscript,Predeem,Predeemlen); + redeemlen = Predeemlen, memcpy(redeemscript,Predeemscript,Predeemlen); else redeemlen = basilisk_swap_bobredeemscript(0,&secretstart,redeemscript,plocktime,pubA0,pubB0,pubB1,rev,privBn,secretAm,secretAm256,secretBn,secretBn256); len = basilisk_swapuserdata(userdata,rev,0,myprivs[0],redeemscript,redeemlen); { @@ -717,7 +717,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti //if ( txbytes[BASILISK_ALICECLAIM] == 0 ) { if ( Dredeemlen != 0 ) - redeemlen = Dredeemlen, memcpy(redeemscript,Dredeem,Dredeemlen); + redeemlen = Dredeemlen, memcpy(redeemscript,Dredeemscript,Dredeemlen); else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,dlocktime,pubA0,pubB0,pubB1,privAm,zero,secretAm,secretAm256,secretBn,secretBn256); if ( redeemlen > 0 ) { From fee627722843a6ef4250d27a72d4780c5f4cb817 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 13:55:04 +0200 Subject: [PATCH 501/682] Test --- iguana/exchanges/LP_remember.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index bcdeef1d1..4da5bc234 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -264,12 +264,14 @@ bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids { //printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[alicespent] = 1; + sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } else if ( bobaddr != 0 && strcmp(destaddr,bobaddr) == 0 ) { //printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr); sentflags[bobspent] = 1; + sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } else @@ -278,11 +280,13 @@ bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids if ( aliceaddr != 0 ) { sentflags[bobspent] = 1; + sentflags[alicespent] = 0; txids[bobspent] = spendtxid; } else if ( bobaddr != 0 ) { sentflags[alicespent] = 1; + sentflags[bobspent] = 0; txids[alicespent] = spendtxid; } } From 1715c5b409dedf45bac15f8a00cd5d1416be33a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 14:11:17 +0200 Subject: [PATCH 502/682] Test --- iguana/exchanges/LP_portfolio.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2d0124d4e..2dd82b5ff 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -47,8 +47,23 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) { - cJSON *array,*item; int32_t i,n; uint64_t valuesum,satoshisum; + cJSON *array,*item; int32_t i,n; uint64_t valuesum,satoshisum,value; valuesum = satoshisum = 0; + if ( (array= LP_listunspent(symbol,coinaddr)) != 0 ) + { + if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i 0 && is_cJSON_Array(array) != 0 ) @@ -56,7 +71,7 @@ uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr) for (i=0; i Date: Wed, 26 Jul 2017 15:38:51 +0200 Subject: [PATCH 503/682] Test --- crypto777/OS_portable.h | 2 + crypto777/iguana_utils.c | 33 +++++-- iguana/exchanges/LP_portfolio.c | 151 ++++++++++++++++++++++++-------- 3 files changed, 141 insertions(+), 45 deletions(-) diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 5229414a6..84ba44794 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -198,6 +198,8 @@ int32_t OS_nonportable_init(); void OS_portable_init(); void OS_init(); +int32_t sortds(double *buf,uint32_t num,int32_t size); +int32_t revsortds(double *buf,uint32_t num,int32_t size); double OS_portable_milliseconds(); void OS_portable_randombytes(uint8_t *x,long xlen); diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 47ab6f5a4..2d3ba301c 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -522,11 +522,24 @@ static int _increasing_double(const void *a,const void *b) { #define double_a (*(double *)a) #define double_b (*(double *)b) - if ( double_b > double_a ) - return(-1); - else if ( double_b < double_a ) - return(1); - return(0); + if ( double_b > double_a ) + return(-1); + else if ( double_b < double_a ) + return(1); + return(0); +#undef double_a +#undef double_b +} + +static int _decreasing_double(const void *a,const void *b) +{ +#define double_a (*(double *)a) +#define double_b (*(double *)b) + if ( double_b > double_a ) + return(1); + else if ( double_b < double_a ) + return(-1); + return(0); #undef double_a #undef double_b } @@ -572,8 +585,14 @@ static int _decreasing_uint32(const void *a,const void *b) int32_t sortds(double *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_increasing_double); - return(0); + qsort(buf,num,size,_increasing_double); + return(0); +} + +int32_t refsortds(double *buf,uint32_t num,int32_t size) +{ + qsort(buf,num,size,_decreasing_double); + return(0); } int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 2dd82b5ff..231f9b8f6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -416,9 +416,111 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) } } +int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,struct iguana_info *buy,struct iguana_info *sell,double relvolume,int32_t setbaserel) +{ + char *retstr2; double bid,ask,maxprice; uint32_t requestid,quoteid,iter; cJSON *retjson2; + requestid = quoteid = 0; + LP_myprice(&bid,&ask,buy->symbol,sell->symbol); + maxprice = ask; + if ( setbaserel != 0 ) + { + strcpy(LP_portfolio_base,""); + strcpy(LP_portfolio_rel,""); + LP_portfolio_relvolume = 0.; + } + if ( LP_pricevalid(maxprice) > 0 ) + { + printf("pending.%d base buy.%s, rel sell.%s relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buy->symbol,sell->symbol,sell->relvolume,maxprice,bid,ask); + relvolume = sell->relvolume; + for (iter=0; iter<3; iter++) + { + if ( relvolume < dstr(LP_MIN_TXFEE) ) + break; + if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) + { + if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600)) != 0 ) + { + if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) + { + if ( (requestid= juint(retjson2,"requestid")) != 0 && (quoteid= juint(retjson2,"quoteid")) != 0 ) + { + + } + free_json(retjson2); + } + printf("%s relvolume %.8f LP_autotrade.(%s)\n",sell->symbol,relvolume,retstr2); + free(retstr2); + } + if ( requestid != 0 && quoteid != 0 ) + break; + } else printf("cant find alice %.8f %s\n",relvolume,sell->symbol); + relvolume /= 3.; + } + } + else if ( setbaserel != 0 ) + { + strcpy(LP_portfolio_base,buy->symbol); + strcpy(LP_portfolio_rel,sell->symbol); + LP_portfolio_relvolume = sell->relvolume; + } + *requestidp = requestid; + *quoteidp = quoteid; + if ( requestid != 0 && quoteid != 0 ) + return(0); + else return(-1); +} + +struct LP_portfoliotrade { double metric; char buycoin[16],sellcoin[16]; }; + +int32_t LP_portfolio_order(struct LP_portfoliotrade *trades,int32_t max,cJSON *array) +{ + int32_t i,j,m,n = 0; cJSON *item; struct LP_portfoliotrade coins[256]; + memset(coins,0,sizeof(coins)); + if ( (m= cJSON_GetArraySize(array)) > 0 ) + { + for (i=j=0; i SMALLVAL && coins[j].buycoin[0] != 0 ) + j++; + } + if ( (m= j) > 1 ) + { + for (i=n=0; i 0. ) + { + trades[n].metric = (coins[i].metric - coins[j].metric); + strcpy(trades[n].buycoin,coins[i].buycoin); + strcpy(trades[n].sellcoin,coins[j].buycoin); + printf("buy %s %f, sell %s %f -> %f\n",trades[n].buycoin,coins[i].metric,trades[n].sellcoin,coins[j].metric,trades[n].metric); + } + else + { + trades[n].metric = (coins[j].metric - coins[i].metric); + strcpy(trades[n].buycoin,coins[j].buycoin); + strcpy(trades[n].sellcoin,coins[i].buycoin); + printf("buy %s %f, sell %s %f -> %f\n",trades[n].buycoin,coins[j].metric,trades[n].sellcoin,coins[i].metric,trades[n].metric); + } + n++; + if ( n >= max ) + break; + } + revsortds((void *)trades,n,sizeof(*trades)); + for (i=0; i %f\n",i,trades[i].buycoin,trades[i].sellcoin,trades[i].metric); + } + } + return(n); +} + void prices_loop(void *ignore) { - char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid,iter; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); + char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); while ( 1 ) { if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) @@ -434,51 +536,24 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 && buy->inactive == 0 && sell->inactive == 0 ) { - LP_myprice(&bid,&ask,buycoin,sellcoin); - maxprice = ask; - strcpy(LP_portfolio_base,""); - strcpy(LP_portfolio_rel,""); - LP_portfolio_relvolume = 0.; - if ( LP_pricevalid(maxprice) > 0 ) + if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) { - printf("pending.%d base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); - //if ( LP_pendingswaps == 0 ) + array = jarray(&m,retjson,"portfolio"); + if ( array != 0 && (n= LP_portfolio_order(trades,(int32_t)(sizeof(trades)/sizeof(*trades)),array)) > 0 ) { - relvolume = sell->relvolume; - for (iter=0; iter<2; iter++) + for (i=0; irelvolume,0) == 0 ) break; - } else printf("cant find alice %.8f %s\n",relvolume,sellcoin); - relvolume *= 0.1; + } } } } - else - { - strcpy(LP_portfolio_base,buycoin); - strcpy(LP_portfolio_rel,sellcoin); - LP_portfolio_relvolume = sell->relvolume; - } - } //else printf("buy or sell missing.(%s)\n",jprint(retjson,0)); + } free_json(retjson); } free(retstr); From 37d24e8f2554674e9168e934db60327a3d70738d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 15:42:21 +0200 Subject: [PATCH 504/682] Test --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 2d3ba301c..985a13789 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -589,7 +589,7 @@ int32_t sortds(double *buf,uint32_t num,int32_t size) return(0); } -int32_t refsortds(double *buf,uint32_t num,int32_t size) +int32_t revsortds(double *buf,uint32_t num,int32_t size) { qsort(buf,num,size,_decreasing_double); return(0); From a018b284d278d3d0152bca6c112a715411d9015c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 15:48:29 +0200 Subject: [PATCH 505/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +-- iguana/exchanges/LP_portfolio.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b02efedc4..8fa4fb132 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,7 +20,6 @@ // new features: // stats // PoW, JS -// multidimensional portfolio, percentage among active vs all // autoutxo // bugs: @@ -491,7 +490,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int coin->lastscanht = coin->firstscanht; continue; } - printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); if ( LP_blockinit(coin,coin->lastscanht) < 0 ) { printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 231f9b8f6..03f42e383 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -536,7 +536,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 && buy->inactive == 0 && sell->inactive == 0 ) { - if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) + //if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) { array = jarray(&m,retjson,"portfolio"); if ( array != 0 && (n= LP_portfolio_order(trades,(int32_t)(sizeof(trades)/sizeof(*trades)),array)) > 0 ) From bf63e0acc798a5cfa5de2ca1d4cd7e7c6307af2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 15:58:22 +0200 Subject: [PATCH 506/682] Test --- iguana/exchanges/LP_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 5a39285aa..38fac9e0c 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -140,7 +140,7 @@ void queue_loop(void *ignore) } else { - printf("couldnt find.%u (%s) peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,(char *)ptr->msg,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); + printf("couldnt find.%u peerind.%d Q.%d err.%d match.%d\n",ptr->crc32,ptr->peerind,LP_Qenqueued,LP_Qerrors,LP_Qfound); ptr->peerind++; if ( (ptr->sock= LP_peerindsock(&ptr->peerind)) < 0 ) { From 7e9b0fbfb14d737c56750d8cbae32b242308e975 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 16:01:57 +0200 Subject: [PATCH 507/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 03f42e383..231f9b8f6 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -536,7 +536,7 @@ void prices_loop(void *ignore) { if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 && buy->inactive == 0 && sell->inactive == 0 ) { - //if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) + if ( LP_portfolio_trade(ctx,&requestid,"eid,buy,sell,sell->relvolume,1) < 0 ) { array = jarray(&m,retjson,"portfolio"); if ( array != 0 && (n= LP_portfolio_order(trades,(int32_t)(sizeof(trades)/sizeof(*trades)),array)) > 0 ) From 13e1905241be1f1a19ab065bdddacbe557c75d98 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 16:07:29 +0200 Subject: [PATCH 508/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 992e36e19..48ba2d224 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -260,7 +260,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 ) + if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"BCC") == 0 ) { coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8fa4fb132..906b35ed6 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,6 +13,7 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ + // // LP_nativeDEX.c // marketmaker @@ -22,9 +23,6 @@ // PoW, JS // autoutxo -// bugs: -// false detection of bobreclaim - // unduplicated bugs: // swap cancel should cleanly cancel From b3100c05fb01d7b60df30984cb05183c166561fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 16:21:41 +0200 Subject: [PATCH 509/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 231f9b8f6..6d96799d9 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -428,9 +428,9 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str strcpy(LP_portfolio_rel,""); LP_portfolio_relvolume = 0.; } + printf("pending.%d base buy.%s, rel sell.%s relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buy->symbol,sell->symbol,sell->relvolume,maxprice,bid,ask); if ( LP_pricevalid(maxprice) > 0 ) { - printf("pending.%d base buy.%s, rel sell.%s relvolume %f maxprice %.8f (%.8f %.8f)\n",LP_pendingswaps,buy->symbol,sell->symbol,sell->relvolume,maxprice,bid,ask); relvolume = sell->relvolume; for (iter=0; iter<3; iter++) { From 018cfbd35c38f9d541db5f1194f109817a49102b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 16:34:23 +0200 Subject: [PATCH 510/682] Fix revsortds --- iguana/exchanges/LP_commands.c | 2 +- iguana/iguana777.c | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 1a98996a2..3e6486f70 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -97,7 +97,7 @@ available localhost RPC commands:\n \ pricearray(base, rel, firsttime=0, lasttime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ setprice(base, rel, price)\n\ autoprice(base, rel, price, margin, type)\n\ -goal(coin=*, perc=)\n\ +goal(coin=*, val=)\n\ myprice(base, rel)\n\ enable(coin)\n\ disable(coin)\n\ diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 50bcb42fd..d998b4b81 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -105,25 +105,6 @@ void iguana_recvalloc(struct iguana_info *coin,int32_t numitems) //coin->blocks.maxbits = numitems; } -static int _decreasing_double(const void *a,const void *b) -{ -#define double_a (*(double *)a) -#define double_b (*(double *)b) - if ( double_b > double_a ) - return(1); - else if ( double_b < double_a ) - return(-1); - return(0); -#undef double_a -#undef double_b -} - -static int32_t revsortds(double *buf,uint32_t num,int32_t size) -{ - qsort(buf,num,size,_decreasing_double); - return(0); -} - double iguana_metric(struct iguana_peer *addr,uint32_t now,double decay) { int32_t duration; double metric = addr->recvblocks * addr->recvtotal; From 24b7e2ec95770d9dea9f790975b220daf1ed7f5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 16:53:50 +0200 Subject: [PATCH 511/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 712ae8b85..f60ab1230 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -288,7 +288,7 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + struct LP_utxoinfo *utxo; uint64_t val,val2=0,txfee,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; @@ -296,7 +296,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); txfee = LP_txfeecalc(symbol,0); - if ( val >= satoshis && val > 10*txfee ) + if ( val >= satoshis && val > LP_MINSIZE_TXFEEMULT*txfee ) { threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : LP_DEXFEE(satoshis); if ( bypass != 0 ) @@ -317,7 +317,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - /*for (iter=0; iter<2; iter++) + for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { @@ -343,7 +343,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } - }*/ + } *valp = val; *val2p = val2; return(0); From 1322c6144f682f6b38005d826b649d0cfb9ddd61 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 17:10:17 +0200 Subject: [PATCH 512/682] Test --- iguana/exchanges/LP_utxos.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f60ab1230..60da4eae8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -296,9 +296,9 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol val = satoshis; else val = LP_txvalue(destaddr,symbol,txid,vout); txfee = LP_txfeecalc(symbol,0); - if ( val >= satoshis && val > LP_MINSIZE_TXFEEMULT*txfee ) + if ( val >= satoshis && val > (1+LP_MINSIZE_TXFEEMULT)*txfee ) { - threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : LP_DEXFEE(satoshis); + threshold = (iambob != 0) ? LP_DEPOSITSATOSHIS(satoshis) : (LP_DEXFEE(satoshis) + txfee); if ( bypass != 0 ) val2 = threshold; else val2 = LP_txvalue(destaddr2,symbol,txid2,vout2); @@ -524,12 +524,12 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit return(0); } txfee = LP_txfeecalc(coin->symbol,0); - if ( iambob != 0 && value2 < 9 * (value >> 3) + txfee ) // big txfee padding + if ( iambob != 0 && value2 < 9 * (value >> 3) + 2*txfee ) // big txfee padding { - if ( value2 > txfee ) - tmpsatoshis = (((value2 - txfee) / 9) << 3); + if ( value2 > 2*txfee ) + tmpsatoshis = (((value2 - 2*txfee) / 9) << 3); else return(0); - } else tmpsatoshis = value; + } else tmpsatoshis = (value - txfee); char str[65],str2[65],dispflag = (iambob == 0); if ( iambob == 0 && bits256_cmp(pubkey,LP_mypub25519) != 0 ) { @@ -855,9 +855,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr depositval = values[i]; values[i] = 0, used++; if ( iambob == 0 ) - targetval = (depositval / 776) + txfee; - else targetval = (depositval / 9) * 8 + txfee; - if ( depositval < LP_MINSIZE_TXFEEMULT*txfee && targetval < LP_MINSIZE_TXFEEMULT*txfee ) + targetval = (depositval / 776) + 2*txfee; + else targetval = (depositval / 9) * 8 + 2*txfee; + if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee && targetval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; @@ -865,7 +865,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr { if ( (i= LP_nearestvalue(iambob,values,n,targetval)) < 0 ) targetval /= 4; - if ( targetval < txfee*LP_MINSIZE_TXFEEMULT ) + if ( targetval < txfee*(1+LP_MINSIZE_TXFEEMULT) ) continue; } if ( i >= 0 || (i= LP_nearestvalue(iambob,values,n,targetval)) >= 0 ) From f32a3ba1f05e4080da5d1ea411245d738ac592bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 19:04:08 +0200 Subject: [PATCH 513/682] Test --- iguana/exchanges/LP_portfolio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 6d96799d9..7ad7b8c85 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -40,6 +40,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA); jaddnum(item,"balanceB",dstr(coin->balanceB)); jaddnum(item,"valuesumB",dstr(coin->valuesumB)); + jaddnum(item,"balance",dstr(coin->maxamount)); if ( coin->valuesumB != 0 ) jaddnum(item,"bobutil",100. * (double)coin->balanceB/coin->valuesumB); return(item); From 0c3b3d45a9abca57079201ab028505b79a845fc6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 19:38:52 +0200 Subject: [PATCH 514/682] Test --- iguana/exchanges/LP_nativeDEX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 906b35ed6..6f7d89b48 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -372,7 +372,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( peer->errors >= LP_MAXPEER_ERRORS ) { if ( (rand() % 10000) == 0 ) + { peer->errors--; + peer->diduquery = 0; + } if ( IAMLP == 0 ) continue; } From a20368c3227fcd7a5f891a5ba7493982c8faa8fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 19:47:27 +0200 Subject: [PATCH 515/682] Test --- iguana/exchanges/LP_coins.c | 18 +++++++++++++----- iguana/exchanges/LP_commands.c | 8 ++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 48ba2d224..6dcfc6951 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -170,10 +170,18 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c return(-1); } -cJSON *LP_coinjson(struct iguana_info *coin) +cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { - cJSON *item = cJSON_CreateObject(); + char wifstr[128]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); + if ( showwif != 0 ) + { + bitcoin_priv2wif(coin->wiftaddr,wifstr,LP_mypriv25519,coin->wiftype); + bitcoin_wif2priv(coin->wiftaddr,&tmptype,&checkkey,wifstr); + if ( bits256_cmp(LP_mypriv25519,checkkey) == 0 ) + jaddstr(item,"wif",wifstr); + else jaddstr(item,"wif","error creating wif"); + } if ( coin->inactive != 0 ) jaddstr(item,"status","inactive"); else jaddstr(item,"status","active"); @@ -188,12 +196,12 @@ cJSON *LP_coinjson(struct iguana_info *coin) return(item); } -cJSON *LP_coinsjson() +cJSON *LP_coinsjson(int32_t showwif) { struct iguana_info *coin,*tmp; cJSON *array = cJSON_CreateArray(); HASH_ITER(hh,LP_coins,coin,tmp) { - jaddi(array,LP_coinjson(coin)); + jaddi(array,LP_coinjson(coin,showwif)); } return(array); } @@ -206,7 +214,7 @@ char *LP_getcoin(char *symbol) HASH_ITER(hh,LP_coins,coin,tmp) { if ( strcmp(symbol,coin->symbol) == 0 ) - item = LP_coinjson(coin); + item = LP_coinjson(coin,0); if ( coin->inactive == 0 ) numenabled++; else numdisabled++; diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3e6486f70..53d9760a4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -133,7 +133,7 @@ trust(pubkey, trust)\n\ retjson = cJSON_CreateObject(); jaddstr(retjson,"userpass",USERPASS); jaddbits256(retjson,"mypubkey",LP_mypub25519); - jadd(retjson,"coins",LP_coinsjson()); + jadd(retjson,"coins",LP_coinsjson(1)); return(jprint(retjson,1)); } if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,USERPASS) != 0 ) @@ -238,13 +238,13 @@ trust(pubkey, trust)\n\ { if ( (ptr= LP_coinsearch(coin)) != 0 ) ptr->inactive = 0; - return(jprint(LP_coinsjson(),1)); + return(jprint(LP_coinsjson(0),1)); } else if ( strcmp(method,"disable") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) ptr->inactive = (uint32_t)time(NULL); - return(jprint(LP_coinsjson(),1)); + return(jprint(LP_coinsjson(0),1)); } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); @@ -309,7 +309,7 @@ trust(pubkey, trust)\n\ else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); else if ( strcmp(method,"getcoins") == 0 ) - return(jprint(LP_coinsjson(),1)); + return(jprint(LP_coinsjson(0),1)); else if ( strcmp(method,"numutxos") == 0 ) return(LP_numutxos()); else if ( strcmp(method,"postprice") == 0 ) From 0fe2369b7deafa544396cc886978486a45cf6e01 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 19:51:26 +0200 Subject: [PATCH 516/682] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 53d9760a4..7af18862c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -133,7 +133,7 @@ trust(pubkey, trust)\n\ retjson = cJSON_CreateObject(); jaddstr(retjson,"userpass",USERPASS); jaddbits256(retjson,"mypubkey",LP_mypub25519); - jadd(retjson,"coins",LP_coinsjson(1)); + jadd(retjson,"coins",LP_coinsjson(LP_showwif)); return(jprint(retjson,1)); } if ( (userpass= jstr(argjson,"userpass")) == 0 || strcmp(userpass,USERPASS) != 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6f7d89b48..65b8271c5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -49,7 +49,7 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; -int32_t LP_pendingswaps,USERPASS_COUNTER,IAMLP = 0; +int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; bits256 LP_mypub25519,LP_mypriv25519; @@ -578,6 +578,7 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128]; void *ctx = bitcoin_ctx(); + LP_showwif = juint(argjson,"wif"); if ( passphrase == 0 || passphrase[0] == 0 ) { printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); From 52c9bf1c904a0e1aea8cc5802800d18df42f6af6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 19:53:05 +0200 Subject: [PATCH 517/682] Test --- iguana/exchanges/LP_remember.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 4da5bc234..1399aab8d 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -535,7 +535,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti sprintf(fname,"%s/SWAPS/%u-%u.%s",GLOBAL_DBDIR,requestid,quoteid,txnames[i]), OS_compatible_path(fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) { - if ( finishedflag == 0 ) + if ( 0 && finishedflag == 0 ) printf("%s\n",fname); //printf("%s -> (%s)\n",fname,fstr); if ( (txobj= cJSON_Parse(fstr)) != 0 ) @@ -600,12 +600,13 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } free_json(sentobj); } - printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); + if ( 0 && finishedflag == 0 ) + printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } } //else printf("no symbol\n"); free(fstr); - } else if ( finishedflag == 0 ) + } else if ( 0 && finishedflag == 0 ) printf("%s not finished\n",fname); } //printf("alicepayment.%s bobpayment.%s bobdeposit.%s\n",alicepaymentaddr,bobpaymentaddr,bobdepositaddr); From a3f8fd9b68d6df57668137db60bdc2d404add719 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:11:27 +0200 Subject: [PATCH 518/682] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 60da4eae8..4182d0ebc 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee && targetval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { @@ -893,7 +893,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } //else printf("nothing near i.%d\n",i); + } else printf("nothing near i.%d\n",i); } else break; } if ( iambob == 1 ) From c42984fec0b5755e3a5780c4cd006ea01e494a96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:24:34 +0200 Subject: [PATCH 519/682] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_rpc.c | 3 ++- iguana/exchanges/LP_utxos.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6dcfc6951..111496389 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -268,7 +268,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"BCC") == 0 ) + if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"BCC") == 0 || strcmp(symbol,"ORB") == 0 ) { coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index bcf62e237..fb3f7461f 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -286,8 +286,9 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - //printf("%s already ismine\n",address); + printf("%s already ismine\n",address); } + printf("%s\n",jprint(retjson,0)); free_json(retjson); } if ( doneflag == 0 ) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4182d0ebc..60da4eae8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee && targetval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { @@ -893,7 +893,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr portable_mutex_unlock(&LP_UTXOmutex); total += value; } else printf("scriptmismatch.(%s) vs %s\n",script,jprint(item,0)); - } else printf("nothing near i.%d\n",i); + } //else printf("nothing near i.%d\n",i); } else break; } if ( iambob == 1 ) From 1025a0d278844b5e1bada3f621158f28e31c14ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:28:44 +0200 Subject: [PATCH 520/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fb3f7461f..c84d90e65 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -147,7 +147,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( coin != 0 ) { //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); - if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 ) + if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 ) { retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); if ( retstr != 0 && retstr[0] != 0 ) From 12b1d7e14edd2f8296798159df027b3f90a6ec6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:30:10 +0200 Subject: [PATCH 521/682] Test --- iguana/exchanges/LP_rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c84d90e65..33e7bcf51 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -286,9 +286,9 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - printf("%s already ismine\n",address); + //printf("%s already ismine\n",address); } - printf("%s\n",jprint(retjson,0)); + //printf("%s\n",jprint(retjson,0)); free_json(retjson); } if ( doneflag == 0 ) From c7d9061254353690ee051263b55971c4d7e3201b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:40:57 +0200 Subject: [PATCH 522/682] Test --- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_utxos.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 1399aab8d..9e25a6241 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -600,7 +600,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti } free_json(sentobj); } - if ( 0 && finishedflag == 0 ) + if ( finishedflag == 0 ) printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value)); } } diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 60da4eae8..02979ccdb 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -317,7 +317,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - for (iter=0; iter<2; iter++) + /*for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { @@ -343,7 +343,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } - } + }*/ *valp = val; *val2p = val2; return(0); @@ -843,9 +843,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - //for (i=0; i= 0 ) { item = jitem(array,i); @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee && targetval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 66d8c21ece9d0ec27ff65cc5b4f37cd7107792bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:45:42 +0200 Subject: [PATCH 523/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 02979ccdb..05bce108a 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -317,7 +317,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - /*for (iter=0; iter<2; iter++) + for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { @@ -343,7 +343,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } - }*/ + } *valp = val; *val2p = val2; return(0); @@ -855,9 +855,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr depositval = values[i]; values[i] = 0, used++; if ( iambob == 0 ) - targetval = (depositval / 776) + 2*txfee; + targetval = (depositval / 776) + txfee; else targetval = (depositval / 9) * 8 + 2*txfee; - if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee && targetval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) + if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; From 9b5ecf47aca25edceeffb7da8ae2b5df9420e372 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:47:24 +0200 Subject: [PATCH 524/682] Test --- iguana/exchanges/LP_utxos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 05bce108a..276742be9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -843,9 +843,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 7e5c6183d35d108e05dbe0bd99e5cf58c412125f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 20:50:08 +0200 Subject: [PATCH 525/682] Test --- iguana/exchanges/LP_portfolio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 7ad7b8c85..64f6651bd 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -433,7 +433,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str if ( LP_pricevalid(maxprice) > 0 ) { relvolume = sell->relvolume; - for (iter=0; iter<3; iter++) + for (iter=0; iter<2; iter++) { if ( relvolume < dstr(LP_MIN_TXFEE) ) break; From beee11d03d31ec2ca00baed79b388643b20b01a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 21:11:27 +0200 Subject: [PATCH 526/682] Test --- iguana/exchanges/LP_utxos.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 276742be9..3cf9fa580 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -843,9 +843,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - //for (i=0; i= 0 ) { item = jitem(array,i); @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 9d596792cdabaea2f0727b04a421102241318d28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 21:13:16 +0200 Subject: [PATCH 527/682] Test --- iguana/exchanges/LP_utxos.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 3cf9fa580..276742be9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -795,7 +795,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe dist = (values[i] - targetval); if ( iambob != 0 && dist < 0 && -dist < values[i]/10 ) dist = -dist; - printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); + //printf("(%.8f %.8f %.8f).%d ",dstr(values[i]),dstr(dist),dstr(mindist),mini); if ( dist >= 0 && dist < mindist ) { mini = i; @@ -843,9 +843,9 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr //printf("array.%d\n",n); while ( used < n-1 ) { - for (i=0; i= 0 ) { item = jitem(array,i); @@ -859,7 +859,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr else targetval = (depositval / 9) * 8 + 2*txfee; if ( depositval < (1+LP_MINSIZE_TXFEEMULT)*txfee ) continue; - printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); + //printf("iambob.%d i.%d %.8f target %.8f\n",iambob,i,dstr(depositval),dstr(targetval)); i = -1; if ( iambob != 0 ) { From 9ef819d0f50ddd2f371d563601d8b81b9683fe8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 21:23:19 +0200 Subject: [PATCH 528/682] Test --- iguana/exchanges/LP_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index fde210b83..2f054f70a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -45,8 +45,8 @@ #define LP_SWAPSTEP_TIMEOUT 30 #define LP_AUTOTRADE_TIMEOUT 60 #define LP_MIN_TXFEE 10000 -#define LP_MINVOL 20 -#define LP_MINCLIENTVOL 100 +#define LP_MINVOL 10 +#define LP_MINCLIENTVOL 20 #define LP_MINSIZE_TXFEEMULT 10 #define LP_REQUIRED_TXFEE 0.95 From 5436c671c7a7288bbdb76f09744905bc72163a5d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 21:46:03 +0200 Subject: [PATCH 529/682] Test --- iguana/exchanges/LP_portfolio.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 64f6651bd..f392ae00e 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -419,7 +419,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,struct iguana_info *buy,struct iguana_info *sell,double relvolume,int32_t setbaserel) { - char *retstr2; double bid,ask,maxprice; uint32_t requestid,quoteid,iter; cJSON *retjson2; + char *retstr2; double bid,ask,maxprice; uint32_t requestid,quoteid,iter,i; cJSON *retjson2; requestid = quoteid = 0; LP_myprice(&bid,&ask,buy->symbol,sell->symbol); maxprice = ask; @@ -455,7 +455,15 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str if ( requestid != 0 && quoteid != 0 ) break; } else printf("cant find alice %.8f %s\n",relvolume,sell->symbol); - relvolume /= 3.; + for (i=0; i<100; i++) + { + relvolume *= .99; + if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) + { + printf("i.%d relvolume %.8f from %.8f\n",i,relvolume,sell->relvolume); + break; + } + } } } else if ( setbaserel != 0 ) From 3d5832f2dc7b0c6afdc2e0216319355d397581b4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 21:52:05 +0200 Subject: [PATCH 530/682] Test --- iguana/exchanges/LP_portfolio.c | 13 ++++++++----- iguana/exchanges/LP_swap.c | 12 ++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index f392ae00e..a5982444d 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -455,13 +455,16 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str if ( requestid != 0 && quoteid != 0 ) break; } else printf("cant find alice %.8f %s\n",relvolume,sell->symbol); - for (i=0; i<100; i++) + if ( iter == 0 ) { - relvolume *= .99; - if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) + for (i=0; i<100; i++) { - printf("i.%d relvolume %.8f from %.8f\n",i,relvolume,sell->relvolume); - break; + relvolume *= .99; + if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) + { + printf("i.%d relvolume %.8f from %.8f\n",i,relvolume,sell->relvolume); + break; + } } } } diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index e40160387..6b524e56f 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -441,15 +441,15 @@ int32_t swap_nn_send(int32_t sock,uint8_t *data,int32_t datalen,uint32_t flags,i int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen),int32_t (*datagen)(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)) { int32_t datalen,sendlen,retval = -1; - printf("waitsend.%s timeout.%d\n",statename,timeout); + //printf("waitsend.%s timeout.%d\n",statename,timeout); if ( LP_waitfor(pairsock,swap,timeout,verify) == 0 ) { - printf("waited for %s\n",statename); + //printf("waited for %s\n",statename); if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { if ( (sendlen= swap_nn_send(pairsock,data,datalen,0,timeout)) == datalen ) { - printf("sent.%d after waitfor.%s\n",sendlen,statename); + //printf("sent.%d after waitfor.%s\n",sendlen,statename); retval = 0; } else printf("send %s error\n",statename); } else printf("%s datagen no data\n",statename); @@ -460,13 +460,13 @@ int32_t LP_waitsend(char *statename,int32_t timeout,int32_t pairsock,struct basi int32_t LP_sendwait(char *statename,int32_t timeout,int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen,int32_t (*verify)(struct basilisk_swap *swap,uint8_t *data,int32_t datalen),int32_t (*datagen)(struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)) { int32_t datalen,sendlen,retval = -1; - printf("sendwait.%s\n",statename); + //printf("sendwait.%s\n",statename); if ( (datalen= (*datagen)(swap,data,maxlen)) > 0 ) { - printf("generated %d for %s, timeout.%d\n",datalen,statename,timeout); + //printf("generated %d for %s, timeout.%d\n",datalen,statename,timeout); if ( (sendlen= swap_nn_send(pairsock,data,datalen,0,timeout)) == datalen ) { - printf("sendwait.%s sent %d\n",statename,sendlen); + //printf("sendwait.%s sent %d\n",statename,sendlen); if ( LP_waitfor(pairsock,swap,timeout,verify) == 0 ) { //printf("waited! sendwait.%s sent %d\n",statename,sendlen); From 91c86df1e9bd0cfde70ab4dfec3d26b448b0050d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 22:25:25 +0200 Subject: [PATCH 531/682] Test --- iguana/exchanges/LP_swap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 6b524e56f..89edc2ce6 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -1058,10 +1058,11 @@ struct basilisk_swap *LP_swapinit(int32_t iambob,int32_t optionduration,bits256 { struct basilisk_swap *swap; bits256 pubkey25519; uint8_t pubkey33[33]; swap = calloc(1,sizeof(*swap)); + swap->I.req.quoteid = rp->quoteid; swap->ctx = bitcoin_ctx(); vcalc_sha256(0,swap->I.orderhash.bytes,(uint8_t *)rp,sizeof(*rp)); swap->I.req = *rp; - printf("basilisk_thread_start request.%u iambob.%d (%s/%s)\n",rp->requestid,iambob,rp->src,rp->dest); + printf("basilisk_thread_start request.%u iambob.%d (%s/%s) quoteid.%u\n",rp->requestid,iambob,rp->src,rp->dest,rp->quoteid); bitcoin_pubkey33(swap->ctx,pubkey33,privkey); pubkey25519 = curve25519(privkey,curve25519_basepoint9()); swap->persistent_pubkey = pubkey25519; From c22d0b6ab8d40633d4d37e8fe2d8428f06dd6962 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 22:53:25 +0200 Subject: [PATCH 532/682] NAV --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/coins | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 65b8271c5..6d01eb21a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,7 +21,8 @@ // new features: // stats // PoW, JS -// autoutxo +// verify actual pricing +// autoutxo, if < 10*txfee and > 10 utxo: combine smallest utxo into dexfee; autosplit if imbalanced // unduplicated bugs: // swap cancel should cleanly cancel diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index d45b24b12..56ee4fc1c 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 70f9dce4fbf09215df24116a68f26d83f5044786 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Jul 2017 22:56:51 +0200 Subject: [PATCH 533/682] Test --- iguana/exchanges/LP_utxos.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 276742be9..f13b1e436 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -288,7 +288,8 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo) int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol,bits256 txid,int32_t vout,uint64_t satoshis,bits256 txid2,int32_t vout2) { - struct LP_utxoinfo *utxo; uint64_t val,val2=0,txfee,threshold=0; int32_t iter,bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); + //struct LP_utxoinfo *utxo; + uint64_t val,val2=0,txfee,threshold=0; int32_t bypass = 0; char destaddr[64],destaddr2[64]; struct iguana_info *coin = LP_coinfind(symbol); destaddr[0] = destaddr2[0] = 0; if ( coin != 0 && IAMLP != 0 && coin->inactive != 0 ) bypass = 1; @@ -317,7 +318,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol } // else printf("no val2\n"); } // char str[65],str2[65]; printf("spent.%d %s txid or value %.8f < %.8f or val2 %.8f < %.8f, %s/v%d %s/v%d or < 10x txfee %.8f\n",iambob,symbol,dstr(val),dstr(satoshis),dstr(val2),dstr(threshold),bits256_str(str,txid),vout,bits256_str(str2,txid2),vout2,dstr(txfee)); - for (iter=0; iter<2; iter++) + /*for (iter=0; iter<2; iter++) { if ( (utxo= LP_utxofind(iter,txid,vout)) != 0 ) { @@ -343,7 +344,7 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol if ( utxo->T.spentflag == 0 ) utxo->T.spentflag = (uint32_t)time(NULL); } - } + }*/ *valp = val; *val2p = val2; return(0); From 1b2ac2c01b9a71dd8ec78d017bcb511b0ebe0fc2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 27 Jul 2017 09:09:43 +0200 Subject: [PATCH 534/682] PPC exception --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 111496389..5a5db2b7c 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -268,7 +268,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"BCC") == 0 || strcmp(symbol,"ORB") == 0 ) + if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"PPC") == 0 || strcmp(symbol,"BCC") == 0 || strcmp(symbol,"ORB") == 0 ) { coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6d01eb21a..e023b0dea 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -19,6 +19,7 @@ // marketmaker // // new features: +// bittrex balancing // stats // PoW, JS // verify actual pricing From 16966bf90c8a29f2e7f7ea078623db9c26ecf0bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 27 Jul 2017 19:59:46 +0200 Subject: [PATCH 535/682] DGB fix --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 56ee4fc1c..9c2338cc0 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\", \"name\":\"digibyte\", \"pubtype\":30, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 212333fc904495394fdd855ee17152eed0a18bc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 27 Jul 2017 20:00:54 +0200 Subject: [PATCH 536/682] Test --- iguana/exchanges/LP_prices.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8e177e6e0..d68ae2257 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -842,6 +842,8 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price) } pubp->timestamp = (uint32_t)time(NULL); } else printf("error creating pubkey entry\n"); - } else printf("error finding %s/%s %.8f\n",base,rel,price); + } + else if ( (rand() % 100) == 0 ) + printf("error finding %s/%s %.8f\n",base,rel,price); } From 167b24a7d891012d60f9d369dd2c01c58c9446ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 28 Jul 2017 12:23:00 +0200 Subject: [PATCH 537/682] NMC --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 9c2338cc0..033a08108 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 80922e3e659714a842216eb7e0dd3d3c1572e4f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 28 Jul 2017 22:22:43 +0200 Subject: [PATCH 538/682] Test --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 033a08108..73f3d6779 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, \"txfee\":10000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":0}, {\"coin\":\"SYS\", \"name\":\"syscoin\", \"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"ZEC\", \"name\":\"zcash\", \"pubtype\":184, \"p2shtype\":189, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":0}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":0}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":0}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From a4a683f0bdce0ea84b887f4a3f6cb2f748569665 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 30 Jul 2017 08:51:39 +0200 Subject: [PATCH 539/682] SMC and BTA --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 73f3d6779..1a199c7c8 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From b5b95a8f56b8a6eca874d5941e543d8aec027556 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 30 Jul 2017 15:39:12 +0200 Subject: [PATCH 540/682] Test --- crypto777/hmac_sha512.c | 24 +++++++ crypto777/iguana_utils.c | 24 ------- iguana/exchanges/DEXstats.h | 2 +- iguana/exchanges/LP_bitcoin.c | 5 ++ iguana/exchanges/LP_nativeDEX.c | 36 ----------- iguana/exchanges/LP_network.c | 109 ++++++++++++++++++++++++++------ iguana/exchanges/LP_rpc.c | 38 ----------- iguana/exchanges/stats.c | 17 +++-- 8 files changed, 131 insertions(+), 124 deletions(-) diff --git a/crypto777/hmac_sha512.c b/crypto777/hmac_sha512.c index e1fe4e523..7df6d978f 100755 --- a/crypto777/hmac_sha512.c +++ b/crypto777/hmac_sha512.c @@ -621,4 +621,28 @@ char *hmac_whirlpool_str(char *dest,char *key,int32_t key_size,char *message) return(dest); } +void calc_md2str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) +{ + bits128 x; + calc_md2(hexstr,buf,msg,len); + decode_hex(buf,sizeof(x),hexstr); + //memcpy(buf,x.bytes,sizeof(x)); +} + +void calc_md4str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) +{ + bits128 x; + calc_md4(hexstr,buf,msg,len); + decode_hex(buf,sizeof(x),hexstr); + //memcpy(buf,x.bytes,sizeof(x)); +} + +void calc_md5str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) +{ + bits128 x; + calc_md5(hexstr,msg,len); + decode_hex(buf,sizeof(x),hexstr); + //memcpy(buf,x.bytes,sizeof(x)); +} + diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 985a13789..5b0ce5743 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -1105,30 +1105,6 @@ void rmd160ofsha256(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) calc_rmd160(hexstr,buf,sha256,sizeof(sha256)); } -void calc_md2str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) -{ - bits128 x; - calc_md2(hexstr,buf,msg,len); - decode_hex(buf,sizeof(x),hexstr); - //memcpy(buf,x.bytes,sizeof(x)); -} - -void calc_md4str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) -{ - bits128 x; - calc_md4(hexstr,buf,msg,len); - decode_hex(buf,sizeof(x),hexstr); - //memcpy(buf,x.bytes,sizeof(x)); -} - -void calc_md5str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) -{ - bits128 x; - calc_md5(hexstr,msg,len); - decode_hex(buf,sizeof(x),hexstr); - //memcpy(buf,x.bytes,sizeof(x)); -} - void calc_crc32str(char *hexstr,uint8_t *buf,uint8_t *msg,int32_t len) { uint32_t crc; uint8_t serialized[sizeof(crc)]; diff --git a/iguana/exchanges/DEXstats.h b/iguana/exchanges/DEXstats.h index 919e6d0ff..e31ff68e3 100644 --- a/iguana/exchanges/DEXstats.h +++ b/iguana/exchanges/DEXstats.h @@ -927,7 +927,7 @@ char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t } #ifndef FROM_MARKETMAKER -char *stats_JSON(char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) +char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) { char *method,*agent,*retstr,*source,*dest; struct tai T; uint32_t endtimestamp; struct DEXstats_disp prices[365]; int32_t leftdatenum,seconds,numdates; if ( (method= jstr(argjson,"method")) == 0 ) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 100b05080..035a90e28 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2028,6 +2028,11 @@ char *bitcoind_passthru(char *coinstr,char *serverport,char *userpass,char *meth return(bitcoind_RPC(0,coinstr,serverport,userpass,method,params,2)); } +char *bitcoind_passthrut(char *coinstr,char *serverport,char *userpass,char *method,char *params,int32_t timeout) +{ + return(bitcoind_RPC(0,coinstr,serverport,userpass,method,params,timeout)); +} + int32_t bitcoin_addr2rmd160(uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr) { bits256 hash; uint8_t *buf,_buf[26]; int32_t len,offset; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e023b0dea..14dff30a0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -112,42 +112,6 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson return(retstr); } -int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) -{ - static uint32_t crcs[8192]; static unsigned long dup,total; - int32_t i; - *duplicatep = 0; - if ( ind < 0 ) - { - total++; - for (i=0; i 0 ) - { - crcs[i] = crcs[i >> 1]; - crcs[i >> 1] = crc32; - dup++; - //printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); - } - *duplicatep = 1; - break; - } - else if ( crcs[i] == 0 ) - break; - } - if ( i >= sizeof(crcs)/sizeof(*crcs) ) - i = (rand() % (sizeof(crcs)/sizeof(*crcs))); - return(i); - } - else - { - crcs[ind] = crc32; - return(ind); - } -} - char *LP_decrypt(uint8_t *ptr,int32_t *recvlenp) { uint8_t decoded[LP_ENCRYPTED_MAXSIZE + crypto_box_ZEROBYTES],*nonce,*cipher; int32_t recvlen,cipherlen; char *jsonstr = 0; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 38fac9e0c..aadc2f485 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -62,24 +62,6 @@ int32_t LP_sockcheck(int32_t sock) else return(-1); } -int32_t LP_peerindsock(int32_t *peerindp) -{ - struct LP_peerinfo *peer,*tmp; int32_t peerind = 0; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - peerind++; - if ( peer->errors < LP_MAXPEER_ERRORS && peer->pushsock >= 0 ) - { - if ( peerind < *peerindp ) - continue; - *peerindp = peerind; - //printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); - return(peer->pushsock); - } - } - return(-1); -} - struct LP_queue { struct LP_queue *next,*prev; @@ -103,6 +85,60 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); } +int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32) +{ + static uint32_t crcs[8192]; static unsigned long dup,total; + int32_t i; + *duplicatep = 0; + if ( ind < 0 ) + { + total++; + for (i=0; i 0 ) + { + crcs[i] = crcs[i >> 1]; + crcs[i >> 1] = crc32; + dup++; + //printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); + } + *duplicatep = 1; + break; + } + else if ( crcs[i] == 0 ) + break; + } + if ( i >= sizeof(crcs)/sizeof(*crcs) ) + i = (rand() % (sizeof(crcs)/sizeof(*crcs))); + return(i); + } + else + { + crcs[ind] = crc32; + return(ind); + } +} + +int32_t LP_peerindsock(int32_t *peerindp) +{ + struct LP_peerinfo *peer,*tmp; int32_t peerind = 0; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + peerind++; + if ( peer->errors < LP_MAXPEER_ERRORS && peer->pushsock >= 0 ) + { + if ( peerind < *peerindp ) + continue; + *peerindp = peerind; + //printf("peerind.%d -> sock %d\n",peerind,peer->pushsock); + return(peer->pushsock); + } + } + return(-1); +} + void queue_loop(void *ignore) { struct LP_queue *ptr,*tmp; int32_t sentbytes,nonz,flag,duplicate,n=0; @@ -575,6 +611,43 @@ char *LP_psock(char *myipaddr,int32_t ispaired) both are combined in LP_psock_get */ +char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) +{ + char url[512],*retstr; + sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport,ispaired); + //return(LP_issue_curl("psock",destip,destport,url)); + retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); + printf("issue_LP_psock got (%s) from %s\n",retstr,destip); + return(retstr); +} + +uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) +{ + uint16_t publicport = 0; char *retstr,*addr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + connectaddr[0] = publicaddr[0] = 0; + if ( peer->errors < LP_MAXPEER_ERRORS && (retstr= issue_LP_psock(peer->ipaddr,peer->port,ispaired)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + printf("from %s:%u (%s)\n",peer->ipaddr,peer->port,retstr); + if ( (addr= jstr(retjson,"publicaddr")) != 0 ) + safecopy(publicaddr,addr,128); + if ( (addr= jstr(retjson,"connectaddr")) != 0 ) + safecopy(connectaddr,addr,128); + if ( publicaddr[0] != 0 && connectaddr[0] != 0 ) + publicport = juint(retjson,"publicport"); + free_json(retjson); + } + printf("got.(%s) connect.%s public.%s\n",retstr,connectaddr,publicaddr); + free(retstr); + } else printf("error psock from %s:%u\n",peer->ipaddr,peer->port); + if ( publicport != 0 ) + break; + } + return(publicport); +} int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char *myipaddr,uint16_t mypullport,int32_t ispaired) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 33e7bcf51..e210b96df 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -103,44 +103,6 @@ char *issue_LP_getprices(char *destip,uint16_t destport) //return(issue_curlt(url,LP_HTTP_TIMEOUT)); } -char *issue_LP_psock(char *destip,uint16_t destport,int32_t ispaired) -{ - char url[512],*retstr; - sprintf(url,"http://%s:%u/api/stats/psock?ispaired=%d",destip,destport,ispaired); - //return(LP_issue_curl("psock",destip,destport,url)); - retstr = issue_curlt(url,LP_HTTP_TIMEOUT*3); - printf("issue_LP_psock got (%s) from %s\n",retstr,destip); - return(retstr); -} - -uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) -{ - uint16_t publicport = 0; char *retstr,*addr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - connectaddr[0] = publicaddr[0] = 0; - if ( peer->errors < LP_MAXPEER_ERRORS && (retstr= issue_LP_psock(peer->ipaddr,peer->port,ispaired)) != 0 ) - { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - printf("from %s:%u (%s)\n",peer->ipaddr,peer->port,retstr); - if ( (addr= jstr(retjson,"publicaddr")) != 0 ) - safecopy(publicaddr,addr,128); - if ( (addr= jstr(retjson,"connectaddr")) != 0 ) - safecopy(connectaddr,addr,128); - if ( publicaddr[0] != 0 && connectaddr[0] != 0 ) - publicport = juint(retjson,"publicport"); - free_json(retjson); - } - printf("got.(%s) connect.%s public.%s\n",retstr,connectaddr,publicaddr); - free(retstr); - } else printf("error psock from %s:%u\n",peer->ipaddr,peer->port); - if ( publicport != 0 ) - break; - } - return(publicport); -} - cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) { char *retstr; cJSON *retjson = 0; diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index c565fa78f..888cedd1c 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -21,11 +21,12 @@ #include #include -#include "OS_portable.h" +#include "../../crypto777/OS_portable.h" #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define STATS_DESTDIR "/var/www/html" #define STATS_DEST "/var/www/html/DEXstats.json" #include "DEXstats.h" +char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #ifndef WIN32 #ifndef MSG_NOSIGNAL @@ -558,7 +559,7 @@ void stats_rpcloop(void *args) uint16_t port; char filetype[128],content_type[128]; int32_t recvlen,flag,bindsock,postflag=0,contentlen,sock,remains,numsent,jsonflag=0,hdrsize,len; socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; - struct sockaddr_in cli_addr; uint32_t ipbits,i,size = IGUANA_MAXPACKETSIZE + 512; + struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 10*IGUANA_MAXPACKETSIZE + 512; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; if ( jsonbuf == 0 ) @@ -665,7 +666,7 @@ void stats_rpcloop(void *args) if ( retstr != 0 ) { char *response,hdrs[1024]; - //printf("RETURN.(%s)\n",retstr); + //printf("RETURN.(%s) jsonflag.%d postflag.%d\n",retstr,jsonflag,postflag); if ( jsonflag != 0 || postflag != 0 ) { response = malloc(strlen(retstr)+1024+1+1); @@ -677,6 +678,7 @@ void stats_rpcloop(void *args) if ( retstr != space ) free(retstr); retstr = response; + //printf("RET.(%s)\n",retstr); } remains = (int32_t)strlen(retstr); i = 0; @@ -726,8 +728,8 @@ void stats_kvjson(FILE *logfp,int32_t height,int32_t savedheight,uint32_t timest void komodo_kvupdate(FILE *logfp,struct komodo_state *sp,int32_t ht,bits256 txid,int32_t vout,uint8_t *opretbuf,int32_t opretlen,uint64_t value) { - static bits256 zeroes; - uint32_t flags; bits256 pubkey,refpubkey,sig; cJSON *kvjson; char decodestr[10000]; int32_t i,refvaluesize,hassig,coresize,haspubkey,height,kvheight; uint16_t keylen,valuesize,newflag = 0; uint8_t *key,*valueptr,keyvalue[10000]; + //static bits256 zeroes; + uint32_t flags; bits256 pubkey,sig; cJSON *kvjson; char decodestr[10000]; int32_t i,hassig,coresize,haspubkey,height; uint16_t keylen,valuesize; uint8_t *key,*valueptr; // bits256 refpubkey; int32_t refvaluesize,kvheight; uint16_t newflag = 0; uint8_t keyvalue[10000]; iguana_rwnum(0,&opretbuf[1],sizeof(keylen),&keylen); iguana_rwnum(0,&opretbuf[3],sizeof(valuesize),&valuesize); iguana_rwnum(0,&opretbuf[5],sizeof(height),&height); @@ -830,7 +832,7 @@ void komodo_eventadd_kmdheight(struct komodo_state *sp,char *symbol,int32_t heig void stats_pricefeed(struct komodo_state *sp,char *symbol,int32_t ht,uint32_t *pvals,int32_t numpvals) { - struct tai T; int32_t seconds,datenum,n; cJSON *argjson; + struct tai T; int32_t seconds,datenum; cJSON *argjson; if ( ht > 300000 && pvals[32] != 0 ) { datenum = OS_conv_unixtime(&T,&seconds,sp->SAVEDTIMESTAMP); @@ -930,7 +932,7 @@ int32_t komodo_parsestatefile(FILE *logfp,struct komodo_state *sp,FILE *fp,char { if ( fread(opret,1,olen,fp) != olen ) errs++; - if ( 0 && matched != 0 ) + if ( (0) && matched != 0 ) { int32_t i; for (i=0; i Date: Sun, 30 Jul 2017 17:16:40 +0200 Subject: [PATCH 541/682] TRC --- iguana/exchanges/coins | 2 +- iguana/exchanges/stats.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 1a199c7c8..7dbcbf95d 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 888cedd1c..92794c535 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -559,7 +559,7 @@ void stats_rpcloop(void *args) uint16_t port; char filetype[128],content_type[128]; int32_t recvlen,flag,bindsock,postflag=0,contentlen,sock,remains,numsent,jsonflag=0,hdrsize,len; socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; - struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 10*IGUANA_MAXPACKETSIZE + 512; + struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; if ( (port= *(uint16_t *)args) == 0 ) port = 7779; if ( jsonbuf == 0 ) From a62c18c206178e8da942c5c65bff5b103b454f25 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 30 Jul 2017 21:55:17 +0200 Subject: [PATCH 542/682] CREA --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 7dbcbf95d..13fbfcbdd 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From b7415d167885ed70d60542e3af802be48c38b6ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 30 Jul 2017 22:17:07 +0200 Subject: [PATCH 543/682] SXC --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 13fbfcbdd..444ad6aa9 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 73ba3a6741c3bc7307572d96227b4fada4616e4a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 31 Jul 2017 09:40:06 +0200 Subject: [PATCH 544/682] FLO --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 444ad6aa9..a6598ab07 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From d467826d637832e6d403c3daa1b1f84165fe1c83 Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Mon, 31 Jul 2017 23:08:23 +1200 Subject: [PATCH 545/682] updated deplay script to make static marketmaker --- osx_deploy.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osx_deploy.sh b/osx_deploy.sh index 4a7efa802..9fa0f5733 100755 --- a/osx_deploy.sh +++ b/osx_deploy.sh @@ -6,13 +6,21 @@ TMP_DIR=~/tmp/iguana mkdir -p $TMP_DIR echo "making $TMP_DIR" -binaries=("iguana") +binaries=("iguana" "marketmaker") for binary in "${binaries[@]}"; do echo "copying $binary to $TMP_DIR" - cp agents/$binary $TMP_DIR + if [ "$binary" = "iguana" ] + then + cp agents/$binary $TMP_DIR + fi + + if [ "$binary" = "marketmaker" ] + then + cp iguana/$binary $TMP_DIR + fi # find the dylibs to copy for iguana DYLIBS=`otool -L $TMP_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` From 8e4b0d3d71a0bd66221d22e8d6eab49f93dd15a8 Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Mon, 31 Jul 2017 23:29:36 +1200 Subject: [PATCH 546/682] Add files via upload --- iguana/m_MM_StaticNanoMsg | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 iguana/m_MM_StaticNanoMsg diff --git a/iguana/m_MM_StaticNanoMsg b/iguana/m_MM_StaticNanoMsg new file mode 100644 index 000000000..df84288ea --- /dev/null +++ b/iguana/m_MM_StaticNanoMsg @@ -0,0 +1,7 @@ +#!/bin/bash +#./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery +rm -f marketmaker +git pull +cd secp256k1; ./m_unix; cd .. +cd ../crypto777; make -f m_LP_StaticNanoMsg all; make -f m_LP_StaticNanoMsg clean; cd ../iguana +gcc -g -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a ../OSlibs/linux/$(uname -m)/libnanomsg-static.a -lcurl -lpthread -lm From e7391f914c42b8f1c8a078398374221a8175ccf2 Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Mon, 31 Jul 2017 23:39:27 +1200 Subject: [PATCH 547/682] iguana_ramchain.c added to script --- iguana/m_LP_StaticNanoMsg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/m_LP_StaticNanoMsg b/iguana/m_LP_StaticNanoMsg index b88e05e45..f121efc88 100755 --- a/iguana/m_LP_StaticNanoMsg +++ b/iguana/m_LP_StaticNanoMsg @@ -6,7 +6,7 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; make -f m_LP_StaticNanoMsg all; make -f m_LP_StaticNanoMsg clean; cd ../iguana clang -g -Wno-deprecated -c -O2 -DLIQUIDITY_PROVIDER=1 -DUSE_STATIC_NANOMSG *.c ../basilisk/basilisk.c ../gecko/gecko.c ../datachain/datachain.c -clang -g -Wno-deprecated -c -DLIQUIDITY_PROVIDER=1 -DUSE_STATIC_NANOMSG main.c iguana777.c iguana_bundles.c ../basilisk/basilisk.c +clang -g -Wno-deprecated -c -DLIQUIDITY_PROVIDER=1 -DUSE_STATIC_NANOMSG main.c iguana777.c iguana_bundles.c ../basilisk/basilisk.c iguana_ramchain.c clang -g -o ../agents/iguana *.o ../agents/libcrypto777.a ../OSlibs/linux/$(uname -m)/libnanomsg-static.a -lcurl -lssl -lcrypto -lpthread -lz -lm -lanl -lrt -lnsl From a8138b04c4dd715895513fae9048f6a4cf320946 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 1 Aug 2017 07:48:44 +0200 Subject: [PATCH 548/682] FAIR --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/coins | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 14dff30a0..e3bf7308e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -20,6 +20,7 @@ // // new features: // bittrex balancing +// detect port conflicts on enable // stats // PoW, JS // verify actual pricing diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index a6598ab07..940d8d3b6 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 3885c9cbdbdd955014caa2214df913e9547fc089 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 Aug 2017 11:17:46 +0200 Subject: [PATCH 549/682] Deterministic sort and ERC --- basilisk/basilisk_DEX.c | 2 +- crypto777/iguana_utils.c | 18 +++++++++--------- iguana/exchanges/coins | 2 +- iguana/iguana_bundles.c | 2 +- iguana/iguana_txidfind.c | 2 +- iguana/iguana_unspents.c | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 17ed0816e..35da560b9 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -418,7 +418,7 @@ struct basilisk_request *_basilisk_requests_uniq(struct supernet_info *myinfo,in } } } - qsort(requests,m,sizeof(*requests),_cmp_requests); + mergesort(requests,m,sizeof(*requests),_cmp_requests); *nump = m; return(requests); } diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 5b0ce5743..dce1f85b5 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -585,31 +585,31 @@ static int _decreasing_uint32(const void *a,const void *b) int32_t sortds(double *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_increasing_double); + mergesort(buf,num,size,_increasing_double); return(0); } int32_t revsortds(double *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_decreasing_double); + mergesort(buf,num,size,_decreasing_double); return(0); } int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_increasing_uint64); + mergesort(buf,num,size,_increasing_uint64); return(0); } int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_decreasing_uint64); + mergesort(buf,num,size,_decreasing_uint64); return(0); } int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_decreasing_uint32); + mergesort(buf,num,size,_decreasing_uint32); return(0); } @@ -619,17 +619,17 @@ int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) if ( dir > 0 ) { if ( size == 32 ) - qsort(buf,num,structsize,_increasing_bits256); + mergesort(buf,num,structsize,_increasing_bits256); else if ( size == 20 ) - qsort(buf,num,structsize,_increasing_rmd160); + mergesort(buf,num,structsize,_increasing_rmd160); else retval = -1; } else { if ( size == 32 ) - qsort(buf,num,structsize,_decreasing_bits256); + mergesort(buf,num,structsize,_decreasing_bits256); else if ( size == 20 ) - qsort(buf,num,structsize,_decreasing_rmd160); + mergesort(buf,num,structsize,_decreasing_rmd160); else retval = -1; } if ( retval < 0 ) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 940d8d3b6..fd34a1ba3 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index e7c53ae73..3ac2cd36f 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1173,7 +1173,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin static int32_t revsortds(double *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_decreasing_double); + mergesort(buf,num,size,_decreasing_double); return(0); }*/ diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 6f9e81f52..601a5079b 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -563,7 +563,7 @@ int64_t iguana_fastfindcreate(struct iguana_info *coin) { OS_removefile(fname,0); num = (int32_t)allocsize/sizeof(bits256); - qsort(sortbuf,num,sizeof(bits256),_bignum_cmp); + mergesort(sortbuf,num,sizeof(bits256),_bignum_cmp); strcat(fname,".all"); if ( (coin->fastfps[i]= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 2974c300f..f7e8dd05e 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -853,7 +853,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref } } if ( n > 0 ) - qsort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); + mergesort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); vcalc_sha256cat(hash2p->bytes,refhash2.bytes,sizeof(refhash2),sortbuf[1].bytes,20); memcpy(refrmd160,sortbuf[1].bytes,20); { @@ -1730,7 +1730,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co { if ( counts[ind] > 0 ) { - qsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); + mergesort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); continue; /*for (j=0; j Date: Wed, 2 Aug 2017 18:25:20 +0200 Subject: [PATCH 550/682] Test --- basilisk/basilisk_DEX.c | 2 +- crypto777/iguana_utils.c | 18 +++++++++--------- iguana/iguana_bundles.c | 2 +- iguana/iguana_txidfind.c | 2 +- iguana/iguana_unspents.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 35da560b9..71aaee206 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -418,7 +418,7 @@ struct basilisk_request *_basilisk_requests_uniq(struct supernet_info *myinfo,in } } } - mergesort(requests,m,sizeof(*requests),_cmp_requests); + heapsort(requests,m,sizeof(*requests),_cmp_requests); *nump = m; return(requests); } diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index dce1f85b5..3251be13f 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -585,31 +585,31 @@ static int _decreasing_uint32(const void *a,const void *b) int32_t sortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_increasing_double); + heapsort(buf,num,size,_increasing_double); return(0); } int32_t revsortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_double); + heapsort(buf,num,size,_decreasing_double); return(0); } int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_increasing_uint64); + heapsort(buf,num,size,_increasing_uint64); return(0); } int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_uint64); + heapsort(buf,num,size,_decreasing_uint64); return(0); } int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_uint32); + heapsort(buf,num,size,_decreasing_uint32); return(0); } @@ -619,17 +619,17 @@ int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) if ( dir > 0 ) { if ( size == 32 ) - mergesort(buf,num,structsize,_increasing_bits256); + heapsort(buf,num,structsize,_increasing_bits256); else if ( size == 20 ) - mergesort(buf,num,structsize,_increasing_rmd160); + heapsort(buf,num,structsize,_increasing_rmd160); else retval = -1; } else { if ( size == 32 ) - mergesort(buf,num,structsize,_decreasing_bits256); + heapsort(buf,num,structsize,_decreasing_bits256); else if ( size == 20 ) - mergesort(buf,num,structsize,_decreasing_rmd160); + heapsort(buf,num,structsize,_decreasing_rmd160); else retval = -1; } if ( retval < 0 ) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 3ac2cd36f..113a2d9ff 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1173,7 +1173,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin static int32_t revsortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_double); + heapsort(buf,num,size,_decreasing_double); return(0); }*/ diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 601a5079b..209dbccf7 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -563,7 +563,7 @@ int64_t iguana_fastfindcreate(struct iguana_info *coin) { OS_removefile(fname,0); num = (int32_t)allocsize/sizeof(bits256); - mergesort(sortbuf,num,sizeof(bits256),_bignum_cmp); + heapsort(sortbuf,num,sizeof(bits256),_bignum_cmp); strcat(fname,".all"); if ( (coin->fastfps[i]= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index f7e8dd05e..935b11ae6 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -853,7 +853,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref } } if ( n > 0 ) - mergesort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); + heapsort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); vcalc_sha256cat(hash2p->bytes,refhash2.bytes,sizeof(refhash2),sortbuf[1].bytes,20); memcpy(refrmd160,sortbuf[1].bytes,20); { @@ -1730,7 +1730,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co { if ( counts[ind] > 0 ) { - mergesort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); + heapsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); continue; /*for (j=0; j Date: Wed, 2 Aug 2017 18:26:23 +0200 Subject: [PATCH 551/682] Test --- crypto777/iguana_utils.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 3251be13f..5b0ce5743 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -585,31 +585,31 @@ static int _decreasing_uint32(const void *a,const void *b) int32_t sortds(double *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_increasing_double); + qsort(buf,num,size,_increasing_double); return(0); } int32_t revsortds(double *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_decreasing_double); + qsort(buf,num,size,_decreasing_double); return(0); } int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_increasing_uint64); + qsort(buf,num,size,_increasing_uint64); return(0); } int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_decreasing_uint64); + qsort(buf,num,size,_decreasing_uint64); return(0); } int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_decreasing_uint32); + qsort(buf,num,size,_decreasing_uint32); return(0); } @@ -619,17 +619,17 @@ int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) if ( dir > 0 ) { if ( size == 32 ) - heapsort(buf,num,structsize,_increasing_bits256); + qsort(buf,num,structsize,_increasing_bits256); else if ( size == 20 ) - heapsort(buf,num,structsize,_increasing_rmd160); + qsort(buf,num,structsize,_increasing_rmd160); else retval = -1; } else { if ( size == 32 ) - heapsort(buf,num,structsize,_decreasing_bits256); + qsort(buf,num,structsize,_decreasing_bits256); else if ( size == 20 ) - heapsort(buf,num,structsize,_decreasing_rmd160); + qsort(buf,num,structsize,_decreasing_rmd160); else retval = -1; } if ( retval < 0 ) From 453379053b67d0debad18c5818a445b23582ee4d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 Aug 2017 18:31:33 +0200 Subject: [PATCH 552/682] Test --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 5b0ce5743..3968f50ea 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -609,7 +609,7 @@ int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - qsort(buf,num,size,_decreasing_uint32); + heapsort(buf,num,size,_decreasing_uint32); return(0); } From 94d378ee6a73bd6fb74b621eeb6762f7ec2ec510 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 Aug 2017 18:32:25 +0200 Subject: [PATCH 553/682] Test --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 3968f50ea..5b0ce5743 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -609,7 +609,7 @@ int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_decreasing_uint32); + qsort(buf,num,size,_decreasing_uint32); return(0); } From 1fb677073d100cf9702b66d4ec6a0d40d1e29b36 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 3 Aug 2017 08:56:03 +0200 Subject: [PATCH 554/682] CLOAK bit --- iguana/exchanges/LP_coins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 5a5db2b7c..a5fd82434 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -268,7 +268,7 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) name2 = 0; else name2 = name; - if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"PPC") == 0 || strcmp(symbol,"BCC") == 0 || strcmp(symbol,"ORB") == 0 ) + if ( strcmp(symbol,"XVG") == 0 || strcmp(symbol,"CLOAK") == 0 || strcmp(symbol,"PPC") == 0 || strcmp(symbol,"BCC") == 0 || strcmp(symbol,"ORB") == 0 ) { coin->noimportprivkey_flag = 1; printf("truncate importprivkey for %s\n",symbol); From b57f24fa54e65688c7969e9d9b4a0271d0d84c6f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 3 Aug 2017 11:02:14 +0200 Subject: [PATCH 555/682] Test --- basilisk/basilisk_DEX.c | 2 +- iguana/exchanges/LP_transaction.c | 8 +++++--- iguana/iguana_bundles.c | 2 +- iguana/iguana_txidfind.c | 2 +- iguana/iguana_unspents.c | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 71aaee206..17ed0816e 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -418,7 +418,7 @@ struct basilisk_request *_basilisk_requests_uniq(struct supernet_info *myinfo,in } } } - heapsort(requests,m,sizeof(*requests),_cmp_requests); + qsort(requests,m,sizeof(*requests),_cmp_requests); *nump = m; return(requests); } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b496db61e..2fcb6d89a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -847,6 +847,7 @@ int32_t basilisk_swap_getsigscript(char *symbol,uint8_t *script,int32_t maxlen,b return(scriptlen); } +#ifdef notnow bits256 _LP_swap_spendtxid(char *symbol,char *destaddr,char *coinaddr,bits256 utxotxid,int32_t vout) { char *retstr,*addr; cJSON *array,*item,*array2; int32_t i,n,m; bits256 spendtxid,txid; @@ -899,6 +900,7 @@ bits256 _LP_swap_spendtxid(char *symbol,char *destaddr,char *coinaddr,bits256 ut } return(spendtxid); } +#endif bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t vout) { @@ -911,12 +913,12 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t v printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),vout); return(spendtxid); //char str[65]; printf("swap %s spendtxid.(%s)\n",symbol,bits256_str(str,utxotxid)); - if ( 0 && strcmp("BTC",symbol) == 0 ) + if ( (0) && strcmp("BTC",symbol) == 0 ) { //[{"type":"sent","confirmations":379,"height":275311,"timestamp":1492084664,"txid":"8703c5517bc57db38134058370a14e99b8e662b99ccefa2061dea311bbd02b8b","vout":0,"amount":117.50945263,"spendtxid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","vin":0,"paid":{"type":"paid","txid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","height":275663,"timestamp":1492106024,"vouts":[{"RUDpN6PEBsE7ZFbGjUxk1W3QVsxnjBLYw6":117.50935263}]}}] - LP_swap_getcoinaddr(symbol,coinaddr,utxotxid,vout); + /*LP_swap_getcoinaddr(symbol,coinaddr,utxotxid,vout); if ( coinaddr[0] != 0 ) - spendtxid = _LP_swap_spendtxid(symbol,destaddr,coinaddr,utxotxid,vout); + spendtxid = _LP_swap_spendtxid(symbol,destaddr,coinaddr,utxotxid,vout);*/ } else { diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 113a2d9ff..e7c53ae73 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1173,7 +1173,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin static int32_t revsortds(double *buf,uint32_t num,int32_t size) { - heapsort(buf,num,size,_decreasing_double); + qsort(buf,num,size,_decreasing_double); return(0); }*/ diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 209dbccf7..6f9e81f52 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -563,7 +563,7 @@ int64_t iguana_fastfindcreate(struct iguana_info *coin) { OS_removefile(fname,0); num = (int32_t)allocsize/sizeof(bits256); - heapsort(sortbuf,num,sizeof(bits256),_bignum_cmp); + qsort(sortbuf,num,sizeof(bits256),_bignum_cmp); strcat(fname,".all"); if ( (coin->fastfps[i]= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 935b11ae6..2974c300f 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -853,7 +853,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref } } if ( n > 0 ) - heapsort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); + qsort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); vcalc_sha256cat(hash2p->bytes,refhash2.bytes,sizeof(refhash2),sortbuf[1].bytes,20); memcpy(refrmd160,sortbuf[1].bytes,20); { @@ -1730,7 +1730,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co { if ( counts[ind] > 0 ) { - heapsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); + qsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); continue; /*for (j=0; j Date: Sun, 6 Aug 2017 10:23:56 +0200 Subject: [PATCH 556/682] Fix DOGE --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index fd34a1ba3..6a795db2c 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\", \"name\":\"dogecoin\", \"pubtype\":30, \"p2shtype\":22, \"wiftype\":158, \"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From dd1383d09a9c7ee37ac22f1db759d17341deb05a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Aug 2017 13:25:44 +0200 Subject: [PATCH 557/682] VIA --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 6a795db2c..833eecfb7 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 4f860ab7adaa262944f41a45beb220f99b4fd0a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Aug 2017 18:30:13 +0200 Subject: [PATCH 558/682] ZCL --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 833eecfb7..f42552278 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 539fb7adb1a518887ee5f5f903f72f430de3c65e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Aug 2017 19:48:02 +0200 Subject: [PATCH 559/682] ARC --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index f42552278..d22c195e5 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 1ea8be658bddc354dee6bc277dc2ac9342729c51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 7 Aug 2017 09:10:48 +0200 Subject: [PATCH 560/682] BDL --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index d22c195e5..71d549a24 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 77bc1bc58abab2b5b848d346fc7996d2bb47b785 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 7 Aug 2017 09:11:31 +0200 Subject: [PATCH 561/682] PIVX --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 71d549a24..7af97e6c6 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From c412e6ae6e28926f340561efbcc433aa56e7e6c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 8 Aug 2017 21:18:10 +0200 Subject: [PATCH 562/682] HUC --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 7af97e6c6..75ecd7111 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From dbc37ff59fc631e49d0c0c1740e948e102d710e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 Aug 2017 10:03:39 +0200 Subject: [PATCH 563/682] CRW --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 75ecd7111..c4bf3c9aa 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\", \"name\": \"syscoin\",\"rpcport\":8368,\"pubtype\":0, \"p2shtype\":5, \"wiftype\":128, \"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 8c1ed499d80629bc5c09ed922a293e86d11d116b Mon Sep 17 00:00:00 2001 From: Nazmul Alam Date: Fri, 11 Aug 2017 05:44:06 -0400 Subject: [PATCH 564/682] added marketmaker makefile for static libnanomsg, removed the broken makefile Signed-off-by: Nazmul Alam --- iguana/m_MM_StaticNanoMsg | 7 ------- iguana/m_mm_StaticNanoMsg | 28 ++++++++++++++++++++++++++++ iguana/secp256k1/m_unix_Makefile | 7 +++++++ 3 files changed, 35 insertions(+), 7 deletions(-) delete mode 100644 iguana/m_MM_StaticNanoMsg create mode 100755 iguana/m_mm_StaticNanoMsg create mode 100644 iguana/secp256k1/m_unix_Makefile diff --git a/iguana/m_MM_StaticNanoMsg b/iguana/m_MM_StaticNanoMsg deleted file mode 100644 index df84288ea..000000000 --- a/iguana/m_MM_StaticNanoMsg +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -#./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery -rm -f marketmaker -git pull -cd secp256k1; ./m_unix; cd .. -cd ../crypto777; make -f m_LP_StaticNanoMsg all; make -f m_LP_StaticNanoMsg clean; cd ../iguana -gcc -g -o marketmaker -I../crypto777 exchanges/mm.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a ../OSlibs/linux/$(uname -m)/libnanomsg-static.a -lcurl -lpthread -lm diff --git a/iguana/m_mm_StaticNanoMsg b/iguana/m_mm_StaticNanoMsg new file mode 100755 index 000000000..cab8ae51b --- /dev/null +++ b/iguana/m_mm_StaticNanoMsg @@ -0,0 +1,28 @@ +# makefile for marketmaker uses static nanomsg +# author: fadedreamz@SuperNet.org +# date: Aug, 2017 + +LIB_ARCH=$(uname -m) + +.PHONY: clean all + +err: + @echo "no rule specified, use {clean,all}" + exit 1 + +clean: + - rm -f ../agents/iguana *.o + - rm ../agents/marketmaker + +all: + @echo "Add -j(core count + 1) to speed up build - e,g make -j5 -f m_mm_StaticNanoMsg; on a quad core cpu" + +$(MAKE) -C secp256k1 -f m_unix_Makefile all + +$(MAKE) -C ../crypto777 -f m_LP_StaticNanoMsg all + +$(MAKE) -C ../crypto777 -f m_LP_StaticNanoMsg clean + $(CC) -o ../agents/marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c secp256k1.o ../agents/libcrypto777.a ../OSlibs/linux/$(shell uname -m)/libnanomsg-static.a -lcurl -lpthread -lm -lanl + @echo "===========================" + @echo " marketmaker -> `pwd`/../agents/marketmaker" + @echo "===========================" + + + diff --git a/iguana/secp256k1/m_unix_Makefile b/iguana/secp256k1/m_unix_Makefile new file mode 100644 index 000000000..9457ed849 --- /dev/null +++ b/iguana/secp256k1/m_unix_Makefile @@ -0,0 +1,7 @@ +# author: fadedreamz@SuperNet.org +# date: August, 2017 + +all: + gcc -c -o ../secp256k1.o -I. -I./src -I./include -I./src -O3 -W -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -fvisibility=hidden -DHAVE_CONFIG_H src/secp256k1.c + +.PHONY: all From cd6ed9a21f8fd54c5ef1e087c489d5026887e551 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 11 Aug 2017 21:35:18 +0200 Subject: [PATCH 565/682] UIS --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index c4bf3c9aa..a0ef5ac81 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 57cb61f98417435c858b2e3b2d6cd684d33151c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Aug 2017 15:04:50 +0200 Subject: [PATCH 566/682] Test --- crypto777/hmac/sha256.c | 54 ++++++++++++++++++++--------------------- crypto777/scrypt.c | 34 +++++++++++++------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/crypto777/hmac/sha256.c b/crypto777/hmac/sha256.c index 29dceaa2e..99ca18f8a 100755 --- a/crypto777/hmac/sha256.c +++ b/crypto777/hmac/sha256.c @@ -28,9 +28,9 @@ const struct ltc_hash_descriptor sha256_desc = { 2, 16, 840, 1, 101, 3, 4, 2, 1, }, 9, - &sha256_init, - &sha256_process, - &sha256_done, + &sha256i_init, + &sha256i_process, + &sha256i_done, &sha256_test, NULL }; @@ -227,7 +227,7 @@ int sha256_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -HASH_PROCESS(sha256_process, sha256_compress, sha256, 64) +HASH_PROCESS(sha256i_process, sha256_compress, sha256, 64) /** Terminate the hash to get the digest @@ -235,7 +235,7 @@ HASH_PROCESS(sha256_process, sha256_compress, sha256, 64) @param out [out] The destination of the hash (32 bytes) @return CRYPT_OK if successful */ -int sha256_done(hash_state * md, unsigned char *out) +int sha256i_done(hash_state * md, unsigned char *out) { int i; @@ -287,9 +287,9 @@ int sha256_done(hash_state * md, unsigned char *out) void calc_sha256(char hashstr[(256 >> 3) * 2 + 1],uint8_t hash[256 >> 3],uint8_t *src,int32_t len) { hash_state md; - sha256_init(&md); - sha256_process(&md,src,len); - sha256_done(&md,hash); + sha256i_init(&md); + sha256i_process(&md,src,len); + sha256i_done(&md,hash); if ( hashstr != 0 ) { int32_t init_hexbytes_noT(char *hexbytes,uint8_t *message,long len); @@ -300,11 +300,11 @@ void calc_sha256(char hashstr[(256 >> 3) * 2 + 1],uint8_t hash[256 >> 3],uint8_t void calc_sha256cat(uint8_t hash[256 >> 3],uint8_t *src,int32_t len,uint8_t *src2,int32_t len2) { hash_state md; - sha256_init(&md); - sha256_process(&md,src,len); + sha256i_init(&md); + sha256i_process(&md,src,len); if ( src2 != 0 ) - sha256_process(&md,src2,len2); - sha256_done(&md,hash); + sha256i_process(&md,src2,len2); + sha256i_done(&md,hash); } void update_sha256(uint8_t hash[256 >> 3],struct sha256_state *state,uint8_t *src,int32_t len) @@ -312,14 +312,14 @@ void update_sha256(uint8_t hash[256 >> 3],struct sha256_state *state,uint8_t *sr hash_state md; memset(&md,0,sizeof(md)); if ( src == 0 ) - sha256_init(&md); + sha256i_init(&md); else { md.sha256 = *state; - sha256_process(&md,src,len); + sha256i_process(&md,src,len); } *state = md.sha256; - sha256_done(&md,hash); + sha256i_done(&md,hash); } /*void calc_OP_HASH160(char hexstr[41],uint8_t hash160[20],char *pubkey) @@ -334,9 +334,9 @@ void update_sha256(uint8_t hash[256 >> 3],struct sha256_state *state,uint8_t *sr return; } decode_hex(buf,len,pubkey); - sha256_init(&md); - sha256_process(&md,buf,len); - sha256_done(&md,sha256); + sha256i_init(&md); + sha256i_process(&md,buf,len); + sha256i_done(&md,sha256); rmd160_init(&md); rmd160_process(&md,sha256,256 >> 3); @@ -389,9 +389,9 @@ int sha256_test(void) char *str; for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { - sha256_init(&md); - sha256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); - sha256_done(&md, tmp); + sha256i_init(&md); + sha256i_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + sha256i_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { for (j=0; j<32; j++) printf("%02x",tmp[j]); @@ -400,16 +400,16 @@ int sha256_test(void) strcpy(str,(char*)tests[i].msg); reverse_hexstr(str); printf("reversed.(%s)\n",str); - sha256_init(&md); - sha256_process(&md, (unsigned char*)str, (unsigned long)strlen(str)); - sha256_done(&md, tmp); + sha256i_init(&md); + sha256i_process(&md, (unsigned char*)str, (unsigned long)strlen(str)); + sha256i_done(&md, tmp); for (j=0; j<32; j++) printf("%02x",tmp[j]); printf(" <- sha256(%s)\n",str); decode_hex(buf,(int)strlen(tests[i].msg),tests[i].msg); - sha256_init(&md); - sha256_process(&md, (unsigned char*)buf, (unsigned long)strlen(tests[i].msg)/2); - sha256_done(&md, tmp); + sha256i_init(&md); + sha256i_process(&md, (unsigned char*)buf, (unsigned long)strlen(tests[i].msg)/2); + sha256i_done(&md, tmp); for (j=0; j<32; j++) printf("%02x",tmp[j]); printf(" <- sha256(binary %s)\n",tests[i].msg); diff --git a/crypto777/scrypt.c b/crypto777/scrypt.c index fa482eaf8..1b156a286 100755 --- a/crypto777/scrypt.c +++ b/crypto777/scrypt.c @@ -69,7 +69,7 @@ static const uint32_t sha256_k[64] = { 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; -static inline void sha256_init(uint32_t *state) +static inline void scrypt_sha256_init(uint32_t *state) { memcpy(state, sha256_h, 32); } @@ -102,7 +102,7 @@ W[i] + sha256_k[i]) #define swab32(x) ((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) | (((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu)) -static inline void sha256_transform(uint32_t *state, const uint32_t *block, int swap) +static inline void scrypt_sha256_transform(uint32_t *state, const uint32_t *block, int swap) { uint32_t W[64]; uint32_t S[8]; @@ -203,29 +203,29 @@ static inline void HMAC_SHA256_80_init(const uint32_t *key,uint32_t *tstate, uin /* tstate is assumed to contain the midstate of key */ memcpy(pad, key + 16, 16); memcpy(pad + 4, keypad, 48); - sha256_transform(tstate, pad, 0); + scrypt_sha256_transform(tstate, pad, 0); memcpy(ihash, tstate, 32); - sha256_init(ostate); + scrypt_sha256_init(ostate); for (i = 0; i < 8; i++) pad[i] = ihash[i] ^ 0x5c5c5c5c; for (; i < 16; i++) pad[i] = 0x5c5c5c5c; - sha256_transform(ostate, pad, 0); + scrypt_sha256_transform(ostate, pad, 0); - sha256_init(tstate); + scrypt_sha256_init(tstate); for (i = 0; i < 8; i++) pad[i] = ihash[i] ^ 0x36363636; for (; i < 16; i++) pad[i] = 0x36363636; - sha256_transform(tstate, pad, 0); + scrypt_sha256_transform(tstate, pad, 0); } static inline void PBKDF2_SHA256_80_128(const uint32_t *tstate,const uint32_t *ostate, const uint32_t *salt, uint32_t *output) { uint32_t istate[8], ostate2[8],ibuf[16], obuf[16]; int i, j; memcpy(istate, tstate, 32); - sha256_transform(istate, salt, 0); + scrypt_sha256_transform(istate, salt, 0); memcpy(ibuf, salt + 16, 16); memcpy(ibuf + 5, innerpad, 44); memcpy(obuf + 8, outerpad, 32); @@ -233,9 +233,9 @@ static inline void PBKDF2_SHA256_80_128(const uint32_t *tstate,const uint32_t *o { memcpy(obuf, istate, 32); ibuf[4] = i + 1; - sha256_transform(obuf, ibuf, 0); + scrypt_sha256_transform(obuf, ibuf, 0); memcpy(ostate2, ostate, 32); - sha256_transform(ostate2, obuf, 0); + scrypt_sha256_transform(ostate2, obuf, 0); for (j = 0; j < 8; j++) output[8 * i + j] = swab32(ostate2[j]); } @@ -244,12 +244,12 @@ static inline void PBKDF2_SHA256_80_128(const uint32_t *tstate,const uint32_t *o static inline void PBKDF2_SHA256_128_32(uint32_t *tstate, uint32_t *ostate,const uint32_t *salt, uint32_t *output) { uint32_t buf[16]; int i; - sha256_transform(tstate, salt, 1); - sha256_transform(tstate, salt + 16, 1); - sha256_transform(tstate, finalblk, 0); + scrypt_sha256_transform(tstate, salt, 1); + scrypt_sha256_transform(tstate, salt + 16, 1); + scrypt_sha256_transform(tstate, finalblk, 0); memcpy(buf, tstate, 32); memcpy(buf + 8, outerpad, 32); - sha256_transform(ostate, buf, 0); + scrypt_sha256_transform(ostate, buf, 0); for (i = 0; i < 8; i++) output[i] = swab32(ostate[i]); } @@ -363,11 +363,11 @@ void calc_scrypthash(uint32_t *hash,void *data) uint8_t *scratchbuf; uint32_t midstate[8]; memset(midstate,0,sizeof(midstate)); memset(hash,0,32); - sha256_init(midstate); - sha256_transform(midstate,(void *)data,0); + scrypt_sha256_init(midstate); + scrypt_sha256_transform(midstate,(void *)data,0); scratchbuf = malloc(1024 * 128 + 64); scrypt_1024_1_1_256((void *)data,hash,midstate,scratchbuf,1024); free(scratchbuf); } //010000000000000000000000000000000000000000000000000000000000000000000000d9ced4ed1130f7b7faad9be25323ffafa33232a17c3edf6cfd97bee6bafbdd97b9aa8e4ef0ff0f1ecd513f7c -//010000000000000000000000000000000000000000000000000000000000000000000000d9ced4ed1130f7b7faad9be25323ffafa33232a17c3edf6cfd97bee6bafbdd97b9aa8e4ef0ff0f1ecd513f7c00 \ No newline at end of file +//010000000000000000000000000000000000000000000000000000000000000000000000d9ced4ed1130f7b7faad9be25323ffafa33232a17c3edf6cfd97bee6bafbdd97b9aa8e4ef0ff0f1ecd513f7c00 From c61fe89daab8c17ad3c660a5aebcb02f875eab63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Aug 2017 15:08:44 +0200 Subject: [PATCH 567/682] Test --- crypto777/hmac/sha256.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/crypto777/hmac/sha256.c b/crypto777/hmac/sha256.c index 99ca18f8a..e3b6a27b9 100755 --- a/crypto777/hmac/sha256.c +++ b/crypto777/hmac/sha256.c @@ -17,24 +17,6 @@ //#ifdef LTC_SHA256 -const struct ltc_hash_descriptor sha256_desc = -{ - "sha256", - 0, - 32, - 64, - - /* OID */ - { 2, 16, 840, 1, 101, 3, 4, 2, 1, }, - 9, - - &sha256i_init, - &sha256i_process, - &sha256i_done, - &sha256_test, - NULL -}; - #ifdef LTC_SMALL_CODE /* the K array */ static const ulong32 K[64] = { @@ -203,7 +185,7 @@ static int sha256_compress(hash_state * md, unsigned char *buf) @param md The hash state you wish to initialize @return CRYPT_OK if successful */ -int sha256_init(hash_state * md) +int sha256i_init(hash_state * md) { LTC_ARGCHK(md != NULL); @@ -436,6 +418,24 @@ int sha256_test(void) #undef Maj +const struct ltc_hash_descriptor sha256_desc = +{ + "sha256", + 0, + 32, + 64, + + /* OID */ + { 2, 16, 840, 1, 101, 3, 4, 2, 1, }, + 9, + + &sha256i_init, + &sha256i_process, + &sha256i_done, + &sha256_test, + NULL +}; + /* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha256.c,v $ */ /* $Revision: 1.11 $ */ From d525426412457986577770ce180fd89b3fcc4e06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Aug 2017 15:18:19 +0200 Subject: [PATCH 568/682] Test --- crypto777/hmac/sha224.c | 4 ++-- crypto777/hmac/tomcrypt_hash.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto777/hmac/sha224.c b/crypto777/hmac/sha224.c index 78a0bfb84..683440d70 100755 --- a/crypto777/hmac/sha224.c +++ b/crypto777/hmac/sha224.c @@ -26,7 +26,7 @@ const struct ltc_hash_descriptor sha224_desc = 9, &sha224_init, - &sha256_process, + &sha256i_process, &sha224_done, &sha224_test, NULL @@ -69,7 +69,7 @@ int sha224_done(hash_state * md, unsigned char *out) LTC_ARGCHK(md != NULL); LTC_ARGCHK(out != NULL); - err = sha256_done(md, buf); + err = sha256i_done(md, buf); XMEMCPY(out, buf, 28); #ifdef LTC_CLEAN_STACK zeromem(buf, sizeof(buf)); diff --git a/crypto777/hmac/tomcrypt_hash.h b/crypto777/hmac/tomcrypt_hash.h index b596c6a37..de5977437 100755 --- a/crypto777/hmac/tomcrypt_hash.h +++ b/crypto777/hmac/tomcrypt_hash.h @@ -228,9 +228,9 @@ extern const struct ltc_hash_descriptor sha384_desc; #endif #ifdef LTC_SHA256 -int sha256_init(hash_state * md); -int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen); -int sha256_done(hash_state * md, unsigned char *hash); +int sha256i_init(hash_state * md); +int sha256i_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int sha256i_done(hash_state * md, unsigned char *hash); int sha256_test(void); extern const struct ltc_hash_descriptor sha256_desc; @@ -239,7 +239,7 @@ extern const struct ltc_hash_descriptor sha256_desc; #error LTC_SHA256 is required for LTC_SHA224 #endif int sha224_init(hash_state * md); -#define sha224_process sha256_process +#define sha224_process sha256i_process int sha224_done(hash_state * md, unsigned char *hash); int sha224_test(void); extern const struct ltc_hash_descriptor sha224_desc; From f6c22220d6bc58109d6fb975571f238aa874a8c6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Aug 2017 21:51:31 +0200 Subject: [PATCH 569/682] Uis fix --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index a0ef5ac81..81f7c42dd 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From ffe39228cf6675ec6735f95126260bf76cc0b926 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 16 Aug 2017 16:31:53 +0200 Subject: [PATCH 570/682] Test --- iguana/exchanges/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 92794c535..3c98b48f5 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -669,6 +669,8 @@ void stats_rpcloop(void *args) //printf("RETURN.(%s) jsonflag.%d postflag.%d\n",retstr,jsonflag,postflag); if ( jsonflag != 0 || postflag != 0 ) { + if ( retstr == 0 ) + retstr = clonestr("{}"); response = malloc(strlen(retstr)+1024+1+1); sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr)); response[0] = '\0'; From ec3b81d5d6a98278e6278486cc34f7d79889cf85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 Aug 2017 08:26:47 +0200 Subject: [PATCH 571/682] Reduce HUSH fee --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 81f7c42dd..e049aaa17 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 8ca521aeb4671f64285e83f549cfe2253a197bcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 Aug 2017 23:03:39 +0200 Subject: [PATCH 572/682] HODLcoin --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index e049aaa17..f87dadab4 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 192571d51c1381eddf200a930f432be54337651d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 19 Aug 2017 12:46:05 +0200 Subject: [PATCH 573/682] Undef strict peers --- iguana/exchanges/LP_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 2f054f70a..cee379ee3 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -21,7 +21,7 @@ #ifndef LP_INCLUDE_H #define LP_INCLUDE_H -#define LP_STRICTPEERS +//#define LP_STRICTPEERS #define LP_COMMAND_SENDSOCK NN_PUSH #define LP_COMMAND_RECVSOCK NN_PULL From a11e51f94624c6d7f7bd618a1ad7fa030cda1832 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 20 Aug 2017 22:30:41 +0200 Subject: [PATCH 574/682] ZER --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index f87dadab4..d1c8f4173 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 71ece903cf57de5241009e68d78f631614e85540 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 20 Aug 2017 22:43:25 +0200 Subject: [PATCH 575/682] GLT --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index d1c8f4173..89d4cf5f6 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 9491343a1fca999f9289ca1b85c568f28980e67a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Aug 2017 22:50:07 +0200 Subject: [PATCH 576/682] Test --- iguana/iguana_ramchain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 64ca06287..e65e0e4e9 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1903,10 +1903,11 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, { tx = &txarray[i]; iguana_ramchain_addtxid(coin,RAMCHAIN_ARG,tx->txid,tx->tx_out,tx->tx_in,tx->lock_time,tx->version,tx->timestamp,bundlei); - if ( tx->tx_out == 0 && tx->tx_in == 0 ) + if ( tx->tx_out == 0 ) { - printf("strange tx without any inputs or outputs? ht.%d\n",bp->bundleheight); - break; + if ( coin->chain->zcash == 0 ) + printf("strange tx without any inputs or outputs? ht.%d\n",bp->bundleheight); + continue; } for (j=0; jtx_out; j++) { From a8e0c490539afbbb4d71b8807cd0ff09fc7c6bcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Aug 2017 23:11:38 +0200 Subject: [PATCH 577/682] Test --- iguana/iguana_ramchain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index e65e0e4e9..03a31edb6 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1095,7 +1095,7 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * //exit(-1); return(-4); } - if ( t->firstvin != ramchain->H.spendind ) + if ( coin->chain->zcash == 0 && t->firstvin != ramchain->H.spendind ) { printf("t[%u] firstvin.%u vs spendind.%d\n",(uint32_t)t->txidind,(uint32_t)t->firstvin,ramchain->H.spendind); return(-5); From ab55b08f5b1c64a9c9bcf1ce3c3aa53583684967 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Aug 2017 23:53:06 +0200 Subject: [PATCH 578/682] Test --- iguana/iguana_msg.c | 4 ++-- iguana/iguana_ramchain.c | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index 8ad05f5d9..bbdd7a6d6 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -640,7 +640,7 @@ int32_t iguana_rwtx(struct supernet_info *myinfo,uint8_t zcash,int32_t rwflag,st len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->timestamp),&msg->timestamp); } len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_in); - if ( rwflag == 0 ) + if ( rwflag == 0 && msg->tx_in > 0 ) msg->vins = iguana_memalloc(mem,msg->tx_in * sizeof(*msg->vins),1); if ( maxsize-len <= 0 ) return(-1); @@ -671,7 +671,7 @@ int32_t iguana_rwtx(struct supernet_info *myinfo,uint8_t zcash,int32_t rwflag,st return(-1); } //printf("numvouts.%d ",msg->tx_out); - if ( rwflag == 0 ) + if ( rwflag == 0 && msg->tx_out > 0 ) msg->vouts = iguana_memalloc(mem,msg->tx_out * sizeof(*msg->vouts),1); for (i=0; itx_out; i++) { diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 03a31edb6..88119da75 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -184,7 +184,7 @@ uint32_t iguana_ramchain_addtxid(struct iguana_info *coin,RAMCHAIN_FUNC,bits256 { if ( t->txidind != txidind || memcmp(t->txid.bytes,txid.bytes,sizeof(bits256)) != 0 || t->numvouts != numvouts || t->numvins != numvins || t->firstvout != ramchain->H.unspentind || t->firstvin != ramchain->H.spendind || t->locktime != locktime || t->version != version || t->timestamp != timestamp ) { - printf("iguana_ramchain_addtxid.RO: addtxid mismatch (%u %d %d %u %u) vs. (%d %d %d %d %d)\n",(uint32_t)t->txidind,t->numvouts,t->numvins,(uint32_t)t->firstvout,(uint32_t)t->firstvin,txidind,numvouts,numvins,ramchain->H.unspentind,ramchain->H.spendind); + printf("iguana_ramchain_addtxid.RO: addtxid mismatch b.%d (%u %d %d %u %u) vs. (%d %d %d %d %d)\n",bundlei,(uint32_t)t->txidind,t->numvouts,t->numvins,(uint32_t)t->firstvout,(uint32_t)t->firstvin,txidind,numvouts,numvins,ramchain->H.unspentind,ramchain->H.spendind); //getchar(); return(0); } @@ -1095,7 +1095,7 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * //exit(-1); return(-4); } - if ( coin->chain->zcash == 0 && t->firstvin != ramchain->H.spendind ) + if ( t->firstvin != ramchain->H.spendind ) { printf("t[%u] firstvin.%u vs spendind.%d\n",(uint32_t)t->txidind,(uint32_t)t->firstvin,ramchain->H.spendind); return(-5); @@ -1126,7 +1126,7 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * return(-3); } } - for (k=0; knumvouts; k++,ramchain->H.unspentind++) + for (k=0; knumvouts; k++) { u = &Ux[ramchain->H.unspentind]; if ( u->txidind != ramchain->H.txidind ) @@ -1148,17 +1148,19 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * printf("%p itemind.%d pkind.%d %d unspentind?\n",p,ptr->hh.itemind,pkind,ramchain->H.unspentind); return(-9); } + ramchain->H.unspentind++; } } else { - for (k=0; knumvouts; k++,ramchain->H.unspentind++) + for (k=0; knumvouts; k++) { if ( U[ramchain->H.unspentind].txidind != ramchain->H.txidind ) { printf(" k.%d U.%d u->txidind.%x != txidind.%d\n",k,ramchain->H.unspentind,U[ramchain->H.unspentind].txidind,ramchain->H.txidind); return(-6); } + ramchain->H.unspentind++; } } ramchain->H.spendind += t->numvins; @@ -1167,7 +1169,7 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * for (ramchain->H.txidind=rdata->firsti; ramchain->H.txidindnumtxids; ramchain->H.txidind++) { t = &T[ramchain->H.txidind]; - for (k=0; knumvins; k++,ramchain->H.spendind++) + for (k=0; knumvins; k++) { if ( ramchain->expanded != 0 ) { @@ -1190,6 +1192,7 @@ int32_t iguana_ramchain_verify(struct iguana_info *coin,struct iguana_ramchain * } } } + ramchain->H.spendind++; } } if ( ramchain->expanded != 0 && ramchain->A != ramchain->creditsA ) @@ -1899,7 +1902,7 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, } if ( block != 0 ) block->fpipbits = 1; - for (i=0; iH.txidind++) + for (i=0; itxid,tx->tx_out,tx->tx_in,tx->lock_time,tx->version,tx->timestamp,bundlei); @@ -1916,16 +1919,18 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, iguana_ramchain_addunspent20(coin,addr,RAMCHAIN_ARG,tx->vouts[j].value,tx->vouts[j].pk_script,tx->vouts[j].pk_scriptlen,tx->txid,j,-1,bp,rmd160); } ramchain->H.spendind += tx->tx_in; + ramchain->H.txidind++; } //printf("scriptoffset.%d after %d txids\n",ramchain->H.scriptoffset,txn_count); ramchain->H.txidind = ramchain->H.spendind = rdata->firsti; - for (i=0; iH.txidind++) + for (i=0; itx_in; j++) { iguana_ramchain_addspend256(coin,addr,RAMCHAIN_ARG,tx->vins[j].prev_hash,tx->vins[j].prev_vout,tx->vins[j].vinscript,tx->vins[j].scriptlen,tx->vins[j].sequence,bp);//,bp->hdrsi,bundlei); } + ramchain->H.txidind++; } rdata->prevhash2 = origtxdata->zblock.RO.prev_block; rdata->scriptspace = scriptspace = ramchain->H.scriptoffset; From fe3e4ffca7c72460ebb9e614edb59b5d9bcc8187 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 00:07:24 +0200 Subject: [PATCH 579/682] Test --- iguana/iguana_ramchain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 88119da75..6670e95e7 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1658,6 +1658,8 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info printf("iguana_ramchain_iterate cant iterate without data\n"); return(-1); } + if ( rdata->firsti != 1 ) + printf("unexpected firsti.%d %s.%d\n",rdata->firsti,coin->symbol,bundlei); if ( dest != 0 ) { // required to do one block at a time, all vins/vouts the same height are assumed to happen simultaneously with vouts before vins From 22c92a3c73c6752787396e2ff7c393675048bcf0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 00:23:06 +0200 Subject: [PATCH 580/682] Test --- iguana/iguana_ramchain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 6670e95e7..4ee760656 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -2495,13 +2495,15 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,uint32_t starttime) // helper thread { static int depth; - RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; + RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; struct iguana_blockRO _destB; void **ptrs; long *filesizes; uint32_t *ipbits; char fname[1024]; struct iguana_ramchain *R,*mapchain,*dest,newchain; uint32_t fpipbits; bits256 prevhash2; int32_t i,starti,endi,bp_n,numtxids,valid,sigspace,pubkeyspace,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_block *block; long fpos; struct OS_memspace HASHMEM; int32_t err,j,num,bundlei,firsti= 1,retval = -1; memset(&HASHMEM,0,sizeof(HASHMEM)); starti = 0, endi = bp->n - 1; + destB = &_destB; + memset(destB,0,sizeof(*destB)); //B = 0, Ux = 0, Sx = 0, P = 0, A = 0, X = 0, Kspace = TXbits = PKbits = 0, U = 0, S = 0, T = 0; R = mycalloc('s',bp->n,sizeof(*R)); ptrs = mycalloc('w',bp->n,sizeof(*ptrs)); From 9f12b1fcf0daad28b86cf25b88b51fd00931dc61 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 00:29:06 +0200 Subject: [PATCH 581/682] Test --- iguana/iguana_ramchain.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 4ee760656..ab73a9502 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -2495,15 +2495,17 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,uint32_t starttime) // helper thread { static int depth; - RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; struct iguana_blockRO _destB; + RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; static struct iguana_blockRO *_destB; void **ptrs; long *filesizes; uint32_t *ipbits; char fname[1024]; struct iguana_ramchain *R,*mapchain,*dest,newchain; uint32_t fpipbits; bits256 prevhash2; int32_t i,starti,endi,bp_n,numtxids,valid,sigspace,pubkeyspace,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_block *block; long fpos; struct OS_memspace HASHMEM; int32_t err,j,num,bundlei,firsti= 1,retval = -1; memset(&HASHMEM,0,sizeof(HASHMEM)); starti = 0, endi = bp->n - 1; - destB = &_destB; - memset(destB,0,sizeof(*destB)); + if ( _destB == 0 ) + _destB = malloc(sizeof(*_destB) * 2000); + destB = _destB; + memset(destB,0,sizeof(*destB) * bp->n); //B = 0, Ux = 0, Sx = 0, P = 0, A = 0, X = 0, Kspace = TXbits = PKbits = 0, U = 0, S = 0, T = 0; R = mycalloc('s',bp->n,sizeof(*R)); ptrs = mycalloc('w',bp->n,sizeof(*ptrs)); From b4a1ea66112dad5a7f88d726e1a35da463f625c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 00:39:08 +0200 Subject: [PATCH 582/682] Test --- iguana/iguana_blocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 3c65b069c..89e0e4fc6 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -307,7 +307,7 @@ int32_t iguana_blocksizecheck(char *debugstr,uint8_t zcash,struct iguana_block * int32_t iguana_blockROsize(uint8_t zcash) { - return((int32_t)(sizeof(struct iguana_blockRO) + zcash*sizeof(struct iguana_msgzblockhdr))); + return((int32_t)(sizeof(struct iguana_zblockRO) + zcash*sizeof(struct iguana_msgzblockhdr))); } void *iguana_blockzcopyRO(uint8_t zcash,struct iguana_blockRO *dest,int32_t desti,struct iguana_blockRO *src,int32_t srci) From 35a9803b8ca2764e28f1b5803124375773ddba75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 00:47:32 +0200 Subject: [PATCH 583/682] Test --- iguana/iguana_blocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 89e0e4fc6..3c65b069c 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -307,7 +307,7 @@ int32_t iguana_blocksizecheck(char *debugstr,uint8_t zcash,struct iguana_block * int32_t iguana_blockROsize(uint8_t zcash) { - return((int32_t)(sizeof(struct iguana_zblockRO) + zcash*sizeof(struct iguana_msgzblockhdr))); + return((int32_t)(sizeof(struct iguana_blockRO) + zcash*sizeof(struct iguana_msgzblockhdr))); } void *iguana_blockzcopyRO(uint8_t zcash,struct iguana_blockRO *dest,int32_t desti,struct iguana_blockRO *src,int32_t srci) From af841e56e0f1b7ef1c4571728d3716d6c016c2af Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:11:19 +0200 Subject: [PATCH 584/682] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- iguana/exchanges/LP_scan.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7af18862c..36706a094 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -120,7 +120,7 @@ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ -trust(pubkey, trust)\n\ +snapshot(coin, height)\n\ \"}")); base = jstr(argjson,"base"); @@ -246,6 +246,12 @@ trust(pubkey, trust)\n\ ptr->inactive = (uint32_t)time(NULL); return(jprint(LP_coinsjson(0),1)); } + else if ( strcmp(method,"snapshot") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + ptr->inactive = (uint32_t)time(NULL); + return(jprint(LP_snapshot(ptr,juint(argjson,"height")),1)); + } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); if ( strcmp(method,"inventory") == 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 045d4092e..539570913 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -18,6 +18,7 @@ // marketmaker // + struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) { struct LP_transaction *tx; @@ -199,6 +200,37 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) else return(-1); } +cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) +{ + struct LP_transaction *tx,*tmp; int32_t i,ht; uint64_t balance=0; cJSON *retjson,*array; + for (ht=1; httxmutex); + HASH_ITER(hh,coin->transactions,tx,tmp) + { + if ( tx->height < height ) + { + for (i=0; inumvouts; i++) + { + if ( (ht=tx->outpoints[i].spendheight) > 0 && ht < height ) + continue; + balance += tx->outpoints[i].value; + } + } + } + portable_mutex_unlock(&coin->txmutex); + printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); + retjson = cJSON_CreateObject(); + array = cJSON_CreateArray(); + jadd(retjson,"balances",array); + jaddnum(retjson,"total",dstr(balance)); + return(retjson); +} + int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) { char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; From bb6272c91d6110d19d4dae7372c4000e6ce2be7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:15:13 +0200 Subject: [PATCH 585/682] Test --- iguana/exchanges/snapshot | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 iguana/exchanges/snapshot diff --git a/iguana/exchanges/snapshot b/iguana/exchanges/snapshot new file mode 100755 index 000000000..71bf61c95 --- /dev/null +++ b/iguana/exchanges/snapshot @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\:height\":2000}" From 56620a7f8e31eb4a3882e78bdac737bc866ac93c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:16:58 +0200 Subject: [PATCH 586/682] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 36706a094..b443e9f38 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -248,6 +248,7 @@ snapshot(coin, height)\n\ } else if ( strcmp(method,"snapshot") == 0 ) { + printf("snapshot\n"); if ( (ptr= LP_coinsearch(coin)) != 0 ) ptr->inactive = (uint32_t)time(NULL); return(jprint(LP_snapshot(ptr,juint(argjson,"height")),1)); From 34c4def24a95525bf2d5985624b8efd4e87662e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:26:09 +0200 Subject: [PATCH 587/682] Test --- iguana/exchanges/LP_scan.c | 4 ++++ iguana/exchanges/snapshot | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 539570913..27a173126 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -204,11 +204,15 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { struct LP_transaction *tx,*tmp; int32_t i,ht; uint64_t balance=0; cJSON *retjson,*array; for (ht=1; httxmutex); HASH_ITER(hh,coin->transactions,tx,tmp) { diff --git a/iguana/exchanges/snapshot b/iguana/exchanges/snapshot index 71bf61c95..4e88851fd 100755 --- a/iguana/exchanges/snapshot +++ b/iguana/exchanges/snapshot @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\:height\":2000}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":2000}" From 1f948e05a6defe94359af90832fe202e13ed476d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:28:03 +0200 Subject: [PATCH 588/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index e210b96df..d0ce52fde 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -397,7 +397,7 @@ cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t hei *heightp = juint(json,"height"); if ( height >= 0 && *heightp != height ) { - printf("unexpected height %d vs %d\n",*heightp,height); + printf("unexpected height %d vs %d for %s\n",*heightp,height,blockhashstr); *heightp = -1; free_json(json); json = 0; From 7779312cc80000144819578a658a9c3f9ffc5dc7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:30:01 +0200 Subject: [PATCH 589/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index d0ce52fde..2236b1d29 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -397,7 +397,7 @@ cJSON *LP_blockjson(int32_t *heightp,char *symbol,char *blockhashstr,int32_t hei *heightp = juint(json,"height"); if ( height >= 0 && *heightp != height ) { - printf("unexpected height %d vs %d for %s\n",*heightp,height,blockhashstr); + printf("unexpected height %d vs %d for %s (%s)\n",*heightp,height,blockhashstr,jprint(json,0)); *heightp = -1; free_json(json); json = 0; From b67543219744dfc09a07d9d01038dfa71c5b771a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 01:32:50 +0200 Subject: [PATCH 590/682] Test --- iguana/exchanges/LP_commands.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index b443e9f38..13b8d9741 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -248,10 +248,9 @@ snapshot(coin, height)\n\ } else if ( strcmp(method,"snapshot") == 0 ) { - printf("snapshot\n"); if ( (ptr= LP_coinsearch(coin)) != 0 ) - ptr->inactive = (uint32_t)time(NULL); - return(jprint(LP_snapshot(ptr,juint(argjson,"height")),1)); + return(jprint(LP_snapshot(ptr,juint(argjson,"height")),1)); + else return(clonestr("{\"error\":\"cant find coind\"}")); } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); From 94d17f27122841e13fd1b7372b7fdb21485c62fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 08:59:27 +0200 Subject: [PATCH 591/682] Test --- iguana/exchanges/LP_scan.c | 47 +++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 27a173126..f73493373 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -200,18 +200,50 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) else return(-1); } -cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) +int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t endheight) { - struct LP_transaction *tx,*tmp; int32_t i,ht; uint64_t balance=0; cJSON *retjson,*array; - for (ht=1; htsymbol,lastcoin) == 0 ) + { + if ( maxsnapht > height ) + skipflag = 1; + else startht = maxsnapht+1; + } + else + { + maxsnapht = 0; + strcpy(lastcoin,coin->symbol); + } + retjson = cJSON_CreateObject(); + if ( skipflag == 0 && startht < endht ) + { + if ( LP_scanblockchain(coin,startht,endht) < 0 ) + { + jaddstr(retjson,"error","blockchain scan error"); + return(retjson); } - if ( (ht % 1000) == 0 ) - fprintf(stderr,"%.1f%% ",100. * (double)ht/height); + if ( endht > maxsnapht ) + maxsnapht = endht; } portable_mutex_lock(&coin->txmutex); HASH_ITER(hh,coin->transactions,tx,tmp) @@ -228,7 +260,6 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); - retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); jadd(retjson,"balances",array); jaddnum(retjson,"total",dstr(balance)); From 7567d4f24161383b9ab8c73381697a68b2665569 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 09:17:09 +0200 Subject: [PATCH 592/682] ARG --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 89d4cf5f6..92928de56 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 20593d512da02283d2c32cec32878aa322c26668 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 09:55:45 +0200 Subject: [PATCH 593/682] Test --- iguana/exchanges/LP_include.h | 11 ++++-- iguana/exchanges/LP_scan.c | 66 ++++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index cee379ee3..e630c13ea 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -166,7 +166,7 @@ struct basilisk_swapinfo uint8_t userdata_bobrefund[256],userdata_bobrefundlen; }; -struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; }; +struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[40]; }; struct LP_transaction { @@ -175,10 +175,17 @@ struct LP_transaction struct LP_outpoint outpoints[]; }; +struct LP_address +{ + UT_hash_handle hh; + int64_t balance; + char coinaddr[40]; +}; + struct iguana_info { UT_hash_handle hh; - portable_mutex_t txmutex; struct LP_transaction *transactions; + portable_mutex_t txmutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock; uint16_t busport; uint32_t counter,inactive,lastmempool,lastgetinfo; diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f73493373..94875a89e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -19,6 +19,30 @@ // +struct LP_address *_LP_addressfind(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + HASH_FIND(hh,coin->addresses,coinaddr,strlen(coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + ap = calloc(1,sizeof(*ap)); + safecopy(ap->coinaddr,coinaddr,sizeof(ap->coinaddr)); + HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); + return(ap); +} + +struct LP_address *_LP_address(struct iguana_info *coin,char *coinaddr) +{ + struct LP_address *ap; + if ( (ap= _LP_addressfind(coin,coinaddr)) == 0 ) + ap = _LP_addressadd(coin,coinaddr); + return(ap); +} + struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid) { struct LP_transaction *tx; @@ -128,7 +152,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) { - struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; + struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { height = LP_txheight(×tamp,&blocktime,coin,txid); @@ -144,6 +168,16 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) if ( (tx->outpoints[i].value= SATOSHIDEN * jdouble(vout,"value")) == 0 ) tx->outpoints[i].value = SATOSHIDEN * jdouble(vout,"amount"); tx->outpoints[i].interest = SATOSHIDEN * jdouble(vout,"interest"); + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 ) + { + if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) + { + if ( n > 1 ) + printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); + if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) + strcpy(tx->outpoints[i].coinaddr,address); + } + } } } if ( vins != 0 ) @@ -220,7 +254,7 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; - struct LP_transaction *tx,*tmp; int32_t i,skipflag=0,startht,endht,ht; uint64_t balance=0; cJSON *retjson,*array; + struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t i,n,skipflag=0,startht,endht,ht; uint64_t balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; startht = 1; endht = height-1; if ( strcmp(coin->symbol,lastcoin) == 0 ) @@ -239,8 +273,12 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( LP_scanblockchain(coin,startht,endht) < 0 ) { - jaddstr(retjson,"error","blockchain scan error"); - return(retjson); + sleep(10); + if ( LP_scanblockchain(coin,startht,endht) < 0 ) + { + jaddstr(retjson,"error","blockchain scan error"); + return(retjson); + } } if ( endht > maxsnapht ) maxsnapht = endht; @@ -254,15 +292,33 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( (ht=tx->outpoints[i].spendheight) > 0 && ht < height ) continue; - balance += tx->outpoints[i].value; + if ( (ap= _LP_address(coin,tx->outpoints[i].coinaddr)) != 0 ) + { + balance += tx->outpoints[i].value; + ap->balance += tx->outpoints[i].value; + } else noaddr_balance += tx->outpoints[i].value; } } } portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); array = cJSON_CreateArray(); + n = 0; + HASH_ITER(hh,coin->addresses,ap,atmp) + { + if ( ap->balance != 0 ) + { + item = cJSON_CreateArray(); + jaddistr(item,ap->coinaddr); + jaddinum(item,dstr(ap->balance)); + jaddi(array,item); + n++; + } + } jadd(retjson,"balances",array); + jaddnum(retjson,"numaddresses",n); jaddnum(retjson,"total",dstr(balance)); + jaddnum(retjson,"noaddr_total",dstr(noaddr_balance)); return(retjson); } From 0b2554b8aa7c5e4d07c4130f08d9a01e116b7101 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:01:30 +0200 Subject: [PATCH 594/682] Test --- iguana/exchanges/LP_scan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 94875a89e..64477f85c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -175,7 +175,10 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) + { strcpy(tx->outpoints[i].coinaddr,address); + printf("%s -> %s\n",jprint(item,0),address); + } } } } From 9b02b68f261ecc602c60dcbb4d12d3eeeae1e307 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:01:45 +0200 Subject: [PATCH 595/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 64477f85c..0d7daf258 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -177,7 +177,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - printf("%s -> %s\n",jprint(item,0),address); + printf("%s -> %s\n",jprint(sobj,0),address); } } } From 0c4ec8fb794cf4ff6123e644f90da4558ef90371 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:06:32 +0200 Subject: [PATCH 596/682] Test --- iguana/exchanges/LP_scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 0d7daf258..de8ed2530 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -155,6 +155,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { + printf("TX.(%s)\n",jprint(txobj,0)); height = LP_txheight(×tamp,&blocktime,coin,txid); if ( timestamp == 0 && height > 0 ) timestamp = blocktime; @@ -175,10 +176,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) - { strcpy(tx->outpoints[i].coinaddr,address); - printf("%s -> %s\n",jprint(sobj,0),address); - } } } } From bd37a195d015d56dc433835923c7d0ad036855ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:10:45 +0200 Subject: [PATCH 597/682] Test --- iguana/exchanges/LP_scan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index de8ed2530..c759f488a 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -173,6 +173,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) { if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) { + printf("%s\n",jprint(addresses,0)); if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) @@ -297,6 +298,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { balance += tx->outpoints[i].value; ap->balance += tx->outpoints[i].value; + printf("%s/%s %.8f\n",tx->outpoints[i].coinaddr,ap->coinaddr,dstr(ap->balance)); } else noaddr_balance += tx->outpoints[i].value; } } From a7ca17d260d1ffeb90383c9f7e864115f66e7a40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:15:42 +0200 Subject: [PATCH 598/682] Test --- iguana/exchanges/LP_scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c759f488a..eccb0d8dc 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -155,7 +155,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { - printf("TX.(%s)\n",jprint(txobj,0)); + //printf("TX.(%s)\n",jprint(txobj,0)); height = LP_txheight(×tamp,&blocktime,coin,txid); if ( timestamp == 0 && height > 0 ) timestamp = blocktime; @@ -173,7 +173,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) { if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) { - printf("%s\n",jprint(addresses,0)); + //printf("%s\n",jprint(addresses,0)); if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) @@ -298,7 +298,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { balance += tx->outpoints[i].value; ap->balance += tx->outpoints[i].value; - printf("%s/%s %.8f\n",tx->outpoints[i].coinaddr,ap->coinaddr,dstr(ap->balance)); + printf("%s/%s %.8f %.8f\n",tx->outpoints[i].coinaddr,ap->coinaddr,dstr(tx->outpoints[i].value),dstr(ap->balance)); } else noaddr_balance += tx->outpoints[i].value; } } From 4fa5f46ae22aef7959a838b10a0b64721a7a4819 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 10:21:01 +0200 Subject: [PATCH 599/682] Test --- iguana/exchanges/LP_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index eccb0d8dc..cf31e7b45 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -286,6 +286,10 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) maxsnapht = endht; } portable_mutex_lock(&coin->txmutex); + HASH_ITER(hh,coin->addresses,ap,atmp) + { + ap->balance = 0; + } HASH_ITER(hh,coin->transactions,tx,tmp) { if ( tx->height < height ) From a47a3cafe1b62d2d12ba9e81cc7299096cb4e9da Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:26:36 +0200 Subject: [PATCH 600/682] Test --- iguana/exchanges/LP_scan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cf31e7b45..16359fe41 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -197,8 +197,10 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) tx->outpoints[spentvout].spendvini = i; tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); - } else printf("LP_transactioninint: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } + } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); + } else printf("LP_transactioninit: couldnt find (%s)\n",bits256_str(str,spenttxid)); + if ( bits256_cmp(spenttxid,txid) == 0 ) + printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } } free_json(txobj); @@ -257,6 +259,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t i,n,skipflag=0,startht,endht,ht; uint64_t balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; + LP_blockinit(coin,421011); startht = 1; endht = height-1; if ( strcmp(coin->symbol,lastcoin) == 0 ) From 06cbde6b5df698019c4d533f39729b742bd42150 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:30:04 +0200 Subject: [PATCH 601/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 16359fe41..afdcc38bc 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -198,7 +198,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } else printf("LP_transactioninit: couldnt find (%s)\n",bits256_str(str,spenttxid)); + } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } From 8dff18dc142d298ed533374c6308880ac6621879 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:37:53 +0200 Subject: [PATCH 602/682] Test --- iguana/exchanges/LP_scan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index afdcc38bc..9685de792 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -189,6 +189,8 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) vin = jitem(vins,i); spenttxid = jbits256(vin,"txid"); spentvout = jint(vin,"vout"); + if ( i == 0 && bits256_nonz(spenttxid) == 0 ) + continue; if ( (tx= LP_transactionfind(coin,spenttxid)) != 0 ) { if ( spentvout < tx->numvouts ) From 694b06c0ce1e2b6041de6141b7aa08022635fcf9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:47:37 +0200 Subject: [PATCH 603/682] Test --- iguana/exchanges/LP_scan.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 9685de792..8219ba1f9 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -150,7 +150,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf return(value); } -int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) +int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { struct LP_transaction *tx; char *address; int32_t i,n,height,numvouts,numvins,spentvout; uint32_t timestamp,blocktime; cJSON *txobj,*vins,*vouts,*vout,*vin,*sobj,*addresses; bits256 spenttxid; char str[65]; if ( (txobj= LP_gettx(coin->symbol,txid)) != 0 ) @@ -161,7 +161,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid) timestamp = blocktime; vins = jarray(&numvins,txobj,"vin"); vouts = jarray(&numvouts,txobj,"vout"); - if ( vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins,timestamp)) != 0 ) + if ( iter == 0 && vouts != 0 && (tx= LP_transactionadd(coin,txid,height,numvouts,numvins,timestamp)) != 0 ) { for (i=0; isymbol,0,height)) != 0 ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) { + for (iter=0; iter<2; iter++) for (i=0; iheight %d != %d\n",tx->height,height); tx->height = height; } - } else LP_transactioninit(coin,txid); + if ( iter == 1 ) + LP_transactioninit(coin,txid,iter); + } else LP_transactioninit(coin,txid,iter); } } free_json(blockobj); From c37e6a04089a8bf8f2ee0ea15d096bf8fe7781dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:49:40 +0200 Subject: [PATCH 604/682] Test --- iguana/exchanges/LP_scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 8219ba1f9..40a2d2c24 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -413,7 +413,10 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) { txid = jbits256i(array,i); if ( (tx= LP_transactionfind(coin,txid)) == 0 ) - LP_transactioninit(coin,txid); + { + LP_transactioninit(coin,txid,0); + LP_transactioninit(coin,txid,1); + } if ( bits256_cmp(txid,searchtxid) == 0 ) { char str[65]; printf("found %s tx.(%s) in mempool slot.%d\n",symbol,bits256_str(str,txid),i); From d2e2184efbb6cdbecb7377ed8b3c6b4e7e02aa99 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:52:37 +0200 Subject: [PATCH 605/682] Test --- iguana/exchanges/LP_scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 40a2d2c24..b5bc94008 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -373,7 +373,10 @@ uint64_t LP_txvalue(char *coinaddr,char *symbol,bits256 txid,int32_t vout) } else printf("vout.%d >= tx->numvouts.%d\n",vout,tx->numvouts); } if ( tx == 0 ) - LP_transactioninit(coin,txid); + { + LP_transactioninit(coin,txid,0); + LP_transactioninit(coin,txid,1); + } if ( coinaddr == 0 ) coinaddr = _coinaddr; value = LP_txinterestvalue(&interest,coinaddr,coin,txid,vout); From 099c5ed0f0b6bc69d6be7a5c74596c93c1d7c0cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 15:54:37 +0200 Subject: [PATCH 606/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index b5bc94008..1382da767 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -264,7 +264,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t i,n,skipflag=0,startht,endht,ht; uint64_t balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; - LP_blockinit(coin,421011); + //LP_blockinit(coin,421011); startht = 1; endht = height-1; if ( strcmp(coin->symbol,lastcoin) == 0 ) From 1f2aef1e59f838d65990e78e2b53d191de304bb6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 18:08:47 +0200 Subject: [PATCH 607/682] 888 --- iguana/exchanges/LP_scan.c | 17 ++++++++++------- iguana/exchanges/coins | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 1382da767..4c7af64f5 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -200,7 +200,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } @@ -251,13 +251,13 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e if ( LP_blockinit(coin,ht) < 0 ) { printf("error loading block.%d of (%d, %d)\n",ht,startheight,endheight); - return(-1); + return(ht-1); } n++; if ( (n % 1000) == 0 ) fprintf(stderr,"%.1f%% ",100. * (double)n/(endheight-startheight+1)); } - return(0); + return(endheight); } cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) @@ -281,17 +281,20 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) retjson = cJSON_CreateObject(); if ( skipflag == 0 && startht < endht ) { - if ( LP_scanblockchain(coin,startht,endht) < 0 ) + if ( (ht= LP_scanblockchain(coin,startht,endht)) < endht ) { sleep(10); - if ( LP_scanblockchain(coin,startht,endht) < 0 ) + if ( (ht= LP_scanblockchain(coin,startht,endht)) < endht ) { jaddstr(retjson,"error","blockchain scan error"); return(retjson); } } - if ( endht > maxsnapht ) - maxsnapht = endht; + if ( ht > maxsnapht ) + { + maxsnapht = ht; + printf("maxsnapht.%d for %s\n",maxsnapht,coin->symbol); + } } portable_mutex_lock(&coin->txmutex); HASH_ITER(hh,coin->addresses,ap,atmp) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 92928de56..2964fc4f9 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[{\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 176d8553a5210c25487b2ec4a174264d774c4b51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 21:03:13 +0200 Subject: [PATCH 608/682] Test --- iguana/exchanges/LP_commands.c | 7 +++ iguana/exchanges/LP_scan.c | 110 +++++++++++++++++++++++++++++++-- iguana/exchanges/snapshot | 2 +- 3 files changed, 114 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 13b8d9741..f50c73ab5 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -121,6 +121,7 @@ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ snapshot(coin, height)\n\ +dividends(coin, height, )\n\ \"}")); base = jstr(argjson,"base"); @@ -252,6 +253,12 @@ snapshot(coin, height)\n\ return(jprint(LP_snapshot(ptr,juint(argjson,"height")),1)); else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"dividends") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + return(LP_dividends(ptr,juint(argjson,"height"),argjson)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); if ( strcmp(method,"inventory") == 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4c7af64f5..33afec441 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -309,11 +309,11 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( (ht=tx->outpoints[i].spendheight) > 0 && ht < height ) continue; - if ( (ap= _LP_address(coin,tx->outpoints[i].coinaddr)) != 0 ) + if ( tx->outpoints[i].coinaddr[0] != 0 && (ap= _LP_address(coin,tx->outpoints[i].coinaddr)) != 0 ) { balance += tx->outpoints[i].value; ap->balance += tx->outpoints[i].value; - printf("%s/%s %.8f %.8f\n",tx->outpoints[i].coinaddr,ap->coinaddr,dstr(tx->outpoints[i].value),dstr(ap->balance)); + //printf("(%s/%s) %.8f %.8f\n",tx->outpoints[i].coinaddr,ap->coinaddr,dstr(tx->outpoints[i].value),dstr(ap->balance)); } else noaddr_balance += tx->outpoints[i].value; } } @@ -327,8 +327,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) if ( ap->balance != 0 ) { item = cJSON_CreateArray(); - jaddistr(item,ap->coinaddr); - jaddinum(item,dstr(ap->balance)); + jaddnum(item,ap->coinaddr,dstr(ap->balance)); jaddi(array,item); n++; } @@ -340,6 +339,109 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) return(retjson); } +char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) +{ + cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; + if ( (retjson= LP_snapshot(coin,height)) != 0 ) + { + //printf("SNAPSHOT.(%s)\n",retstr); + if ( (array= jarray(&n,retjson,"balances")) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) != 0 ) + { + if ( argjson != 0 ) + { + exclude = jarray(&numexcluded,argjson,"exclude"); + dust = (uint64_t)(jdouble(argjson,"dust") * SATOSHIDEN); + dividend = (uint64_t)(jdouble(argjson,"dividend") * SATOSHIDEN); + if ( jstr(argjson,"prefix") != 0 ) + prefix = jstr(argjson,"prefix"); + if ( jstr(argjson,"suffix") != 0 ) + suffix = jstr(argjson,"suffix"); + execflag = jint(argjson,"system"); + } + for (iter=0; iter<2; iter++) + { + for (i=0; ichild) != 0 ) + { + value = (uint64_t)(child->valuedouble * SATOSHIDEN); + if ( (field= get_cJSON_fieldname(child)) != 0 ) + { + for (j=0; j dust ) + { + sprintf(buf,"%s %s %.8f %s",prefix,field,dstr(val),suffix); + if ( execflag != 0 ) + { + if ( system(buf) != 0 ) + printf("error system.(%s)\n",buf); + } + else printf("%s\n",buf); + emit += val; + } else dustsum += val; + } + } + } + } + if ( iter == 0 ) + { + if ( total > 0 ) + { + if ( dividend == 0 ) + dividend = total; + ratio = (double)dividend / total; + } else break; + } + } + } + free_json(array); + } + free_json(retjson); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"coin",coin->symbol); + jaddnum(retjson,"height",height); + jaddnum(retjson,"total",dstr(total)); + jaddnum(retjson,"excluded",dstr(excluded)); + if ( dust != 0 ) + jaddnum(retjson,"dust",dstr(dust)); + if ( dustsum != 0 ) + jaddnum(retjson,"dustsum",dstr(dustsum)); + jaddnum(retjson,"dividend",dstr(dividend)); + jaddnum(retjson,"dividends",dstr(emit)); + jaddnum(retjson,"ratio",ratio); + if ( execflag != 0 ) + jaddnum(retjson,"system",execflag); + if ( prefix[0] != 0 ) + jaddstr(retjson,"prefix",prefix); + if ( suffix[0] != 0 ) + jaddstr(retjson,"suffix",suffix); + return(jprint(retjson,1)); + } + return(clonestr("{\"error\":\"symbol not found\"}")); +} + int64_t basilisk_txvalue(char *symbol,bits256 txid,int32_t vout) { char destaddr[64]; uint64_t value,interest = 0; struct iguana_info *coin; diff --git a/iguana/exchanges/snapshot b/iguana/exchanges/snapshot index 4e88851fd..2b875af59 100755 --- a/iguana/exchanges/snapshot +++ b/iguana/exchanges/snapshot @@ -1,2 +1,2 @@ source userpass -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":2000}" +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$1}" From 22d8d4679d376bfef4b9a716a09a0a405ef6f4aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 23 Aug 2017 22:31:04 +0200 Subject: [PATCH 609/682] Test --- iguana/exchanges/LP_scan.c | 2 +- iguana/exchanges/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 33afec441..67e1042c3 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -326,7 +326,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( ap->balance != 0 ) { - item = cJSON_CreateArray(); + item = cJSON_CreateObject(); jaddnum(item,ap->coinaddr,dstr(ap->balance)); jaddi(array,item); n++; diff --git a/iguana/exchanges/install b/iguana/exchanges/install index bd9f680bd..75da97004 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 9087e1e73b11709bc6fb58c6abdfeff68416eff4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 14:45:20 +0200 Subject: [PATCH 610/682] Test --- iguana/exchanges/LP_scan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 67e1042c3..9bd5a034d 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -283,9 +283,19 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( (ht= LP_scanblockchain(coin,startht,endht)) < endht ) { + if ( ht > maxsnapht ) + { + maxsnapht = ht; + printf("maxsnapht.%d for %s\n",maxsnapht,coin->symbol); + } sleep(10); if ( (ht= LP_scanblockchain(coin,startht,endht)) < endht ) { + if ( ht > maxsnapht ) + { + maxsnapht = ht; + printf("maxsnapht.%d for %s\n",maxsnapht,coin->symbol); + } jaddstr(retjson,"error","blockchain scan error"); return(retjson); } From c44f903db72257f57a0f791533f82883a6f8fe00 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 14:47:05 +0200 Subject: [PATCH 611/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 9bd5a034d..45c8e40c0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -289,7 +289,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) printf("maxsnapht.%d for %s\n",maxsnapht,coin->symbol); } sleep(10); - if ( (ht= LP_scanblockchain(coin,startht,endht)) < endht ) + if ( (ht= LP_scanblockchain(coin,maxsnapht+1,endht)) < endht ) { if ( ht > maxsnapht ) { From 71d08e414277cf76c6dc080bc4a582afadad8cce Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 17:46:46 +0200 Subject: [PATCH 612/682] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 45c8e40c0..a708e9274 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -443,10 +443,10 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) jaddnum(retjson,"ratio",ratio); if ( execflag != 0 ) jaddnum(retjson,"system",execflag); - if ( prefix[0] != 0 ) + /*if ( prefix[0] != 0 ) jaddstr(retjson,"prefix",prefix); if ( suffix[0] != 0 ) - jaddstr(retjson,"suffix",suffix); + jaddstr(retjson,"suffix",suffix);*/ return(jprint(retjson,1)); } return(clonestr("{\"error\":\"symbol not found\"}")); From 07a0f8af607040f50b751318099b88fa12772fea Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:00:55 +0200 Subject: [PATCH 613/682] Test --- iguana/exchanges/LP_scan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index a708e9274..3192c0d51 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -426,7 +426,6 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) } } } - free_json(array); } free_json(retjson); retjson = cJSON_CreateObject(); From fb234e40e7655a219ad53ab35048c92662af7951 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:12:25 +0200 Subject: [PATCH 614/682] Test --- iguana/exchanges/LP_scan.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 3192c0d51..e1fbfdceb 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -351,7 +351,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) { - cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; + cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,dusted=0,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; if ( (retjson= LP_snapshot(coin,height)) != 0 ) { //printf("SNAPSHOT.(%s)\n",retstr); @@ -400,7 +400,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) if ( flag == 0 ) { val = ratio * value; - if ( val > dust ) + if ( val >= dust ) { sprintf(buf,"%s %s %.8f %s",prefix,field,dstr(val),suffix); if ( execflag != 0 ) @@ -410,7 +410,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) } else printf("%s\n",buf); emit += val; - } else dustsum += val; + } else dustsum += val, dusted++; } } } @@ -434,7 +434,10 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) jaddnum(retjson,"total",dstr(total)); jaddnum(retjson,"excluded",dstr(excluded)); if ( dust != 0 ) + { jaddnum(retjson,"dust",dstr(dust)); + jaddnum(retjson,"dusted",dusted); + } if ( dustsum != 0 ) jaddnum(retjson,"dustsum",dstr(dustsum)); jaddnum(retjson,"dividend",dstr(dividend)); From 9a74f992ce88baaed4e937dcf20135d56e22ebc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:16:16 +0200 Subject: [PATCH 615/682] Dividends script --- iguana/exchanges/dividends | 2 ++ iguana/exchanges/install | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 iguana/exchanges/dividends diff --git a/iguana/exchanges/dividends b/iguana/exchanges/dividends new file mode 100755 index 000000000..f3dde55a0 --- /dev/null +++ b/iguana/exchanges/dividends @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"dividends\",\"coin\":\"KMD\",\"height\":$1,\"prefix\":\"fiat/jumblr sendtoaddress\",\"suffix\":\"\",\"dividend\":50000,\"dust\":1}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 75da97004..8d25f26eb 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir From 92ee4949088b9d1c1b0e815c442a3367a555809a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:36:46 +0200 Subject: [PATCH 616/682] Test --- iguana/exchanges/LP_scan.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index e1fbfdceb..453d9727e 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -260,6 +260,19 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e return(endheight); } +int sort_balance(void *a,void *b) +{ + uint64_t aval,bval; + /* compare a to b (cast a and b appropriately) + * return (int) -1 if (a < b) + * return (int) 0 if (a == b) + * return (int) 1 if (a > b) + */ + aval = ((struct LP_address *)a)->balance * SATOSHIDEN; + bval = ((struct LP_address *)b)->balance * SATOSHIDEN; + return((int32_t)(aval - bval)); +} + cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; @@ -328,6 +341,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } } + HASH_SORT(coin->addresses,sort_balance); portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); array = cJSON_CreateArray(); From a0b47a567b7b94f3e9259215187b642f7fc03730 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:44:03 +0200 Subject: [PATCH 617/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 453d9727e..cf339f98c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -270,7 +270,7 @@ int sort_balance(void *a,void *b) */ aval = ((struct LP_address *)a)->balance * SATOSHIDEN; bval = ((struct LP_address *)b)->balance * SATOSHIDEN; - return((int32_t)(aval - bval)); + return((int32_t)(bval - aval)); } cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) From c248093c4b42eef71b3248be7ed6ec99cb95ed60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 19:04:45 +0200 Subject: [PATCH 618/682] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 035a90e28..ba6a5b63f 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2025,7 +2025,7 @@ int32_t bitcoin_p2shscript(uint8_t *script,int32_t n,const uint8_t *p2shscript,c char *bitcoind_passthru(char *coinstr,char *serverport,char *userpass,char *method,char *params) { - return(bitcoind_RPC(0,coinstr,serverport,userpass,method,params,2)); + return(bitcoind_RPC(0,coinstr,serverport,userpass,method,params,4)); } char *bitcoind_passthrut(char *coinstr,char *serverport,char *userpass,char *method,char *params,int32_t timeout) From 3ad520a08c944c0314f0b34669f334679d1e9f7d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 20:32:42 +0200 Subject: [PATCH 619/682] Test --- iguana/exchanges/LP_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cf339f98c..1c422441b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -262,7 +262,7 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e int sort_balance(void *a,void *b) { - uint64_t aval,bval; + int64_t aval,bval; /* compare a to b (cast a and b appropriately) * return (int) -1 if (a < b) * return (int) 0 if (a == b) @@ -341,6 +341,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } } + printf("sort\n"); HASH_SORT(coin->addresses,sort_balance); portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); From 32b5be8b3dbe969901a3da24b89f229c629e7d58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 22:42:51 +0200 Subject: [PATCH 620/682] Test --- iguana/exchanges/LP_scan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 1c422441b..b136d2bff 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -270,6 +270,7 @@ int sort_balance(void *a,void *b) */ aval = ((struct LP_address *)a)->balance * SATOSHIDEN; bval = ((struct LP_address *)b)->balance * SATOSHIDEN; + printf("%.8f vs %.8f -> %d\n",dstr(aval),dstr(bval),(int32_t)(bval - aval)); return((int32_t)(bval - aval)); } From 89a07ca09f7a7f79faa122fc0d37e71956dedb75 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 22:47:24 +0200 Subject: [PATCH 621/682] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index b136d2bff..da985c20d 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -268,8 +268,8 @@ int sort_balance(void *a,void *b) * return (int) 0 if (a == b) * return (int) 1 if (a > b) */ - aval = ((struct LP_address *)a)->balance * SATOSHIDEN; - bval = ((struct LP_address *)b)->balance * SATOSHIDEN; + aval = ((struct LP_address *)a)->balance; + bval = ((struct LP_address *)b)->balance; printf("%.8f vs %.8f -> %d\n",dstr(aval),dstr(bval),(int32_t)(bval - aval)); return((int32_t)(bval - aval)); } From d5af6b7c6ae20b5791e8def12b1c159ff38959dc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 22:50:33 +0200 Subject: [PATCH 622/682] Test --- iguana/exchanges/LP_scan.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index da985c20d..0ec51b907 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -270,8 +270,8 @@ int sort_balance(void *a,void *b) */ aval = ((struct LP_address *)a)->balance; bval = ((struct LP_address *)b)->balance; - printf("%.8f vs %.8f -> %d\n",dstr(aval),dstr(bval),(int32_t)(bval - aval)); - return((int32_t)(bval - aval)); + //printf("%.8f vs %.8f -> %d\n",dstr(aval),dstr(bval),(int32_t)(bval - aval)); + return((aval == bval) ? 0 : ((aval < bval) ? -1 : 1)); } cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) @@ -342,7 +342,6 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } } - printf("sort\n"); HASH_SORT(coin->addresses,sort_balance); portable_mutex_unlock(&coin->txmutex); printf("%s balance %.8f at height.%d\n",coin->symbol,dstr(balance),height); From 3a8646c0ca80ebb0a4a0f2557022d211c5302ca5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 22:54:36 +0200 Subject: [PATCH 623/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 0ec51b907..69fd66fe7 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -271,7 +271,7 @@ int sort_balance(void *a,void *b) aval = ((struct LP_address *)a)->balance; bval = ((struct LP_address *)b)->balance; //printf("%.8f vs %.8f -> %d\n",dstr(aval),dstr(bval),(int32_t)(bval - aval)); - return((aval == bval) ? 0 : ((aval < bval) ? -1 : 1)); + return((aval == bval) ? 0 : ((aval < bval) ? 1 : -1)); } cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) From e59e3f9bbcd36e0d733cfbccf3a7f0125ceb5771 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 23:04:38 +0200 Subject: [PATCH 624/682] Test --- iguana/exchanges/LP_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 69fd66fe7..4255890fe 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -177,7 +177,11 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) + { strcpy(tx->outpoints[i].coinaddr,address); + if ( strcmp(address,"RXzsovGBQ3W97xnVC6JnWxXsV4qb7p7iBi") == 0 ) + printf("%s %.8f at height.%d\n",address,dstr(tx->outpoints[i].value),height); + } } } } From 9bb99f74d25686b0d35623f93131d06a48a86e1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 00:20:51 +0200 Subject: [PATCH 625/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2236b1d29..7f31cf7c7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -118,7 +118,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retjson = cJSON_Parse(retstr); free(retstr); } - //usleep(1000); + usleep(100); //printf("dpow_gettxout.(%s)\n",retstr); } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); From 5ad2b31fbe3fbcfb04e3be86472c8b6e28099703 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 00:30:18 +0200 Subject: [PATCH 626/682] test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 4255890fe..551032a9b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -179,7 +179,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - if ( strcmp(address,"RXzsovGBQ3W97xnVC6JnWxXsV4qb7p7iBi") == 0 ) + if ( 0 && strcmp(address,"RXzsovGBQ3W97xnVC6JnWxXsV4qb7p7iBi") == 0 ) printf("%s %.8f at height.%d\n",address,dstr(tx->outpoints[i].value),height); } } From 58dbf62a154f36e9e9d40e4bf03bbd895f69e151 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 00:41:08 +0200 Subject: [PATCH 627/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7f31cf7c7..b110eb82e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -118,7 +118,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retjson = cJSON_Parse(retstr); free(retstr); } - usleep(100); + //usleep(100); //printf("dpow_gettxout.(%s)\n",retstr); } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); From f233b280dbe4f3e95b2fdbde80015c315604ea2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 00:42:03 +0200 Subject: [PATCH 628/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b110eb82e..7f31cf7c7 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -118,7 +118,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retjson = cJSON_Parse(retstr); free(retstr); } - //usleep(100); + usleep(100); //printf("dpow_gettxout.(%s)\n",retstr); } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); From 6cf00790dfdde4cbe584bb9a12921f919137c66b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 01:11:53 +0200 Subject: [PATCH 629/682] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7f31cf7c7..b110eb82e 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -118,7 +118,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retjson = cJSON_Parse(retstr); free(retstr); } - usleep(100); + //usleep(100); //printf("dpow_gettxout.(%s)\n",retstr); } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); From 79a6dcbbef35bac1075dc17fca8e999034e5ee40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 15:24:01 +0200 Subject: [PATCH 630/682] Test --- iguana/exchanges/LP_scan.c | 4 +++- iguana/tests/rawtx2 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 551032a9b..cfbc6eb3d 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -370,7 +370,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) { - cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,dusted=0,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; + cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,emitted=0,dusted=0,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; if ( (retjson= LP_snapshot(coin,height)) != 0 ) { //printf("SNAPSHOT.(%s)\n",retstr); @@ -429,6 +429,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) } else printf("%s\n",buf); emit += val; + emitted++; } else dustsum += val, dusted++; } } @@ -451,6 +452,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) jaddstr(retjson,"coin",coin->symbol); jaddnum(retjson,"height",height); jaddnum(retjson,"total",dstr(total)); + jaddnum(retjson,"emitted",emitted); jaddnum(retjson,"excluded",dstr(excluded)); if ( dust != 0 ) { diff --git a/iguana/tests/rawtx2 b/iguana/tests/rawtx2 index 391f42c58..cef4cd52a 100755 --- a/iguana/tests/rawtx2 +++ b/iguana/tests/rawtx2 @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"addresses\":[\"RFMEYcxuBL8S7UPdUbzXunPtS4p82HRcKs\", \"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\", \"RL4aMgTBzkM1kX7d8QtE2oYXuAj2ZKabmW\", \"RDE9LBKqMaKgQgnsZM3hFCNeWfoXkHWMLs\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\"],\"timeout\":15000,\"satoshis\":\"128700\",\"spendscript\":\"76a9142b4cf64627268ac24effd9aad5895e8ca862114288ac\",\"txfee\":\"10000\",\"burn\":0.00000000}}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"KMD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"addresses\":[\"RFMEYcxuBL8S7UPdUbzXunPtS4p82HRcKs\", \"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\", \"RL4aMgTBzkM1kX7d8QtE2oYXuAj2ZKabmW\", \"RDE9LBKqMaKgQgnsZM3hFCNeWfoXkHWMLs\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\"],\"timeout\":15000,\"satoshis\":\"128700\",\"spendscript\":\"76a9142b4cf64627268ac24effd9aad5895e8ca862114288ac\",\"txfee\":\"10000\",\"burn\":0.00000000}}" From 71dab3470f51b019e65cd7655ad220a930c62be6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Aug 2017 23:04:23 +0200 Subject: [PATCH 631/682] Rpcport field --- 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 91b2df3dc..ffde8b2f3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -786,12 +786,14 @@ void marketmaker(double minask,double maxbid,char *baseaddr,char *reladdr,double void LP_main(void *ptr) { - char *passphrase; double profitmargin; cJSON *argjson = ptr; + char *passphrase; double profitmargin; uint16_t port; cJSON *argjson = ptr; if ( (passphrase= jstr(argjson,"passphrase")) != 0 ) { profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; - LPinit(7779,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); + if ( (port= juint(argjson,"rpcport")) < 1000 ) + port = 7779; + LPinit(port,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } From 6d7c32bd263bfd3e048f2adc17045bc79efdf394 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 11:20:43 +0200 Subject: [PATCH 632/682] Test --- iguana/dpow/dpow_prices.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 5f19199ca..0db9a076f 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1429,10 +1429,11 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) { int32_t i,n,iter,seconds,datenum; uint32_t timestamp; char url[1024],url2[1024],*dstr,*str; double kmddaily=0.,btcusd=0.,ask,high,low,bid,close,vol,quotevol,open,price = 0.; - //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; + double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); + //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; cJSON *quandl,*kmdhist,*array,*item,*bitcoinave,*blockchaininfo,*btctrades,*coindesk=0; sprintf(url,"https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC&start=%u&end=%u",(uint32_t)time(NULL)-60,(uint32_t)time(NULL)); - btctrades = url_json(url); + btctrades = 0;//url_json(url); //kmdtrades = url_json("https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC"); //kmdtrades2 = url_json("https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-KMD&count=50"); *kmdbtcp = 0; @@ -1461,7 +1462,6 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) } if ( 1 ) { - double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); //aveask = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&askvol,"KMD","BTC",1,argjson); //avebid = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&bidvol,"KMD","BTC",-1,argjson); if ( 0 && avebid > SMALLVAL && aveask > SMALLVAL ) @@ -1522,6 +1522,8 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) free(btctrades); //printf("poloniex.%d\n",n); } + *btcusdp = get_theoretical(&avebid,&aveask,&highbid,&lowask,&CMC_average,changes,"bitcoin","BTC","USD",&USD_average); + printf("theoretical BTC %.2f\n",*btcusdp); if ( 0 && bitcoinave != 0 ) { if ( (price= jdouble(bitcoinave,"24h_avg")) > SMALLVAL ) From 6bc4437c73d9485f3cbf4292ddcebb9aa17cb279 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 12:18:40 +0200 Subject: [PATCH 633/682] Test --- iguana/dpow/dpow_prices.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0db9a076f..0b2ebf849 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1429,17 +1429,16 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) { int32_t i,n,iter,seconds,datenum; uint32_t timestamp; char url[1024],url2[1024],*dstr,*str; double kmddaily=0.,btcusd=0.,ask,high,low,bid,close,vol,quotevol,open,price = 0.; - double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); - //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; + //cJSON *kmdtrades,*kmdtrades2,*,*bitcoincharts,; cJSON *quandl,*kmdhist,*array,*item,*bitcoinave,*blockchaininfo,*btctrades,*coindesk=0; sprintf(url,"https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC&start=%u&end=%u",(uint32_t)time(NULL)-60,(uint32_t)time(NULL)); - btctrades = 0;//url_json(url); + btctrades = url_json(url); //kmdtrades = url_json("https://poloniex.com/public?command=returnTradeHistory¤cyPair=USDT_BTC"); //kmdtrades2 = url_json("https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-KMD&count=50"); *kmdbtcp = 0; bitcoinave = 0;//url_json("https://api.bitcoinaverage.com/ticker/USD/"); //bitcoincharts = url_json("http://api.bitcoincharts.com/v1/weighted_prices.json"); - blockchaininfo = 0;//url_json("https://blockchain.info/ticker"); + blockchaininfo = url_json("https://blockchain.info/ticker"); coindesk = 0;//url_json("http://api.coindesk.com/v1/bpi/historical/close.json"); sprintf(url,"https://poloniex.com/public?command=returnChartData¤cyPair=BTC_KMD&start=%ld&end=9999999999&period=86400",(long)(time(NULL)-3600*24)); sprintf(url2,"https://poloniex.com/public?command=returnChartData¤cyPair=BTC_BTCD&start=%ld&end=9999999999&period=86400",(long)(time(NULL)-3600*24)); @@ -1462,6 +1461,7 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) } if ( 1 ) { + double USD_average,avebid,aveask,bidvol,askvol,highbid,lowask,CMC_average,changes[3]; //struct exchange_quote sortbuf[512]; struct supernet_info *myinfo = SuperNET_MYINFO(0); cJSON *argjson = cJSON_Parse("{}"); //aveask = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&askvol,"KMD","BTC",1,argjson); //avebid = instantdex_aveprice(myinfo,sortbuf,(int32_t)(sizeof(sortbuf)/sizeof(*sortbuf)),&bidvol,"KMD","BTC",-1,argjson); if ( 0 && avebid > SMALLVAL && aveask > SMALLVAL ) @@ -1522,8 +1522,6 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) free(btctrades); //printf("poloniex.%d\n",n); } - *btcusdp = get_theoretical(&avebid,&aveask,&highbid,&lowask,&CMC_average,changes,"bitcoin","BTC","USD",&USD_average); - printf("theoretical BTC %.2f\n",*btcusdp); if ( 0 && bitcoinave != 0 ) { if ( (price= jdouble(bitcoinave,"24h_avg")) > SMALLVAL ) @@ -1543,7 +1541,7 @@ void PAX_update(struct PAX_data *dp,double *btcusdp,double *kmdbtcp) if ( (item= jobj(blockchaininfo,"USD")) != 0 && item != 0 && (price= jdouble(item,"15m")) > SMALLVAL ) { dpow_price("blockchain.info","BTCUSD",price,price); - //printf("blockchaininfo %f %f\n",btcusd,price); + printf("blockchaininfo %f %f\n",btcusd,price); dxblend(&btcusd,price,0.5); } free_json(blockchaininfo); From 6f115530c985f094b53f984148881d5931af6f78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 12:31:13 +0200 Subject: [PATCH 634/682] Fix btc overflow --- iguana/dpow/dpow_prices.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0b2ebf849..f77073532 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1920,7 +1920,11 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[1] = timestamp; pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); - pvals[4] = PAX_val32(dp->btcusd * .001); + double btcfactor; + if ( time(NULL) > 1503742923+24*3600*0 ) + btcfactor = .00001; + else btcfactor = .001; + pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); if ( dispflag != 0 ) printf("KMD %.8f BTC %f CNY %f (%f)\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD); From d894bf088706ae92a4f0da8e436952b4ecd0656d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 13:28:21 +0200 Subject: [PATCH 635/682] Test --- iguana/dpow/dpow_prices.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index f77073532..0d966f1a7 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1832,6 +1832,9 @@ void PAX_genecbsplines(struct PAX_data *dp) portable_mutex_unlock(&mutex); } +#define BTCFACTOR_TIMESTAMP 1503746319 +#define BTCFACTOR_HEIGHT 466266 + int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t idlegap) { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; @@ -1921,7 +1924,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); double btcfactor; - if ( time(NULL) > 1503742923+24*3600*0 ) + if ( time(NULL) > BTCFACTOR_TIMESTAMP ) btcfactor = .00001; else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); From 663ae466e8b935d09c72a7e18476e45ba61888f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:10:17 +0200 Subject: [PATCH 636/682] Test --- iguana/dpow/dpow_prices.c | 8 ++++---- iguana/iguana_notary.c | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 0d966f1a7..528617b01 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1924,13 +1924,13 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i pvals[2] = MAX_CURRENCIES + 3; pvals[3] = PAX_val32(dp->kmdbtc * 1000); double btcfactor; - if ( time(NULL) > BTCFACTOR_TIMESTAMP ) + //if ( time(NULL) > BTCFACTOR_TIMESTAMP ) btcfactor = .00001; - else btcfactor = .001; + //else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); - if ( dispflag != 0 ) - printf("KMD %.8f BTC %f CNY %f (%f)\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD); + //if ( dispflag != 0 ) + printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); sprintf(fname,"/%s/.komodo/komodofeed",userhome); if ( (fp= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index fe9d14c60..a8518be7b 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -71,9 +71,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else { freq = 1; - //minsigs = 7;//(komodo_notaries(dp->symbol,pubkeys,height) >> 1) + 1; - //if ( minsigs < DPOW_MINSIGS ) - minsigs = DPOW_MINSIGS; + minsigs = 11; } printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); From d320678659b66ffe47710e4c531e7fa94a879ee8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:23:16 +0200 Subject: [PATCH 637/682] Test --- iguana/dPoW.h | 2 +- iguana/dpow/dpow_network.c | 8 ++++---- iguana/dpow/dpow_prices.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index b773104c8..47e9f1642 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -137,7 +137,7 @@ struct dpow_info int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; struct pax_transaction *PAX; portable_mutex_t paxmutex,dexmutex; - uint32_t ipbits[64],numipbits; + uint32_t ipbits[128],numipbits; struct dpow_block **blocks; }; uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp); diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 33592f0b8..635930b42 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1318,7 +1318,7 @@ struct dpow_nanomsghdr { bits256 srchash,desthash; struct dpow_nanoutxo ratify,notarize; - uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[64]; + uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[128]; char symbol[16]; uint8_t senderind,version0,version1,packet[]; } PACKED; @@ -2026,10 +2026,10 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo printf("%d NANOSEND.%d ht.%d channel.%08x (%d) pax.%08x datalen.%d (%d %llx) (%d %llx) recv.%llx\n",i,sentbytes,np->height,np->channel,size,np->notarize.paxwdcrc,datalen,(int8_t)np->notarize.bestk,(long long)np->notarize.bestmask,bp->notaries[bp->myind].bestk,(long long)bp->notaries[bp->myind].bestmask,(long long)bp->recvmask); } -void dpow_ipbitsadd(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t *ipbits,int32_t numipbits,int32_t fromid,uint32_t senderipbits) +void dpow_ipbitsadd(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t *ipbits,int32_t numipbits,int32_t maxipbits,int32_t fromid,uint32_t senderipbits) { int32_t i,j,matched,missing,n; char ipaddr[64]; - if ( numipbits >= 64 ) + if ( numipbits >= maxipbits ) { static int32_t counter; if ( counter++ < 100 ) @@ -2112,7 +2112,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) printf("received nnpacket for (%s)\n",np->symbol); else { - dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,np->senderind,np->myipbits); + dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,sizeof(np->ipbits)/sizeof(*np->ipbits),np->senderind,np->myipbits); if ( (bp= dpow_heightfind(myinfo,dp,np->height)) != 0 && bp->state != 0xffffffff && bp->myind >= 0 ) { //char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind); diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 528617b01..d01ea756f 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1907,8 +1907,8 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i PAX_emitprices(pvals,dp); } timestamp = (uint32_t)time(NULL); - int32_t dispflag = ((rand() % 64) == 0); - if ( dp->kmdbtc == 0 || dispflag != 0 ) + int32_t dispflag = ((rand() % 6) == 0); + if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); for (i=0; i Date: Sat, 26 Aug 2017 14:27:12 +0200 Subject: [PATCH 638/682] Test --- iguana/dpow/dpow_prices.c | 3 ++- iguana/iguana_exchanges.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index d01ea756f..01b252ae6 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1839,6 +1839,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; + printf("PAX_IDLE\n"); if ( Currencymasks[0] == 0 ) return(0); if ( didinit == 0 ) @@ -1942,7 +1943,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i printf("error writing pvals to (%s)\n",fname); fclose(fp); } - if ( dispflag != 0 ) + //if ( dispflag != 0 ) { for (i=0; i<6; i++) printf("%u ",pvals[i]); diff --git a/iguana/iguana_exchanges.c b/iguana/iguana_exchanges.c index d7445f681..d2cd1c267 100755 --- a/iguana/iguana_exchanges.c +++ b/iguana/iguana_exchanges.c @@ -784,7 +784,8 @@ void exchanges777_loop(void *ptr) printf("exchanges loop.(%s)\n",exchange->name); while ( 1 ) { - PAX_idle(myinfo); + if ( strcmp("bitcoin",exchange->name) == 0 ) + PAX_idle(myinfo); flag = retval = 0; retstr = 0; if ( (req= queue_dequeue(&exchange->requestQ)) != 0 ) From ba8df3b3afa2f86881c686b0d64815aab3fde2c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:31:17 +0200 Subject: [PATCH 639/682] Test --- iguana/dpow/dpow_prices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 01b252ae6..a5b04d2b9 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1839,7 +1839,6 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i { static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; - printf("PAX_IDLE\n"); if ( Currencymasks[0] == 0 ) return(0); if ( didinit == 0 ) @@ -1909,6 +1908,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i } timestamp = (uint32_t)time(NULL); int32_t dispflag = ((rand() % 6) == 0); + printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); From 245dcfaef3bc57e371b4d373d464cb98b6505e11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 14:36:05 +0200 Subject: [PATCH 640/682] Test --- iguana/dpow/dpow_prices.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index a5b04d2b9..944a2c855 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1908,7 +1908,7 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i } timestamp = (uint32_t)time(NULL); int32_t dispflag = ((rand() % 6) == 0); - printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); + //printf("PAX_IDLE.%d %.8f %.8f\n",dispflag,dp->kmdbtc,dp->btcusd); if ( dp->kmdbtc == 0 || dp->btcusd == 0 || dispflag != 0 ) { PAX_update(dp,&dp->btcusd,&dp->kmdbtc); @@ -1930,8 +1930,6 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i //else btcfactor = .001; pvals[4] = PAX_val32(dp->btcusd * btcfactor); pvals[5] = PAX_val32(dp->CNYUSD); - //if ( dispflag != 0 ) - printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); sprintf(fname,"/%s/.komodo/komodofeed",userhome); if ( (fp= fopen(fname,"wb")) != 0 ) { @@ -1943,11 +1941,11 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i printf("error writing pvals to (%s)\n",fname); fclose(fp); } - //if ( dispflag != 0 ) + if ( dispflag != 0 ) { for (i=0; i<6; i++) printf("%u ",pvals[i]); - printf("pvals -> %s\n",fname); + printf("KMD %.8f BTC %f CNY %f (%f) btcusd pval.%u\n",dp->kmdbtc,dp->btcusd,dp->CNYUSD,1./dp->CNYUSD,pvals[4]); } } } From 5ebb80affea4271aae2101b4ef9ea724ccee0e7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 15:17:19 +0200 Subject: [PATCH 641/682] Test --- iguana/dpow/dpow_prices.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 944a2c855..d83da8dd1 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1837,11 +1837,11 @@ void PAX_genecbsplines(struct PAX_data *dp) int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t idlegap) { - static double lastupdate,lastdayupdate; static int32_t didinit; static char *userhome; int32_t idlegap = 10; + static double lastupdate,lastdayupdate; static uint32_t didinit; static char *userhome; int32_t idlegap = 10; FILE *fp; long filesize; char fname[512]; double splineval; uint32_t pvals[128],timestamp; int32_t i,datenum,seconds,c; struct tai t; struct PAX_data *dp; uint8_t data[512]; if ( Currencymasks[0] == 0 ) return(0); - if ( didinit == 0 ) + if ( time(NULL) > didinit+12*3600 ) { if ( (userhome= OS_filestr(&filesize,"userhome.txt")) == 0 ) userhome = "root"; @@ -1852,15 +1852,15 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i userhome[strlen(userhome)-1] = 0; } } - myinfo->PAXDATA = calloc(1,sizeof(*dp)); - didinit = 1; + if ( myinfo->PAXDATA == 0 ) + myinfo->PAXDATA = calloc(1,sizeof(*dp)); dp = myinfo->PAXDATA; PAX_genecbsplines(dp); printf("generated splines\n"); - datenum = OS_conv_unixtime(&t,&seconds,(uint32_t)time(NULL)); + didinit = (uint32_t)time(NULL); + datenum = OS_conv_unixtime(&t,&seconds,didinit); expand_datenum(dp->edate,datenum); } - dp = myinfo->PAXDATA; /*if ( 0 && time(NULL) > dp->lastupdate+10 ) { From 0dcbd5b7f783c571e2f9ec97f3fde0bbaad6ccbb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 20:59:11 +0200 Subject: [PATCH 642/682] Test --- iguana/dpow/dpow_network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 635930b42..d3257cbc4 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -561,7 +561,7 @@ void dex_channelsend(struct supernet_info *myinfo,bits256 srchash,bits256 destha void dpow_randipbits(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *retjson) { - int32_t m; uint32_t ipbits; char *coinstr; + int32_t m; uint32_t ipbits; char *coinstr; cJSON *infojson; if ( is_cJSON_Array(retjson) == 0 ) { if ( (m= myinfo->numdpowipbits) > 0 ) @@ -572,6 +572,11 @@ void dpow_randipbits(struct supernet_info *myinfo,struct iguana_info *coin,cJSON } if ( (coinstr= jstr(retjson,"coin")) == 0 ) jaddstr(retjson,"coin",coin->symbol); + if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) + { + jaddnum(retjson,"notaryheight",juint(infojson,"blocks")); + free_json(infojson); + } } } From 319b13f954a1ddc3eefeaa0055f7d18e60e26bcc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Aug 2017 22:35:28 +0200 Subject: [PATCH 643/682] CHIPS --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 2964fc4f9..9bae7a503 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 22b84e82303579296449eb18be3e4ef2632209bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:21:08 +0200 Subject: [PATCH 644/682] Secret addresses --- iguana/exchanges/LP_commands.c | 7 +++++++ iguana/exchanges/LP_utxos.c | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f50c73ab5..7d7e6435a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -164,6 +164,13 @@ dividends(coin, height, )\n\ { return(LP_portfolio()); } + else if ( strcmp(method,"secretaddresses") == 0 ) + { + uint8_t taddr,pubtype; + pubtype = (jobj(argjson,"pubtype") == 0) ? 60 : juint(argjson,"pubtype"); + taddr = (jobj(argjson,"taddr") == 0) ? 0 : juint(argjson,"taddr"); + return(LP_secretaddresses(ctx,jstr(argjson,"passphrase"),juint(argjson,"num"),taddr,pubtype)); + } if ( base != 0 && rel != 0 ) { double price,bid,ask; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index f13b1e436..c20486f02 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -907,6 +907,41 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr return(total); } +char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) +{ + int32_t i; uint8_t tmptype,pubkey33[33]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + retjson = cJSON_CreateArray(); + if ( passphrase == 0 || passphrase[0] == 0 ) + passphrase = "password"; + if ( n <= 0 ) + n = 16; + else if ( n > 777 ) + n = 777; + printf("secrets.[%d] <%s> t.%u p.%u\n",n,passphrase,taddr,pubtype); + for (i=0; i %s vs %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkprivkey)); + free_json(retjson); + return(clonestr("{\"error\":\"couldnt validate wifstr\"}")); + } + else if ( tmptype != pubtype ) + { + printf("checktype.%d != pubtype.%d\n",tmptype,pubtype); + free_json(retjson); + return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); + } + jaddistr(retjson,coinaddr); + } + printf("retjson.(%s)\n",jprint(retjson,0)); + return(jprint(retjson,1)); +} + bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) { static uint32_t counter; From ea94d549c178701f725e62bdaacdda13e65d6ebe Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:26:35 +0200 Subject: [PATCH 645/682] Test --- iguana/exchanges/LP_utxos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c20486f02..8a0c17397 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -923,6 +923,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint sprintf(buf,"secretaddress %s %03d",passphrase,i); conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)buf,(int32_t)strlen(buf)); bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); + bitcoin_priv2wif(0,wifstr,privkey,188); bitcoin_wif2priv(0,&tmptype,&checkprivkey,wifstr); if ( bits256_cmp(checkprivkey,privkey) != 0 ) { From 2f2d86dac5c572e1aefed30accbaed1cd7e6c640 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:29:29 +0200 Subject: [PATCH 646/682] Test --- iguana/exchanges/LP_utxos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8a0c17397..8d3189a8b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; retjson = cJSON_CreateArray(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -925,6 +925,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); bitcoin_priv2wif(0,wifstr,privkey,188); bitcoin_wif2priv(0,&tmptype,&checkprivkey,wifstr); + bitcoin_addr2rmd160(taddr,&tmptype,rmd160,coinaddr); if ( bits256_cmp(checkprivkey,privkey) != 0 ) { printf("WIF.(%s) error -> %s vs %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkprivkey)); From f82dd6e72ff7c947407196a2df2b321e69ffefc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:40:29 +0200 Subject: [PATCH 647/682] Test --- iguana/exchanges/LP_utxos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 8d3189a8b..b3c4a98e9 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -910,7 +910,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; - retjson = cJSON_CreateArray(); + retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; if ( n <= 0 ) @@ -938,9 +938,9 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint free_json(retjson); return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); } - jaddistr(retjson,coinaddr); + jaddstr(retjson,coinaddr,wifstr); + printf("./komodo-cli jumblr_secret %s\n",coinaddr); } - printf("retjson.(%s)\n",jprint(retjson,0)); return(jprint(retjson,1)); } From e1f7c8ca4e254dcd26244a5777bfd6c00f142221 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 14:52:04 +0200 Subject: [PATCH 648/682] Test --- iguana/exchanges/secretaddresses | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 iguana/exchanges/secretaddresses diff --git a/iguana/exchanges/secretaddresses b/iguana/exchanges/secretaddresses new file mode 100755 index 000000000..696ccb881 --- /dev/null +++ b/iguana/exchanges/secretaddresses @@ -0,0 +1,5 @@ +source userpass +echo "usage: ./secretaddresses 'passphrase'" + +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"secretaddresses\",\"num\":10,\"passphrase\":\"$1\"}" + From 84eb8cb71c0c5824281d0fcf786875f46f160055 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Aug 2017 15:01:46 +0200 Subject: [PATCH 649/682] Test --- iguana/exchanges/LP_utxos.c | 4 +++- iguana/exchanges/install | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b3c4a98e9..4ad652cf8 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -917,7 +917,9 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint n = 16; else if ( n > 777 ) n = 777; - printf("secrets.[%d] <%s> t.%u p.%u\n",n,passphrase,taddr,pubtype); + conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); + printf("generator (%s) secrets.[%d] <%s> t.%u p.%u\n",coinaddr,n,passphrase,taddr,pubtype); for (i=0; i Date: Mon, 28 Aug 2017 11:12:51 +0200 Subject: [PATCH 650/682] Snaploop --- iguana/exchanges/snaploop | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 iguana/exchanges/snaploop diff --git a/iguana/exchanges/snaploop b/iguana/exchanges/snaploop new file mode 100755 index 000000000..9c9190c88 --- /dev/null +++ b/iguana/exchanges/snaploop @@ -0,0 +1,10 @@ +source userpass +ht=$1 +while true +do +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=$(( $ht + 100 )) +echo next hight $ht +sleep 6000 +done + From 1fa130da9653622bbea36fa9802ae840eeed2897 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 11:41:36 +0200 Subject: [PATCH 651/682] Test --- iguana/exchanges/LP_commands.c | 6 +++++ iguana/exchanges/LP_scan.c | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7d7e6435a..93784bfbb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -266,6 +266,12 @@ dividends(coin, height, )\n\ return(LP_dividends(ptr,juint(argjson,"height"),argjson)); else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"balance") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + return(LP_snapshot_balance(ptr,juint(argjson,"height"),argjson)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } if ( LP_isdisabled(coin,0) != 0 ) return(clonestr("{\"error\":\"coin is disabled\"}")); if ( strcmp(method,"inventory") == 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index cfbc6eb3d..caf1c8097 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -368,6 +368,53 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) return(retjson); } +char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson) +{ + cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t value,balance = 0; + retjson = cJSON_CreateObject(); + array = cJSON_CreateArray(); + if ( (snapjson= LP_snapshot(coin,height)) != 0 ) + { + if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) + { + if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) + { + for (i=0; ichild) != 0 ) + { + value = (uint64_t)(child->valuedouble * SATOSHIDEN); + if ( (refaddr= get_cJSON_fieldname(child)) != 0 ) + { + for (j=0; j Date: Mon, 28 Aug 2017 11:42:27 +0200 Subject: [PATCH 652/682] Test --- iguana/exchanges/LP_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 93784bfbb..54b29fb63 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -121,6 +121,7 @@ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ snapshot(coin, height)\n\ +snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ \"}")); @@ -266,7 +267,7 @@ dividends(coin, height, )\n\ return(LP_dividends(ptr,juint(argjson,"height"),argjson)); else return(clonestr("{\"error\":\"cant find coind\"}")); } - else if ( strcmp(method,"balance") == 0 ) + else if ( strcmp(method,"snapshot_balance") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) return(LP_snapshot_balance(ptr,juint(argjson,"height"),argjson)); From 59c9bf25d0f64aefe5e946bf4acbd7f80c75c11b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 11:55:07 +0200 Subject: [PATCH 653/682] Test --- iguana/exchanges/LP_scan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index caf1c8097..fc635460a 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -387,6 +387,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson value = (uint64_t)(child->valuedouble * SATOSHIDEN); if ( (refaddr= get_cJSON_fieldname(child)) != 0 ) { + //printf("check %s %.8f against %d\n",refaddr,dstr(value),m); for (j=0; j Date: Mon, 28 Aug 2017 11:58:32 +0200 Subject: [PATCH 654/682] Test --- iguana/exchanges/LP_scan.c | 4 ++++ iguana/exchanges/snapshot_balance | 10 ++++++++++ iguana/exchanges/{snaploop => snapshot_loop} | 0 3 files changed, 14 insertions(+) create mode 100644 iguana/exchanges/snapshot_balance rename iguana/exchanges/{snaploop => snapshot_loop} (100%) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index fc635460a..3b54395c7 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -362,6 +362,8 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) } } jadd(retjson,"balances",array); + jaddstr(retjson,"coin",coin->symbol); + jaddnum(retjson,"height",height); jaddnum(retjson,"numaddresses",n); jaddnum(retjson,"total",dstr(balance)); jaddnum(retjson,"noaddr_total",dstr(noaddr_balance)); @@ -410,6 +412,8 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson free_json(snapjson); } jadd(retjson,"balances",array); + jaddstr(retjson,"coin",coin->symbol); + jaddnum(retjson,"height",height); jaddnum(retjson,"balance",dstr(balance)); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance new file mode 100644 index 000000000..d34b8ecd6 --- /dev/null +++ b/iguana/exchanges/snapshot_balance @@ -0,0 +1,10 @@ +source userpass +ht=$1 +while true +do +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" +ht=$(( $ht + 100 )) +echo next hight $ht +sleep 6000 +done + diff --git a/iguana/exchanges/snaploop b/iguana/exchanges/snapshot_loop similarity index 100% rename from iguana/exchanges/snaploop rename to iguana/exchanges/snapshot_loop From 87f8cd50482941d4a40b2f6b2c7e168d2692fb89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 12:13:28 +0200 Subject: [PATCH 655/682] Test --- iguana/exchanges/install | 2 +- iguana/exchanges/snapshot_balance | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index b11ec1171..0df9ec681 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,4 +1,4 @@ -cp secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall trade ordermatch bestfit orderbook autotrade client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir diff --git a/iguana/exchanges/snapshot_balance b/iguana/exchanges/snapshot_balance index d34b8ecd6..4cbe11cf3 100644 --- a/iguana/exchanges/snapshot_balance +++ b/iguana/exchanges/snapshot_balance @@ -1,10 +1,4 @@ source userpass ht=$1 -while true -do curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot_balance\",\"coin\":\"KMD\",\"height\":$ht,\"addresses\":[\"RSAzPFzgTZHNcxLNLdGyVPbjbMA8PRY7Ss\", \"RBgD5eMGwZppid4x7PTEC2Wg1AzvxbsQqB\"]}" -ht=$(( $ht + 100 )) -echo next hight $ht -sleep 6000 -done From 85f16bb89cfab2857aca0d8a3c7087e4534d01aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 12:14:56 +0200 Subject: [PATCH 656/682] Test --- iguana/exchanges/LP_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 54b29fb63..ad0a07be4 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -120,6 +120,7 @@ getprices(base, rel)\n\ sendmessage(base=coin, rel="", pubkey=zero, )\n\ getmessages(firsti=0, num=100)\n\ clearmessages(firsti=0, num=100)\n\ +secretaddresses(passphrase, num=10, pubtype=60, taddr=0)\n\ snapshot(coin, height)\n\ snapshot_balance(coin, height, addresses[])\n\ dividends(coin, height, )\n\ From 2064dbfd1c6688b95c1cf18a5867fa54362b4375 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 13:22:41 +0200 Subject: [PATCH 657/682] test --- iguana/exchanges/LP_scan.c | 2 ++ iguana/exchanges/balance_loop | 11 +++++++++++ iguana/exchanges/snapshot_loop | 9 +++++---- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 iguana/exchanges/balance_loop diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 3b54395c7..315d5fb0b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -278,6 +278,8 @@ int sort_balance(void *a,void *b) return((aval == bval) ? 0 : ((aval < bval) ? 1 : -1)); } +// a primitive restore can be done by loading the previous snapshot and creating a virtual tx for all the balance at height-1. this wont allow anything but new snapshots, but for many use cases that is all that is needed + cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static char lastcoin[16]; static int32_t maxsnapht; diff --git a/iguana/exchanges/balance_loop b/iguana/exchanges/balance_loop new file mode 100755 index 000000000..fcc1b8cb5 --- /dev/null +++ b/iguana/exchanges/balance_loop @@ -0,0 +1,11 @@ +source userpass +ht=$1 +while true +do +#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` + +echo next height $ht +sleep 600 +done + diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index 9c9190c88..fcc1b8cb5 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -2,9 +2,10 @@ source userpass ht=$1 while true do -curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -ht=$(( $ht + 100 )) -echo next hight $ht -sleep 6000 +#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` + +echo next height $ht +sleep 600 done From 1567560497c9f6daac7a3bb77aaac5c4f031cf51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 14:56:31 +0200 Subject: [PATCH 658/682] Test --- iguana/exchanges/LP_utxos.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 4ad652cf8..c5880577d 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson,*item; retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -943,6 +943,13 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint jaddstr(retjson,coinaddr,wifstr); printf("./komodo-cli jumblr_secret %s\n",coinaddr); } + printf("\"addresses\":[") + for (i=0; i Date: Mon, 28 Aug 2017 15:01:11 +0200 Subject: [PATCH 659/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index c5880577d..856c2a06c 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -943,7 +943,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint jaddstr(retjson,coinaddr,wifstr); printf("./komodo-cli jumblr_secret %s\n",coinaddr); } - printf("\"addresses\":[") + printf("\"addresses\":["); for (i=0; i Date: Mon, 28 Aug 2017 15:07:00 +0200 Subject: [PATCH 660/682] test --- .gitignore | 2 ++ iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/userpass | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e28d825a6..4f2ba20d2 100755 --- a/.gitignore +++ b/.gitignore @@ -484,3 +484,5 @@ iguana/client iguana/marketmaker.dSYM/Contents/Resources/DWARF/marketmaker iguana/confs/97f18454bb61e9eb7a827cfbefe42fbf7ae2832dc74c4812bdaef8bcf5c10474 + +iguana/DB/PRICES/.tmpmarker diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 856c2a06c..16931c260 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -947,7 +947,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint for (i=0; ichild != 0 ? get_cJSON_fieldname(item->child) : ""); } printf("]\n"); return(jprint(retjson,1)); diff --git a/iguana/exchanges/userpass b/iguana/exchanges/userpass index 1a8a9ad5a..d097e0445 100644 --- a/iguana/exchanges/userpass +++ b/iguana/exchanges/userpass @@ -1 +1,2 @@ -export userpass="" +#export userpass="" +export userpass="c3d8c2a364b7d18c1f9d7321d017b92e9f9c791e4f5c741214fefdea8a071256" From a5f4ce24d5c907eecc9277282b30fed3274af9cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 15:10:00 +0200 Subject: [PATCH 661/682] Test --- iguana/exchanges/LP_utxos.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 16931c260..534a452e7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -909,7 +909,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint8_t pubtype) { - int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson,*item; + int32_t i; uint8_t tmptype,pubkey33[33],rmd160[20]; char output[777*45],str[65],str2[65],buf[8192],wifstr[128],coinaddr[64]; bits256 checkprivkey,privkey,pubkey; cJSON *retjson; retjson = cJSON_CreateObject(); if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = "password"; @@ -920,6 +920,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); bitcoin_priv2pub(ctx,pubkey33,coinaddr,privkey,taddr,pubtype); printf("generator (%s) secrets.[%d] <%s> t.%u p.%u\n",coinaddr,n,passphrase,taddr,pubtype); + sprintf(output,"\"addresses\":["); for (i=0; ichild != 0 ? get_cJSON_fieldname(item->child) : ""); - } - printf("]\n"); + printf("%s]\n",output); return(jprint(retjson,1)); } From a6c67307c8956e1cf036cada6014ed68f68028f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 15:13:09 +0200 Subject: [PATCH 662/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- iguana/exchanges/secretaddresses | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 534a452e7..239bdefb5 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -942,7 +942,7 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint return(clonestr("{\"error\":\"couldnt validate pubtype\"}")); } jaddstr(retjson,coinaddr,wifstr); - sprintf(output+strlen(output),"\\\"%s\\\", ",coinaddr); + sprintf(output+strlen(output),"\\\"%s\\\"%c ",coinaddr,i Date: Mon, 28 Aug 2017 18:03:53 +0200 Subject: [PATCH 663/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 315d5fb0b..c13b507d1 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -146,7 +146,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf } else printf("LP_txinterestvalue no addresses found?\n"); //char str[65]; printf("%s %.8f <- %s.(%s) txobj.(%s)\n",destaddr,dstr(value),coin->symbol,bits256_str(str,txid),jprint(txobj,0)); free_json(txobj); - } else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } + } //else { char str[65]; printf("null gettxout return %s/v%d\n",bits256_str(str,txid),vout); } return(value); } From a1835cfd6ec75e09f9931586f310d608db583dba Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Aug 2017 22:16:00 +0200 Subject: [PATCH 664/682] Test --- iguana/exchanges/LP_utxos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 239bdefb5..71134a365 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -550,7 +550,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit } if ( numconfirms <= 0 ) { - printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); + //printf("LP_utxoadd reject numconfirms.%d\n",numconfirms); return(0); } numconfirms = -1; From 4813b61f0106c467700d8883aa815275dbf70746 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 12:43:16 +0200 Subject: [PATCH 665/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c13b507d1..8d1a6964c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -211,7 +211,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) } free_json(txobj); return(0); - } else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); + } //else printf("LP_transactioninit error for %s %s\n",coin->symbol,bits256_str(str,txid)); return(-1); } From 356d363c36f95b9e293e077b91c3a713ccb2ad60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 12:47:11 +0200 Subject: [PATCH 666/682] Test --- iguana/exchanges/snapshot_loop | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index fcc1b8cb5..11d1a127b 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -3,9 +3,9 @@ ht=$1 while true do #curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks` - +#ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getinfo\",\"coin\":\"KMD\"}" | jq .blocks` +ht=$(( $ht + 100 )) echo next height $ht -sleep 600 +sleep 1 done From a4d1d6a88ea53f6c32f86307f61446c0208cdcef Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 22:05:53 +0200 Subject: [PATCH 667/682] Test --- iguana/exchanges/LP_scan.c | 4 +++- iguana/exchanges/snapshot_loop | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 8d1a6964c..c65dedb65 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -374,11 +374,12 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson) { - cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t value,balance = 0; + cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t total=0,value,balance = 0; retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); if ( (snapjson= LP_snapshot(coin,height)) != 0 ) { + total = jdouble(snapjson,"total"); if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) { if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) @@ -417,6 +418,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson jaddstr(retjson,"coin",coin->symbol); jaddnum(retjson,"height",height); jaddnum(retjson,"balance",dstr(balance)); + jaddnum(retjson,"total",dstr(total)); return(jprint(retjson,1)); } diff --git a/iguana/exchanges/snapshot_loop b/iguana/exchanges/snapshot_loop index 11d1a127b..aef95969b 100755 --- a/iguana/exchanges/snapshot_loop +++ b/iguana/exchanges/snapshot_loop @@ -2,9 +2,9 @@ source userpass ht=$1 while true do -#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" -#ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getinfo\",\"coin\":\"KMD\"}" | jq .blocks` -ht=$(( $ht + 100 )) +curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}" +#ht=`komodo-cli getinfo | jq .blocks` +ht=$(( $ht + 1000 )) echo next height $ht sleep 1 done From af813baadedc98671712e27da2a335d20b5bcd10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Aug 2017 22:57:07 +0200 Subject: [PATCH 668/682] Flush stdout --- iguana/iguana_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 554624dc2..d79aefe24 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -1170,6 +1170,7 @@ void iguana_rpcloop(void *args) sleep(3); } printf(">>>>>>>>>> iguana_rpcloop 127.0.0.1:%d bind sock.%d iguana API enabled <<<<<<<<<\n",port,bindsock); + fflush(stdout); space = calloc(1,size); while ( bindsock >= 0 ) { From 0aa51c3717904651a83778459897c43f622a7091 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 00:37:02 +0200 Subject: [PATCH 669/682] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e3bf7308e..050ad3ef1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,7 +13,7 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ - +//alice only coins // // LP_nativeDEX.c // marketmaker @@ -392,9 +392,9 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+180 ) + if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+10 ) { - printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); + //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); lastresync = (uint32_t)time(NULL); //LP_peer_pricesquery(mostpeer->ipaddr,mostpeer->port); From 6baba73263d38dddf51651639b989258fa95e862 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 00:42:54 +0200 Subject: [PATCH 670/682] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 050ad3ef1..4c5b047bb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -392,7 +392,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } } //printf("numutxos vs mine.%d\n",LP_mypeer != 0 ? LP_mypeer->numutxos : -1); - if ( LP_mypeer != 0 && LP_mypeer->numutxos < mostutxos && mostpeer != 0 && time(NULL) > lastresync+10 ) + if ( LP_mypeer != 0 && mostpeer != 0 && ((LP_mypeer->numutxos < mostutxos && time(NULL) > lastresync+10) || time(NULL) > lastresync+60) ) { //printf("myutxos.%d most.%d %s\n",LP_mypeer->numutxos,mostutxos,mostpeer->ipaddr); LP_peer_utxosquery(LP_mypeer,myport,pubsock,mostpeer,now,60,(mostutxos-LP_mypeer->numutxos) * 2); From 0718673a829292c2468fab72d1602d182339c178 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 09:06:43 +0200 Subject: [PATCH 671/682] Possible fix --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index d3257cbc4..9899b9cac 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2093,7 +2093,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) if ( (flags & 1) == 0 && (size= signed_nn_recv(&freeptr,myinfo,myinfo->notaries,myinfo->numnotaries,myinfo->dpowsock,&np)) > 0 ) { num++; - if ( size > 0 ) + if ( size >= sizeof(*np) ) { //fprintf(stderr,"%d ",size); if ( np->version0 == (DPOW_VERSION & 0xff) && np->version1 == ((DPOW_VERSION >> 8) & 0xff) ) From d9d0a37152c60b39104f436e6528fb143ae4514c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 09:35:44 +0200 Subject: [PATCH 672/682] Test --- iguana/exchanges/LP_scan.c | 53 +++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index c65dedb65..5ba4c709c 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -264,6 +264,42 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e return(endheight); } +char *banned_txids[] = +{ + "78cb4e21245c26b015b888b14c4f5096e18137d2741a6de9734d62b07014dfca", //233559 + "00697be658e05561febdee1aafe368b821ca33fbb89b7027365e3d77b5dfede5", //234172 + "e909465788b32047c472d73e882d79a92b0d550f90be008f76e1edaee6d742ea", //234187 + "f56c6873748a327d0b92b8108f8ec8505a2843a541b1926022883678fb24f9dc", //234188 + "abf08be07d8f5b3a433ddcca7ef539e79a3571632efd6d0294ec0492442a0204", //234213 + "3b854b996cc982fba8c06e76cf507ae7eed52ab92663f4c0d7d10b3ed879c3b0", //234367 + "fa9e474c2cda3cb4127881a40eb3f682feaba3f3328307d518589024a6032cc4", //234635 + "ca746fa13e0113c4c0969937ea2c66de036d20274efad4ce114f6b699f1bc0f3", //234662 + "43ce88438de4973f21b1388ffe66e68fda592da38c6ef939be10bb1b86387041", //234697 + "0aeb748de82f209cd5ff7d3a06f65543904c4c17387c9d87c65fd44b14ad8f8c", //234899 + "bbd3a3d9b14730991e1066bd7c626ca270acac4127131afe25f877a5a886eb25", //235252 + "fa9943525f2e6c32cbc243294b08187e314d83a2870830180380c3c12a9fd33c", //235253 + "a01671c8775328a41304e31a6693bbd35e9acbab28ab117f729eaba9cb769461", //235265 + "2ef49d2d27946ad7c5d5e4ab5c089696762ff04e855f8ab48e83bdf0cc68726d", //235295 + "c85dcffb16d5a45bd239021ad33443414d60224760f11d535ae2063e5709efee", //235296 + // all vouts banned + "c4ea1462c207547cd6fb6a4155ca6d042b22170d29801a465db5c09fec55b19d", //246748 + "305dc96d8bc23a69d3db955e03a6a87c1832673470c32fe25473a46cc473c7d1", //247204 +}; + +int32_t komodo_bannedset(int32_t *indallvoutsp,bits256 *array,int32_t max) +{ + int32_t i; + if ( sizeof(banned_txids)/sizeof(*banned_txids) > max ) + { + fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",sizeof(banned_txids)/sizeof(*banned_txids),max); + exit(-1); + } + for (i=0; isymbol,lastcoin) == 0 ) @@ -335,6 +372,16 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { if ( tx->height < height ) { + for (j=0; jtxid) == 0 ) + break; + if ( j < numbanned ) + { + for (i=0; inumvouts; i++) + banned_balance += tx->outpoints[i].value; + char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + continue; + } for (i=0; inumvouts; i++) { if ( (ht=tx->outpoints[i].spendheight) > 0 && ht < height ) From d10537554af39da9c06a9e25467e2829d756491c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 16:40:08 +0200 Subject: [PATCH 673/682] Fflush --- iguana/exchanges/LP_scan.c | 22 +++++++++++++--------- iguana/iguana_peers.c | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 5ba4c709c..f6be836b0 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -319,7 +319,7 @@ int sort_balance(void *a,void *b) cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { static bits256 bannedarray[64]; static int32_t numbanned,indallvouts,maxsnapht; static char lastcoin[16]; - struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t i,j,n,skipflag=0,startht,endht,ht; uint64_t banned_balance=0,balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; + struct LP_transaction *tx,*tmp; struct LP_address *ap,*atmp; int32_t isKMD,i,j,n,skipflag=0,startht,endht,ht; uint64_t banned_balance=0,balance=0,noaddr_balance=0; cJSON *retjson,*array,*item; if ( bannedarray[0].txid == 0 ) numbanned = komodo_bannedset(&indallvouts,bannedarray,(int32_t)(sizeof(bannedarray)/sizeof(*bannedarray))); startht = 1; @@ -368,19 +368,23 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { ap->balance = 0; } + isKMD = (strcmp(coin->symbol,"KMD") == 0) ? 1 : 0; HASH_ITER(hh,coin->transactions,tx,tmp) { if ( tx->height < height ) { - for (j=0; jtxid) == 0 ) - break; - if ( j < numbanned ) + if ( isKMD != 0 ) { - for (i=0; inumvouts; i++) - banned_balance += tx->outpoints[i].value; - char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); - continue; + for (j=0; jtxid) == 0 ) + break; + if ( j < numbanned ) + { + for (i=0; inumvouts; i++) + banned_balance += tx->outpoints[i].value; + char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + continue; + } } for (i=0; inumvouts; i++) { diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index c5ed454bd..8fd57e8a7 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -488,6 +488,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) { sleep(1); printf("ERROR BINDING PORT.%d. this is normal tcp timeout, unless another process is using port\n",port); + fflush(stdout); sleep(3); printf("%s(%s) port.%d try again: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); if ( bindflag == 1 ) From 14e62961a58506a08684a588a0256518bb1bd32a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 17:27:47 +0200 Subject: [PATCH 674/682] Test --- iguana/exchanges/LP_scan.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index f6be836b0..28570eddb 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -217,8 +217,8 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) int32_t LP_blockinit(struct iguana_info *coin,int32_t height) { - int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; - if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 ) + int32_t i,j,iter,numtx,checkht=-1; cJSON *blockobj,*txs; bits256 txid; struct LP_transaction *tx; + if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height ) { if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 ) { @@ -236,8 +236,24 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height) tx->height = height; } if ( iter == 1 ) - LP_transactioninit(coin,txid,iter); - } else LP_transactioninit(coin,txid,iter); + for (j=0; j<10; j++) + { + if (LP_transactioninit(coin,txid,iter) == 0 ) + break; + printf("transaction ht.%d init error.%d, pause\n",height,j); + sleep(1); + } + } + else + { + for (j=0; j<10; j++) + { + if (LP_transactioninit(coin,txid,iter) == 0 ) + break; + printf("transaction ht.%d init error.%d, pause\n",height,j); + sleep(1); + } + } } } free_json(blockobj); From 29ebb2053382c875606e0452df31840e7e6a074c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 17:49:22 +0200 Subject: [PATCH 675/682] Test --- iguana/exchanges/LP_scan.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 28570eddb..fbf51e07b 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -173,16 +173,13 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { if ( (addresses= jarray(&n,sobj,"addresses")) != 0 && n > 0 ) { - //printf("%s\n",jprint(addresses,0)); if ( n > 1 ) printf("LP_transactioninit: txid.(%s) multiple addresses.[%s]\n",bits256_str(str,txid),jprint(addresses,0)); if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - if ( 0 && strcmp(address,"RXzsovGBQ3W97xnVC6JnWxXsV4qb7p7iBi") == 0 ) - printf("%s %.8f at height.%d\n",address,dstr(tx->outpoints[i].value),height); - } - } + } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); + } else printf("LP_transactioninit: unexpected address.(%p)\n",jprint(addresses,0)); } } } @@ -204,7 +201,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } From 0286647976dd10847580d42e1dee8cae2670d053 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 20:50:03 +0200 Subject: [PATCH 676/682] Test --- iguana/exchanges/LP_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index fbf51e07b..06795f570 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -179,7 +179,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { strcpy(tx->outpoints[i].coinaddr,address); } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected address.(%p)\n",jprint(addresses,0)); + } else printf("LP_transactioninit: unexpected address.(%p) (%s) n.%d\n",jprint(addresses,0),addresses!=0?jprint(addresses,0):"",n); } } } @@ -395,7 +395,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) { for (i=0; inumvouts; i++) banned_balance += tx->outpoints[i].value; - char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); + //char str[256]; printf("skip banned %s bannedtotal: %.8f\n",bits256_str(str,tx->txid),dstr(banned_balance)); continue; } } From d2fcdd399fca8b6e21466ededbd03457e5535547 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 21:11:48 +0200 Subject: [PATCH 677/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 06795f570..54620fbae 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -179,7 +179,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) { strcpy(tx->outpoints[i].coinaddr,address); } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected address.(%p) (%s) n.%d\n",jprint(addresses,0),addresses!=0?jprint(addresses,0):"",n); + } else printf("LP_transactioninit: unexpected addresses ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } } From 14ddcdb47bdd9359b459c0fb76c5d7eac0e32ea8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 22:05:44 +0200 Subject: [PATCH 678/682] Remove coins without rpcports --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/coins | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 4c5b047bb..4fe15c882 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -13,7 +13,8 @@ * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ -//alice only coins +//alice only coins GAME UNO BTM ANC: GAME BTCD PPC RDD XZC POT EAC FTC BASH SPR WDC UNO XPM XCN BELA CHC DIME MEC NAUT MED AUR MAX DGC RIC EB3 DOT BTM GEO ANC CANN ICASH WBB SRC PTC ADZ TIPS EQT START EFL FST FJC NYC GCN + // // LP_nativeDEX.c // marketmaker diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 9bae7a503..672a72d67 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"MZC\", \"name\":\"mazacoin\", \"pubtype\":50, \"p2shtype\":9, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"UNO\", \"name\":\"unobtanium\", \"pubtype\":130, \"p2shtype\":30, \"wiftype\":224, \"txfee\":1000000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"BTM\", \"name\":\"bitmark\", \"pubtype\":85, \"p2shtype\":5, \"wiftype\":213, \"txfee\":10000}, {\"coin\":\"CARB\", \"name\":\"carboncoin\", \"pubtype\":47, \"p2shtype\":5, \"wiftype\":175, \"txfee\":10000}, {\"coin\":\"ANC\", \"name\":\"anoncoin\", \"pubtype\":23, \"p2shtype\":5, \"wiftype\":151, \"txfee\":2000000}, {\"coin\":\"FRK\", \"name\":\"franko\", \"pubtype\":35, \"p2shtype\":5, \"wiftype\":163, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" +export coins="[ {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":1000000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"Mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":50000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":1000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"SHARK\",\"asset\":\"SHARK\",\"rpcport\":10114}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From 9aef751c4d08a24cbca27b0eeea034636fddfe36 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Aug 2017 22:06:56 +0200 Subject: [PATCH 679/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 54620fbae..123b79e92 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -201,7 +201,7 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) tx->outpoints[spentvout].spendheight = height; //printf("spend %s %s/v%d at ht.%d\n",coin->symbol,bits256_str(str,tx->txid),spentvout,height); } else printf("LP_transactioninit: %s spentvout.%d < numvouts.%d\n",bits256_str(str,spenttxid),spentvout,tx->numvouts); - } else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); + } //else printf("LP_transactioninit: couldnt find (%s) ht.%d %s\n",bits256_str(str,spenttxid),height,jprint(vin,0)); if ( bits256_cmp(spenttxid,txid) == 0 ) printf("spending same tx's %p vout ht.%d %s.[%d] s%d\n",tx,height,bits256_str(str,txid),tx!=0?tx->numvouts:0,spentvout); } From 9187a5b0de8a545700bc2e091c7c7a8693e0a493 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 31 Aug 2017 00:02:56 +0200 Subject: [PATCH 680/682] Test --- iguana/exchanges/LP_scan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 123b79e92..0e91b26ca 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -178,8 +178,11 @@ int32_t LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter) if ( (address= jstri(addresses,0)) != 0 && strlen(address) < sizeof(tx->outpoints[i].coinaddr) ) { strcpy(tx->outpoints[i].coinaddr,address); - } else printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); - } else printf("LP_transactioninit: unexpected addresses ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); + } else if ( tx->outpoints[i].value != 0 ) + printf("LP_transactioninit: unexpected address.(%s)\n",jprint(addresses,0)); + } + //else if ( tx->outpoints[i].value != 0 ) + // printf("LP_transactioninit: pax tx ht.%d i.%d (%s) n.%d\n",height,i,jprint(vout,0),n); } } } From 8100e15a3e6dd7826ecfef67eece19ed3f0ef830 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 31 Aug 2017 00:26:28 +0200 Subject: [PATCH 681/682] Test --- iguana/exchanges/LP_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 0e91b26ca..60a66c006 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -446,7 +446,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson array = cJSON_CreateArray(); if ( (snapjson= LP_snapshot(coin,height)) != 0 ) { - total = jdouble(snapjson,"total"); + total = jdouble(snapjson,"total") * SATOSHIDEN; if ( (addrs= jarray(&m,argjson,"addresses")) != 0 ) { if ( (balances= jarray(&n,snapjson,"balances")) != 0 ) From 41f57c9ca67ffcb096c35ac2aff1015502b3ddae Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Sep 2017 11:52:13 +0200 Subject: [PATCH 682/682] Bestflag --- iguana/exchanges/LP_ordermatch.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index e32930cda..3e3edf622 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -606,7 +606,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, vout = jint(item,"vout"); vol = jdouble(item,"volume"); metric = price / bestprice; - if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 )//&& butxo->T.bestflag == 0 ) + if ( (butxo= LP_utxofind(1,txid,vout)) != 0 && (long long)(vol*SATOSHIDEN) == butxo->S.satoshis && LP_isavailable(butxo) > 0 && LP_ismine(butxo) == 0 && butxo->T.bestflag == 0 ) { if ( LP_iseligible(&val,&val2,butxo->iambob,butxo->coin,butxo->payment.txid,butxo->payment.vout,butxo->S.satoshis,butxo->deposit.txid,butxo->deposit.vout) > 0 ) { @@ -662,6 +662,27 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, break; } } + if ( bestutxo == 0 ) + { + int32_t numrestraints; + for (i=numrestraints=0; iT.bestflag = 0; + pubp->numerrors = 0; + } + } + } + printf("no bob utxo found -> cleared %d restraints\n",numrestraints); + } } free_json(orderbook); } @@ -669,6 +690,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, } if ( bestutxo == 0 || *ordermatchpricep == 0. || *bestdestsatoshisp == 0 ) return(0); + bestutxo->T.bestflag = 1; int32_t changed; LP_mypriceset(&changed,autxo->coin,base,1. / *ordermatchpricep); return(bestutxo);