Browse Source

Merge branch 'spvdex' of https://github.com/jl777/SuperNET into dev-decker-spvdex

# Conflicts:
#	iguana/exchanges/LP_nativeDEX.c
#	iguana/exchanges/LP_socket.c
etomic
DeckerSU 8 years ago
parent
commit
efc493e9da
  1. 1
      .gitignore
  2. 8
      crypto777/OS_nonportable.c
  3. 2
      crypto777/nanosrc/utils/win.h
  4. 2
      iguana/coins/mnz_7776
  5. 3
      iguana/exchanges/LP_coins.c
  6. 40
      iguana/exchanges/LP_nativeDEX.c
  7. 40
      iguana/exchanges/LP_ordermatch.c
  8. 230
      iguana/exchanges/LP_remember.c
  9. 12
      iguana/exchanges/LP_rpc.c
  10. 19
      iguana/exchanges/LP_socket.c
  11. 19
      iguana/exchanges/LP_statemachine.c
  12. 2
      iguana/exchanges/LP_swap.c
  13. 30
      iguana/exchanges/LP_transaction.c
  14. 72
      iguana/exchanges/LP_utxo.c
  15. 17
      iguana/exchanges/LP_utxos.c
  16. 3
      iguana/exchanges/coins.json
  17. 1
      iguana/exchanges/install
  18. 4
      iguana/exchanges/stats.c
  19. 1
      iguana/help/InstantDEX_DEXratio.json
  20. 1
      iguana/help/InstantDEX_accept.json
  21. 1
      iguana/help/InstantDEX_allcoins.json
  22. 1
      iguana/help/InstantDEX_allexchanges.json
  23. 1
      iguana/help/InstantDEX_allpairs.json
  24. 1
      iguana/help/InstantDEX_apikeypair.json
  25. 1
      iguana/help/InstantDEX_automatched.json
  26. 1
      iguana/help/InstantDEX_available.json
  27. 1
      iguana/help/InstantDEX_balance.json
  28. 1
      iguana/help/InstantDEX_buy.json
  29. 1
      iguana/help/InstantDEX_cancelorder.json
  30. 1
      iguana/help/InstantDEX_getswaplist.json
  31. 1
      iguana/help/InstantDEX_incoming.json
  32. 1
      iguana/help/InstantDEX_init.json
  33. 1
      iguana/help/InstantDEX_openorders.json
  34. 1
      iguana/help/InstantDEX_orderbook.json
  35. 1
      iguana/help/InstantDEX_orderstatus.json
  36. 1
      iguana/help/InstantDEX_pollgap.json
  37. 1
      iguana/help/InstantDEX_request.json
  38. 1
      iguana/help/InstantDEX_sell.json
  39. 1
      iguana/help/InstantDEX_setuserid.json
  40. 1
      iguana/help/InstantDEX_smartaddress.json
  41. 1
      iguana/help/InstantDEX_smartaddresses.json
  42. 1
      iguana/help/InstantDEX_supports.json
  43. 1
      iguana/help/InstantDEX_tradehistory.json
  44. 1
      iguana/help/InstantDEX_withdraw.json
  45. 1
      iguana/help/SuperNET_activehandle.json
  46. 1
      iguana/help/SuperNET_addr2rmd160.json
  47. 1
      iguana/help/SuperNET_bitcoinrpc.json
  48. 1
      iguana/help/SuperNET_broadcastcipher.json
  49. 1
      iguana/help/SuperNET_broadcastdecipher.json
  50. 1
      iguana/help/SuperNET_cipher.json
  51. 1
      iguana/help/SuperNET_decipher.json
  52. 1
      iguana/help/SuperNET_decryptjson.json
  53. 1
      iguana/help/SuperNET_encryptjson.json
  54. 1
      iguana/help/SuperNET_getpeers.json
  55. 1
      iguana/help/SuperNET_help.json
  56. 1
      iguana/help/SuperNET_html.json
  57. 1
      iguana/help/SuperNET_keypair.json
  58. 1
      iguana/help/SuperNET_layer.json
  59. 1
      iguana/help/SuperNET_login.json
  60. 1
      iguana/help/SuperNET_logout.json
  61. 1
      iguana/help/SuperNET_multicastcipher.json
  62. 1
      iguana/help/SuperNET_multicastdecipher.json
  63. 1
      iguana/help/SuperNET_myipaddr.json
  64. 1
      iguana/help/SuperNET_mypeers.json
  65. 1
      iguana/help/SuperNET_priv2pub.json
  66. 1
      iguana/help/SuperNET_priv2wif.json
  67. 1
      iguana/help/SuperNET_rmd160conv.json
  68. 1
      iguana/help/SuperNET_rosetta.json
  69. 1
      iguana/help/SuperNET_saveconf.json
  70. 1
      iguana/help/SuperNET_setmyipaddr.json
  71. 1
      iguana/help/SuperNET_stop.json
  72. 1
      iguana/help/SuperNET_utc2utime.json
  73. 1
      iguana/help/SuperNET_utime2utc.json
  74. 1
      iguana/help/SuperNET_wif2priv.json
  75. 1
      iguana/help/basilisk_addrelay.json
  76. 1
      iguana/help/basilisk_balances.json
  77. 1
      iguana/help/basilisk_cancelrefresh.json
  78. 1
      iguana/help/basilisk_dispatch.json
  79. 1
      iguana/help/basilisk_forward.json
  80. 1
      iguana/help/basilisk_geckoblock.json
  81. 1
      iguana/help/basilisk_geckoget.json
  82. 1
      iguana/help/basilisk_geckoheaders.json
  83. 1
      iguana/help/basilisk_geckotx.json
  84. 1
      iguana/help/basilisk_genesis_opreturn.json
  85. 1
      iguana/help/basilisk_getmessage.json
  86. 1
      iguana/help/basilisk_history.json
  87. 1
      iguana/help/basilisk_mailbox.json
  88. 1
      iguana/help/basilisk_paxfiats.json
  89. 1
      iguana/help/basilisk_publish.json
  90. 1
      iguana/help/basilisk_rawtx.json
  91. 1
      iguana/help/basilisk_refresh.json
  92. 1
      iguana/help/basilisk_sendmessage.json
  93. 1
      iguana/help/basilisk_subscribe.json
  94. 1
      iguana/help/basilisk_utxocombine.json
  95. 1
      iguana/help/basilisk_utxorawtx.json
  96. 1
      iguana/help/basilisk_value.json
  97. 1
      iguana/help/bitcoinrpc_addmultisigaddress.json
  98. 1
      iguana/help/bitcoinrpc_backupwallet.json
  99. 1
      iguana/help/bitcoinrpc_checkwallet.json
  100. 1
      iguana/help/bitcoinrpc_createmultisig.json

1
.gitignore

@ -170,7 +170,6 @@ iguana/help.json
iguana/index7778.html
*.json
iguana/DB/KMD/utxo.dat

8
crypto777/OS_nonportable.c

@ -26,10 +26,10 @@
* not from the mingw header, so we need to include the windows header
* if we are compiling in windows 64bit
*/
#if defined(_M_X64)
#define WIN32_LEAN_AND_MEAN
#include <WinSock2.h>
#endif
//#if defined(_M_X64)
//#define WIN32_LEAN_AND_MEAN
//#include <WinSock2.h>
//#endif
#include "OS_portable.h"

2
crypto777/nanosrc/utils/win.h

@ -27,8 +27,8 @@
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
#include <process.h>
#include <ws2tcpip.h>

2
iguana/coins/mnz_7776

@ -1,2 +1,2 @@
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}"
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"MNZ.conf\",\"path\":\"${HOME#"/"}/.komodo/MNZ\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"MNZ\",\"name\":\"MNZ\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"53d06fde\",\"p2p\":14336,\"rpc\":14337,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}"

3
iguana/exchanges/LP_coins.c

@ -280,7 +280,8 @@ int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asset
coin->taddr = taddr;
coin->wiftaddr = wiftaddr;
coin->longestchain = longestchain;
coin->txfee = txfee;
if ( (coin->txfee= txfee) > 0 && txfee < LP_MIN_TXFEE )
coin->txfee = LP_MIN_TXFEE;
coin->pubtype = pubtype;
coin->p2shtype = p2shtype;
coin->wiftype = wiftype;

40
iguana/exchanges/LP_nativeDEX.c

@ -19,11 +19,13 @@
// LP_nativeDEX.c
// marketmaker
//
// SPV at tx level
// new features:
// SPV at tx level and limit SPV proofing
// coins file
// stats, fix pricearray
// sign packets
// dPoW security
// electrum peers
// withdraw
// verify portfolio
// bittrex balancing
@ -507,7 +509,8 @@ 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);
if ( (coin->lastscanht % 1000) == 0 )
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);
@ -593,7 +596,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();
char *myipaddr=0; long filesize,n; int32_t timeout,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx();
LP_showwif = juint(argjson,"wif");
if ( passphrase == 0 || passphrase[0] == 0 )
{
@ -651,11 +654,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
portable_mutex_init(&LP_messagemutex);
portable_mutex_init(&LP_portfoliomutex);
portable_mutex_init(&LP_butxomutex);
#ifndef _WIN32
if ( system("curl -s4 checkip.amazonaws.com > DB/myipaddr") == 0 )
{
char ipfname[64];
strcpy(ipfname, "DB/myipaddr");
if ((myipaddr = OS_filestr(&filesize, ipfname)) != 0 && myipaddr[0] != 0)
char ipfname[64];
strcpy(ipfname,"DB/myipaddr");
if ( (myipaddr= OS_filestr(&filesize,ipfname)) != 0 && myipaddr[0] != 0 )
{
n = strlen(myipaddr);
if ( myipaddr[n-1] == '\n' )
@ -663,6 +667,9 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
strcpy(LP_myipaddr,myipaddr);
} else printf("error getting myipaddr\n");
} else printf("error issuing curl\n");
#else
myipaddr = clonestr("127.0.0.1");
#endif
if ( IAMLP != 0 )
{
pubsock = -1;
@ -694,8 +701,23 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
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"));
if ( (coinsjson= jobj(argjson,"coins")) == 0 )
{
if ( (coins_str= OS_filestr(&filesize,"coins.json")) != 0 )
{
unstringify(coins_str);
printf("UNSTRINGIFIED.(%s)\n",coins_str);
coinsjson = cJSON_Parse(coins_str);
free(coins_str);
// yes I know this coinsjson is not freed, not sure about if it is referenced
}
}
if ( coinsjson == 0 )
{
printf("no coins object or coins file, must abort\n");
exit(-1);
}
LP_initcoins(ctx,pubsock,coinsjson);
G.waiting = 1;
LP_passphrase_init(passphrase,jstr(argjson,"gui"));
if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 )

40
iguana/exchanges/LP_ordermatch.c

@ -316,12 +316,12 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str
if ( strcmp(autxo->coinaddr,qp->destaddr) != 0 )
return(-10);
}
if ( autxo != 0 && destvalue < qp->desttxfee+qp->destsatoshis )
if ( autxo != 0 && destvalue < 2*qp->desttxfee+qp->destsatoshis )
{
printf("destvalue %.8f destsatoshis %.8f is too small txfee %.8f?\n",dstr(destvalue),dstr(qp->destsatoshis),dstr(qp->desttxfee));
return(-11);
}
if ( butxo != 0 && srcvalue < qp->txfee+qp->satoshis )
if ( butxo != 0 && srcvalue < 2*qp->txfee+qp->satoshis )
{
printf("srcvalue %.8f [%.8f] satoshis %.8f is too small txfee %.8f?\n",dstr(srcvalue),dstr(srcvalue) - dstr(qp->txfee+qp->satoshis),dstr(qp->satoshis),dstr(qp->txfee));
return(-33);
@ -441,17 +441,33 @@ int32_t LP_nanobind(void *ctx,char *pairstr)
return(pairsock);
}
int32_t LP_nearest_utxovalue(int32_t noSPV,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval)
int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **utxos,int32_t n,uint64_t targetval)
{
int32_t i,mini = -1; int64_t dist; uint64_t mindist = (1LL << 60);
int32_t i,mini = -1; struct LP_address_utxo *up; struct electrum_info *backupep=0,*ep; char str[65]; int64_t dist; uint64_t mindist = (1LL << 60);
if ( (ep= coin->electrum) != 0 )
{
if ( (backupep= ep->prev) == 0 )
backupep = ep;
}
for (i=0; i<n; i++)
{
if ( utxos[i] != 0 && (noSPV != 0 || (utxos[i]->spendheight == 0 && utxos[i]->SPV > 0)) )
if ( (up= utxos[i]) != 0 && up->spendheight == 0 )
{
dist = (utxos[i]->U.value - targetval);
if ( coin->electrum != 0 )
{
if (up->SPV == 0 )
up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height);
printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV);
if ( up->SPV < 0 )
{
printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid));
continue;
}
}
dist = (up->U.value - targetval);
if ( dist >= 0 && dist < mindist )
{
printf("(%.8f %.8f %.8f).%d ",dstr(utxos[i]->U.value),dstr(dist),dstr(mindist),mini);
printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini);
mini = i;
mindist = dist;
}
@ -484,12 +500,12 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **
printf("targetval %.8f vol %.8f price %.8f txfee %.8f %s\n",dstr(targetval),relvolume,price,dstr(txfee),coinaddr);
}
mini = -1;
if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 )
if ( targetval != 0 && (mini= LP_nearest_utxovalue(coin,utxos,m,targetval)) >= 0 && (double)utxos[mini]->U.value/targetval < LP_MINVOL-1 )
{
up = utxos[mini];
utxos[mini] = 0;
targetval2 = (targetval / 8) * 9 + 2*txfee;
if ( (mini= LP_nearest_utxovalue(coin->electrum == 0,utxos,m,targetval2)) >= 0 )
if ( (mini= LP_nearest_utxovalue(coin,utxos,m,targetval2 * 1.01)) >= 0 )
{
if ( up != 0 && (up2= utxos[mini]) != 0 )
{
@ -557,7 +573,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-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector);
LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-2*qp->txfee,rel,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector);
printf("call swapinit\n");
swap = LP_swapinit(1,0,privkey,&qp->R,qp);
printf("swapinit.%p\n",swap);
@ -667,7 +683,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.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,DEXselector);
LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-2*Q.txfee,Q.destcoin,Q.destsatoshis-2*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;
@ -875,7 +891,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,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector);
LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-2*qp->txfee,qp->destcoin,qp->destsatoshis-2*qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector);
expiration = (uint32_t)time(NULL) + timeout;
while ( time(NULL) < expiration )
{

230
iguana/exchanges/LP_remember.c

@ -264,23 +264,24 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag
if ( bits256_nonz(spendtxid) != 0 )
{
sentflags[utxoind] = 1;
printf("utxoind.%d Alice.(%s) Bob.(%s)\n",utxoind,aliceaddr,bobaddr);
if ( aliceaddr != 0 && strcmp(destaddr,aliceaddr) == 0 )
{
//printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr);
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);
printf("BOB spent.(%s) -> %s\n",bits256_str(str,txid),destaddr);
sentflags[bobspent] = 1;
sentflags[alicespent] = 0;
txids[bobspent] = spendtxid;
}
else
{
//printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr);
printf("OTHER dest spent.(%s) -> %s\n",bits256_str(str,txid),destaddr);
if ( aliceaddr != 0 )
{
sentflags[bobspent] = 1;
@ -334,7 +335,6 @@ int32_t basilisk_isbobcoin(int32_t iambob,int32_t ind)
}
}
// add blocktrail presence requirement for BTC
int32_t basilisk_swap_isfinished(int32_t iambob,bits256 *txids,int32_t *sentflags,bits256 paymentspent,bits256 Apaymentspent,bits256 depositspent)
{
int32_t i,n = 0;
@ -615,15 +615,35 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t
}
}
}
rswap->origfinishedflag = rswap->finishedflag = 1;
rswap->origfinishedflag = basilisk_swap_isfinished(rswap->iambob,rswap->txids,rswap->sentflags,rswap->paymentspent,rswap->Apaymentspent,rswap->depositspent);
rswap->finishedflag = rswap->origfinishedflag;
free(fstr);
}
return(rswap->iambob);
}
void LP_refht_update(char *symbol,bits256 txid)
{
int32_t ht; struct iguana_info *coin;
if ( (coin= LP_coinfind(symbol)) != 0 ) // && coin->electrum == 0
{
if ( (ht= LP_txheight(coin,txid)) > 0 && ht > 0 )
{
if ( coin->firstrefht == 0 || ht < coin->firstrefht )
{
if ( coin->firstscanht == 0 || ht < coin->firstscanht )
coin->firstscanht = coin->lastscanht = ht;
coin->firstrefht = ht;
char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),ht,coin->firstscanht,coin->lastscanht);
}
}
}
}
int32_t LP_swap_load(struct LP_swap_remember *rswap)
{
int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj; bits256 txid,checktxid; uint64_t value;
rswap->iambob = -1;
for (i=0; i<sizeof(txnames)/sizeof(*txnames); i++)
{
needflag = addflag = 0;
@ -636,7 +656,8 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
if ( (txobj= cJSON_Parse(fstr)) != 0 )
{
//printf("TXOBJ.(%s)\n",jprint(txobj,0));
rswap->iambob = jint(txobj,"iambob");
if ( jobj(txobj,"iambob") != 0 )
rswap->iambob = jint(txobj,"iambob");
txid = jbits256(txobj,"txid");
if ( bits256_nonz(txid) == 0 )
continue;
@ -663,6 +684,26 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
decode_hex(rswap->Dredeemscript,rswap->Dredeemlen,rstr);
}
rswap->values[i] = value = LP_value_extract(txobj,1);
if ( (symbol= jstr(txobj,"src")) != 0 )
{
safecopy(rswap->src,symbol,sizeof(rswap->src));
if ( rswap->iambob >= 0 )
{
if ( rswap->iambob > 0 )
safecopy(rswap->bobcoin,symbol,sizeof(rswap->bobcoin));
else safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin));
}
}
if ( (symbol= jstr(txobj,"dest")) != 0 )
{
safecopy(rswap->dest,symbol,sizeof(rswap->dest));
if ( rswap->iambob >= 0 )
{
if ( rswap->iambob == 0 )
safecopy(rswap->bobcoin,symbol,sizeof(rswap->bobcoin));
else safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin));
}
}
if ( (symbol= jstr(txobj,"coin")) != 0 )
{
if ( i == BASILISK_ALICESPEND || i == BASILISK_BOBPAYMENT || i == BASILISK_BOBDEPOSIT || i == BASILISK_BOBREFUND || i == BASILISK_BOBRECLAIM || i == BASILISK_ALICECLAIM )
@ -671,19 +712,14 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
safecopy(rswap->alicecoin,symbol,sizeof(rswap->alicecoin));
if ( rswap->finishedflag == 0 )
{
LP_refht_update(symbol,txid);
if ( (sentobj= LP_gettx(symbol,txid)) == 0 )
{
char str2[65]; printf("%s %s ready to broadcast\n",symbol,bits256_str(str2,txid));
}
else
{
struct iguana_info *coin; int32_t ht = -1;
checktxid = jbits256(sentobj,"txid");
if ( (coin= LP_coinfind(symbol)) != 0 && (ht= LP_txheight(coin,txid)) > 0 && ht > 0 )
{
if ( coin->firstrefht == 0 || ht < coin->firstrefht )
coin->firstrefht = ht;
}
if ( bits256_nonz(checktxid) == 0 )
checktxid = jbits256(sentobj,"hash");
if ( bits256_cmp(checktxid,txid) == 0 )
@ -702,20 +738,32 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
} else if ( 0 && rswap->finishedflag == 0 )
printf("%s not finished\n",fname);
}
if ( rswap->bobcoin[0] == 0 )
strcpy(rswap->bobcoin,rswap->src);
if ( rswap->alicecoin[0] == 0 )
strcpy(rswap->alicecoin,rswap->dest);
if ( rswap->src[0] == 0 )
strcpy(rswap->src,rswap->bobcoin);
if ( rswap->dest[0] == 0 )
strcpy(rswap->dest,rswap->alicecoin);
return(rswap->finishedflag);
}
/*{
if ( txbytes[BASILISK_BOBREFUND] != 0 )
void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits256 *ptr,int32_t *flagp)
{
bits256 zero;
memset(zero.bytes,0,sizeof(zero));
if ( txbytes != 0 )
{
txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",bobcoin,txbytes[BASILISK_BOBREFUND],zero);
if ( bits256_nonz(txids[BASILISK_BOBREFUND]) != 0 ) // tested
*txidp = LP_broadcast(name,symbol,txbytes,zero);
if ( bits256_nonz(*txidp) != 0 )
{
sentflags[BASILISK_BOBREFUND] = 1;
depositspent = txids[BASILISK_BOBREFUND];
*flagp = 1;
if ( ptr != 0 )
*ptr = *txidp;
}
}
}*/
}
int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi)
{
@ -729,6 +777,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi
{
rswap->sentflags[txi] = 1;
free_json(sentobj);
LP_refht_update(symbol,rswap->txids[txi]);
return(1);
}
}
@ -742,56 +791,61 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
if ( ctx == 0 )
ctx = bitcoin_ctx();
if ( (rswap.iambob= LP_rswap_init(&rswap,requestid,quoteid)) < 0 )
return(0);
return(cJSON_Parse("{\"error\":\"couldnt initialize rswap, are all coins active?\"}"));
LP_swap_load(&rswap);
memset(zero.bytes,0,sizeof(zero));
Adest = Bdest = AAdest = ABdest = 0;
if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,rswap.src) != 0 || strcmp(rswap.alicecoin,rswap.dest) != 0 )
return(0);
{
printf("BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest);
return(cJSON_Parse("{\"error\":\"mismatched bob/alice vs src/dest coins??\"}"));
}
alice = LP_coinfind(rswap.alicecoin);
bob = LP_coinfind(rswap.bobcoin);
rswap.Atxfee = LP_txfeecalc(alice,rswap.Atxfee);
rswap.Btxfee = LP_txfeecalc(bob,rswap.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 ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 )
if ( rswap.iambob == 0 )
{
if ( rswap.iambob == 0 )
if ( alice != 0 )
{
if ( alice != 0 )
{
bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33);
AAdest = rswap.Adestaddr;
}
if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 )
{
bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33);
Adest = rswap.destaddr;
}
bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33);
AAdest = rswap.Adestaddr;
}
else
if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 )
{
if ( bob != 0 )
{
bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33);
Bdest = rswap.destaddr;
}
if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 )
{
bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33);
ABdest = rswap.Adestaddr;
}
bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33);
Adest = rswap.destaddr;
}
if ( bob == 0 || alice == 0 )
}
else
{
if ( bob != 0 )
{
printf("Bob.%p is null or Alice.%p is null\n",bob,alice);
return(0);
bitcoin_address(rswap.destaddr,bob->taddr,bob->pubtype,rswap.pubkey33,33);
Bdest = rswap.destaddr;
}
if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 )
{
bitcoin_address(rswap.Adestaddr,alice->taddr,alice->pubtype,rswap.pubkey33,33);
ABdest = rswap.Adestaddr;
}
}
if ( bob == 0 || alice == 0 )
{
printf("Bob.%p is null or Alice.%p is null\n",bob,alice);
return(cJSON_Parse("{\"error\":\"null bob or alice coin\"}"));
}
printf("ALICE 1st refht %s <- %d, scan %d %d\n",alice->symbol,alice->firstrefht,alice->firstscanht,alice->lastscanht);
printf("BOB 1st refht %s <- %d, scan %d %d\n",bob->symbol,bob->firstrefht,bob->firstscanht,bob->lastscanht);
//printf("iambob.%d finishedflag.%d %s %.8f txfee, %s %.8f txfee\n",rswap.iambob,rswap.finishedflag,rswap.alicecoin,dstr(rswap.Atxfee),rswap.bobcoin,dstr(rswap.Btxfee));
//printf("privAm.(%s) %p/%p\n",bits256_str(str,rswap.privAm),Adest,AAdest);
//printf("privBn.(%s) %p/%p\n",bits256_str(str,rswap.privBn),Bdest,ABdest);
if ( rswap.finishedflag == 0 && rswap.bobcoin[0] != 0 && rswap.alicecoin[0] != 0 )
{
if ( alice->inactive != 0 || bob->inactive != 0 )
{
printf("Alice.%s inactive.%u or Bob.%s inactive.%u\n",rswap.alicecoin,alice->inactive,rswap.bobcoin,bob->inactive);
return(0);
return(cJSON_Parse("{\"error\":\"inactive bob or alice coin\"}"));
}
LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT);
LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT);
@ -832,7 +886,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
printf("alicespend.(%s)\n",rswap.txbytes[BASILISK_ALICESPEND]);
}
}
if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 )
LP_txbytes_update("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],&rswap.txids[BASILISK_ALICESPEND],&rswap.paymentspent,&rswap.sentflags[BASILISK_ALICESPEND]);
/*if ( rswap.txbytes[BASILISK_ALICESPEND] != 0 )
{
rswap.txids[BASILISK_ALICESPEND] = LP_broadcast("alicespend",rswap.bobcoin,rswap.txbytes[BASILISK_ALICESPEND],zero);
if ( bits256_nonz(rswap.txids[BASILISK_ALICESPEND]) != 0 ) // tested
@ -840,7 +895,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_ALICESPEND] = 1;
rswap.paymentspent = rswap.txids[BASILISK_ALICESPEND];
}
}
}*/
}
}
if ( rswap.sentflags[BASILISK_ALICECLAIM] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 )
@ -864,7 +919,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
}
}
}
if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 )
LP_txbytes_update("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],&rswap.txids[BASILISK_ALICECLAIM],&rswap.depositspent,&rswap.sentflags[BASILISK_ALICECLAIM]);
/*if ( rswap.txbytes[BASILISK_ALICECLAIM] != 0 )
{
rswap.txids[BASILISK_ALICECLAIM] = LP_broadcast("aliceclaim",rswap.bobcoin,rswap.txbytes[BASILISK_ALICECLAIM],zero);
if ( bits256_nonz(rswap.txids[BASILISK_ALICECLAIM]) != 0 ) // tested
@ -872,7 +928,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_ALICECLAIM] = 1;
rswap.depositspent = rswap.txids[BASILISK_ALICECLAIM];
}
}
}*/
} else printf("now %u before expiration %u\n",(uint32_t)time(NULL),rswap.expiration);
}
if ( rswap.sentflags[BASILISK_ALICEPAYMENT] != 0 && bits256_nonz(rswap.Apaymentspent) == 0 && rswap.sentflags[BASILISK_ALICECLAIM] == 0 )
@ -886,7 +942,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
printf("privBn.(%s) alicereclaim.(%s)\n",bits256_str(str,rswap.privBn),rswap.txbytes[BASILISK_ALICERECLAIM]);
}
}
if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 )
LP_txbytes_update("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],&rswap.txids[BASILISK_ALICERECLAIM],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_ALICERECLAIM]);
/*if ( rswap.txbytes[BASILISK_ALICERECLAIM] != 0 )
{
rswap.txids[BASILISK_ALICERECLAIM] = LP_broadcast("alicereclaim",rswap.alicecoin,rswap.txbytes[BASILISK_ALICERECLAIM],zero);
if ( bits256_nonz(rswap.txids[BASILISK_ALICERECLAIM]) != 0 ) // tested
@ -894,7 +951,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_ALICERECLAIM] = 1;
rswap.Apaymentspent = rswap.txids[BASILISK_ALICERECLAIM];
}
}
}*/
}
}
else if ( rswap.iambob == 1 )
@ -916,7 +973,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
printf("bobspend.(%s)\n",rswap.txbytes[BASILISK_BOBSPEND]);
}
}
if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 )
LP_txbytes_update("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],&rswap.txids[BASILISK_BOBSPEND],&rswap.Apaymentspent,&rswap.sentflags[BASILISK_BOBSPEND]);
/*if ( rswap.txbytes[BASILISK_BOBSPEND] != 0 )
{
rswap.txids[BASILISK_BOBSPEND] = LP_broadcast("bobspend",rswap.alicecoin,rswap.txbytes[BASILISK_BOBSPEND],zero);
if ( bits256_nonz(rswap.txids[BASILISK_BOBSPEND]) != 0 ) // tested
@ -924,7 +982,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_BOBSPEND] = 1;
rswap.Apaymentspent = rswap.txids[BASILISK_BOBSPEND];
}
}
}*/
}
}
if ( rswap.sentflags[BASILISK_BOBRECLAIM] == 0 && rswap.sentflags[BASILISK_BOBPAYMENT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && time(NULL) > rswap.expiration && bits256_nonz(rswap.paymentspent) == 0 )
@ -945,7 +1003,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
}
}
}
if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 )
LP_txbytes_update("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],&rswap.txids[BASILISK_BOBRECLAIM],&rswap.paymentspent,&rswap.sentflags[BASILISK_BOBRECLAIM]);
/*if ( rswap.txbytes[BASILISK_BOBRECLAIM] != 0 )
{
rswap.txids[BASILISK_BOBRECLAIM] = LP_broadcast("bobreclaim",rswap.bobcoin,rswap.txbytes[BASILISK_BOBRECLAIM],zero);
if ( bits256_nonz(rswap.txids[BASILISK_BOBRECLAIM]) != 0 ) // tested
@ -953,7 +1012,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_BOBRECLAIM] = 1;
rswap.paymentspent = rswap.txids[BASILISK_BOBRECLAIM];
}
}
}*/
}
if ( rswap.sentflags[BASILISK_BOBREFUND] == 0 && rswap.sentflags[BASILISK_BOBDEPOSIT] != 0 && bits256_nonz(rswap.txids[BASILISK_BOBDEPOSIT]) != 0 && bits256_nonz(rswap.depositspent) == 0 )
{
@ -969,7 +1028,8 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
if ( (rswap.txbytes[BASILISK_BOBREFUND]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"bobrefund",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,1,rswap.expiration,&rswap.values[BASILISK_BOBREFUND],0,0,rswap.bobdepositaddr,1)) != 0 )
printf("pubB1.(%s) bobrefund.(%s)\n",bits256_str(str,rswap.pubB1),rswap.txbytes[BASILISK_BOBREFUND]);
}
if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 )
LP_txbytes_update("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],&rswap.txids[BASILISK_BOBREFUND],&rswap.depositspent,&rswap.sentflags[BASILISK_BOBREFUND]);
/*if ( rswap.txbytes[BASILISK_BOBREFUND] != 0 )
{
rswap.txids[BASILISK_BOBREFUND] = LP_broadcast("bobrefund",rswap.bobcoin,rswap.txbytes[BASILISK_BOBREFUND],zero);
if ( bits256_nonz(rswap.txids[BASILISK_BOBREFUND]) != 0 ) // tested
@ -977,7 +1037,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
rswap.sentflags[BASILISK_BOBREFUND] = 1;
rswap.depositspent = rswap.txids[BASILISK_BOBREFUND];
}
}
}*/
} else printf("bobrefund's time %u vs expiration %u\n",(uint32_t)time(NULL),rswap.expiration);
}
}
@ -1044,21 +1104,28 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
//,statebits; int32_t optionduration; struct basilisk_request R; bits256 privkey;
retjson = cJSON_CreateObject();
array = cJSON_CreateArray();
sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname);
if ( (fp= fopen(fname,"rb")) != 0 )
if ( origrequestid != 0 && origquoteid != 0 )
{
//struct basilisk_swap *swap;
int32_t flag = 0;
while ( fread(&requestid,1,sizeof(requestid),fp) == sizeof(requestid) && fread(&quoteid,1,sizeof(quoteid),fp) == sizeof(quoteid) )
//printf("orig req.%u q.%u\n",origrequestid,origquoteid);
if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 )
jaddi(array,item);
//printf("got.(%s)\n",jprint(item,0));
}
else
{
sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname);
if ( (fp= fopen(fname,"rb")) != 0 )
{
flag = 0;
for (i=0; i<G.LP_numskips; i++)
//struct basilisk_swap *swap;
int32_t flag = 0;
while ( fread(&requestid,1,sizeof(requestid),fp) == sizeof(requestid) && fread(&quoteid,1,sizeof(quoteid),fp) == sizeof(quoteid) )
{
r = (uint32_t)(G.LP_skipstatus[i] >> 32);
q = (uint32_t)G.LP_skipstatus[i];
if ( r == requestid && q == quoteid )
flag = 0;
for (i=0; i<G.LP_numskips; i++)
{
if ( r != origrequestid || q != origquoteid )
r = (uint32_t)(G.LP_skipstatus[i] >> 32);
q = (uint32_t)G.LP_skipstatus[i];
if ( r == requestid && q == quoteid )
{
item = cJSON_CreateObject();
jaddstr(item,"status","realtime");
@ -1066,21 +1133,17 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
jaddnum(item,"quoteid",q);
jaddi(array,item);
flag = 1;
break;
}
break;
}
}
if ( flag == 0 )
{
if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 )
if ( flag == 0 )
{
jaddi(array,item);
//if ( (status= jstr(item,"status")) != 0 && strcmp(status,"pending") == 0 )
// break;
if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 )
jaddi(array,item);
}
}
fclose(fp);
}
fclose(fp);
}
jaddstr(retjson,"result","success");
jadd(retjson,"swaps",array);
@ -1119,6 +1182,7 @@ char *basilisk_swapentry(uint32_t requestid,uint32_t quoteid)
char *liststr,*retstr = 0; cJSON *retjson,*array,*item; int32_t i,n;
if ( (liststr= basilisk_swaplist(requestid,quoteid)) != 0 )
{
//printf("swapentry.(%s)\n",liststr);
if ( (retjson= cJSON_Parse(liststr)) != 0 )
{
if ( (array= jarray(&n,retjson,"swaps")) != 0 )

12
iguana/exchanges/LP_rpc.c

@ -254,7 +254,9 @@ cJSON *LP_gettx(char *symbol,bits256 txid)
if ( coin->electrum == 0 )
{
sprintf(buf,"[\"%s\", 1]",bits256_str(str,txid));
return(bitcoin_json(coin,"getrawtransaction",buf));
retjson = bitcoin_json(coin,"getrawtransaction",buf);
printf("%s getrawtransaction %s -> %s\n",symbol,buf,jprint(retjson,0));
return(retjson);
}
else
{
@ -602,17 +604,23 @@ char *LP_sendrawtransaction(char *symbol,char *signedtx)
{
cJSON *array,*errobj; char *paramstr,*tmpstr,*retstr=0; int32_t n,alreadyflag = 0; cJSON *retjson; struct iguana_info *coin;
if ( symbol == 0 || symbol[0] == 0 )
{
printf("LP_sendrawtransaction null symbol\n");
return(0);
}
coin = LP_coinfind(symbol);
if ( coin == 0 )
{
printf("LP_sendrawtransaction null coin\n");
return(0);
}
if ( coin->electrum == 0 )
{
array = cJSON_CreateArray();
jaddistr(array,signedtx);
paramstr = jprint(array,1);
retstr = bitcoind_passthru(symbol,coin->serverport,coin->userpass,"sendrawtransaction",paramstr);
//printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr);
printf(">>>>>>>>>>> %s dpow_sendrawtransaction.(%s) -> (%s)\n",coin->symbol,paramstr,retstr);
free(paramstr);
}
else

19
iguana/exchanges/LP_socket.c

@ -21,14 +21,12 @@
* @remarks - #if (defined(_M_X64) || defined(__amd64__)) && defined(WIN32)
* is equivalent to #if defined(_M_X64) as _M_X64 is defined for MSVC only
*/
#if defined(_M_X64)
#define WIN32_LEAN_AND_MEAN
#define _WINSOCKAPI_
#include <WinSock2.h>
#endif
#define ELECTRUM_TIMEOUT 5
#define ELECTRUM_TIMEOUT 10
int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port)
{
@ -503,7 +501,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON
{
cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol);
//printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime));
if ( 1 || strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 )
if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+30 )
{
if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 )
{
@ -807,18 +805,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
void LP_dedicatedloop(void *arg)
{
#if defined(_M_X64)
typedef struct pollfd {
SOCKET fd;
SHORT events;
SHORT revents;
} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
#endif
struct pollfd fds;
int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg;
struct pollfd fds; int32_t i,len,flag,timeout = 10; struct iguana_info *coin; cJSON *retjson; struct stritem *sitem; struct electrum_info *ep = arg;
if ( (coin= LP_coinfind(ep->symbol)) != 0 )
ep->heightp = &coin->height, ep->heighttimep = &coin->heighttime;
if ( (retjson= electrum_headers_subscribe(ep->symbol,ep,0)) != 0 )

19
iguana/exchanges/LP_statemachine.c

@ -17,6 +17,25 @@
// LP_statemachine.c
// marketmaker
//
else
{
CTransaction tx; uint256 hashBlock; int32_t numvouts,len; uint8_t *ptr;
if ( GetTransaction(NOTARIZED_DESTTXID,tx,hashBlock,true) == 0 )
{
fprintf(stderr,"error finding")
return(-1);
}
if ( (numvouts= tx.vout.size()) > 0 )
{
ptr = (uint8_t *)tx.vout[numvouts - 1].scriptPubKey.data();
len = tx.vout[numvouts - 1].scriptPubKey.size();
retval = komodo_verifynotarizedscript(height,ptr,len,NOTARIZED_HASH);
printf("direct verify ht.%d -> %d\n",height,retval);
return(retval);
}
}
/*struct LP_cacheinfo *ptr,*tmp;
HASH_ITER(hh,LP_cacheinfos,ptr,tmp)
{

2
iguana/exchanges/LP_swap.c

@ -584,7 +584,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 && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 )
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) )
{

30
iguana/exchanges/LP_transaction.c

@ -37,10 +37,21 @@ int32_t LP_gettx_presence(char *symbol,bits256 expectedtxid)
bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxid)
{
char *retstr; bits256 txid; cJSON *retjson,*errorobj; int32_t i,sentflag = 0;
char *retstr; bits256 txid; uint8_t *ptr; cJSON *retjson,*errorobj; int32_t i,len,sentflag = 0;
memset(&txid,0,sizeof(txid));
if ( txbytes == 0 || txbytes[0] == 0 )
return(txid);
if ( bits256_nonz(expectedtxid) == 0 )
{
len = (int32_t)strlen(txbytes) >> 1;
ptr = malloc(len);
decode_hex(ptr,len,txbytes);
expectedtxid = bits256_doublesha256(0,ptr,len);
free(ptr);
}
for (i=0; i<2; i++)
{
//char str[65]; printf("LP_broadcast.%d (%s) %s i.%d sentflag.%d\n",i,symbol,bits256_str(str,expectedtxid),i,sentflag);
if ( sentflag == 0 && LP_gettx_presence(symbol,expectedtxid) != 0 )
sentflag = 1;
if ( sentflag == 0 && (retstr= LP_sendrawtransaction(symbol,txbytes)) != 0 )
@ -63,10 +74,11 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi
txid = expectedtxid;
sentflag = 1;
}
else printf("broadcast error.(%s)\n",retstr);
}
free_json(retjson);
}
char str[65]; printf("sentflag.%d [%s] %s RETSTR.(%s) %s.%s\n",sentflag,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 )
@ -548,9 +560,11 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_
return(complete);
}
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 *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 utxovout,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,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin;
if ( txfee > 0 && txfee < 10000 )
txfee = 10000;
*destamountp = 0;
memset(signedtxidp,0,sizeof(*signedtxidp));
if ( finalseqid == 0 )
@ -564,19 +578,19 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch
{
if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 )
{
if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n )
if ( (vouts= jarray(&n,txobj,"vout")) != 0 && utxovout < n )
{
obj = jitem(vouts,vout);
obj = jitem(vouts,utxovout);
value = LP_value_extract(obj,1);
//printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0));
}
free_json(txobj);
//if ( value != 0 )
// gettxout
}
} else printf("cant gettx\n");
if ( value == 0 )
{
printf("basilisk_swap_bobtxspend.%s %s utxo.(%s) already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid));
printf("basilisk_swap_bobtxspend.%s %s utxo.(%s).v%d already spent or doesnt exist\n",name,symbol,bits256_str(str,utxotxid),utxovout);
return(0);
}
}
@ -646,7 +660,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch
jaddstr(item,"userdata",hexstr);
}
jaddbits256(item,"txid",utxotxid);
jaddnum(item,"vout",vout);
jaddnum(item,"vout",utxovout);
bitcoin_address(tmpaddr,taddr,pubtype,pubkey33,33);
bitcoin_addr2rmd160(taddr,&addrtype,rmd160,tmpaddr);
if ( redeemlen != 0 )

72
iguana/exchanges/LP_utxo.c

@ -33,10 +33,14 @@
uint64_t LP_value_extract(cJSON *obj,int32_t addinterest)
{
double val = 0.; uint64_t value = 0;
if ( (val= jdouble(obj,"amount")) < SMALLVAL )
val = jdouble(obj,"value");
value = (val + 0.0000000049) * SATOSHIDEN;
double val = 0.; uint64_t value = 0; int32_t electrumflag;
electrumflag = (jobj(obj,"tx_hash") != 0);
if ( electrumflag == 0 )
{
if ( (val= jdouble(obj,"amount")) < SMALLVAL )
val = jdouble(obj,"value");
value = (val + 0.0000000049) * SATOSHIDEN;
} else value = j64bits(obj,"value");
if ( value != 0 )
{
if ( addinterest != 0 && jobj(obj,"interest") != 0 )
@ -298,9 +302,37 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof
return(hash);
}
int32_t LP_merkleproof(struct iguana_info *coin,struct electrum_info *ep,bits256 txid,int32_t height)
{
cJSON *merkobj,*merkles,*hdrobj; bits256 roothash,merkleroot; int32_t m,SPV = 0;
if ( (merkobj= electrum_getmerkle(coin->symbol,ep,&merkobj,txid,height)) != 0 )
{
char str[65],str2[65],str3[65];
SPV = -1;
memset(roothash.bytes,0,sizeof(roothash));
if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 )
{
roothash = validate_merkle(jint(merkobj,"pos"),txid,merkles,m);
if ( (hdrobj= electrum_getheader(coin->symbol,ep,&hdrobj,height)) != 0 )
{
merkleroot = jbits256(hdrobj,"merkle_root");
if ( bits256_cmp(merkleroot,roothash) == 0 )
{
SPV = height;
//printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash));
}
else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,txid),height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot));
free_json(hdrobj);
}
}
free_json(merkobj);
}
return(SPV);
}
cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret)
{
cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0;
cJSON *array,*item; int32_t n; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; struct electrum_info *ep,*backupep=0;
array = cJSON_CreateArray();
if ( coinaddr != 0 && coinaddr[0] != 0 )
{
@ -317,30 +349,8 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum
{
if ( up->spendheight <= 0 && up->U.height > 0 )
{
if ( up->SPV == 0 && up->U.height > 0 )
{
if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 )
{
char str[65],str2[65],str3[65];
memset(roothash.bytes,0,sizeof(roothash));
if ( (merkles= jarray(&m,merkobj,"merkle")) != 0 )
{
roothash = validate_merkle(jint(merkobj,"pos"),up->U.txid,merkles,m);
if ( (hdrobj= electrum_getheader(coin->symbol,backupep,&hdrobj,up->U.height)) != 0 )
{
merkleroot = jbits256(hdrobj,"merkle_root");
if ( bits256_cmp(merkleroot,roothash) == 0 )
{
up->SPV = up->U.height;
//printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash));
}
else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot));
free_json(hdrobj);
}
}
free_json(merkobj);
}
}
if ( backupep != 0 && up->SPV == 0 )
up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height);
jaddi(array,LP_address_item(coin,up,electrumret));
n++;
total += up->U.value;
@ -661,9 +671,9 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid)
if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 )
{
height = jint(blockobj,"height");
//printf("%s LP_txheight.%d\n",coin->symbol,height);
char str[65]; printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height);
free_json(blockobj);
} //else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0));
} // else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); likely just unconfirmed
free_json(txobj);
}
}

17
iguana/exchanges/LP_utxos.c

@ -36,6 +36,20 @@ int32_t LP_isavailable(struct LP_utxoinfo *utxo)
int32_t LP_isunspent(struct LP_utxoinfo *utxo)
{
struct LP_address_utxo *up; struct _LP_utxoinfo u; struct iguana_info *coin;
if ( (coin= LP_coinfind(utxo->coin)) == 0 )
return(0);
if ( (up= LP_address_utxofind(coin,utxo->coinaddr,utxo->payment.txid,utxo->payment.vout)) != 0 && up->spendheight > 0 )
{
utxo->T.spentflag = up->spendheight;
return(0);
}
u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee;
if ( (up= LP_address_utxofind(coin,utxo->coinaddr,u.txid,u.vout)) != 0 && up->spendheight > 0 )
{
utxo->T.spentflag = up->spendheight;
return(0);
}
if ( utxo != 0 && utxo->T.spentflag == 0 && LP_isavailable(utxo) > 0 )
return(1);
else return(0);
@ -436,7 +450,10 @@ cJSON *LP_inventory(char *symbol)
myipaddr = LP_mypeer->ipaddr;
else myipaddr = "127.0.0.1";
if ( (coin= LP_coinfind(symbol)) != 0 )
{
coin->unspenttime = (uint32_t)time(NULL) - 777;
LP_listunspent_both(symbol,coin->smartaddr);
}
HASH_ITER(hh,G.LP_utxoinfos[iambob],utxo,tmp)
{
char str[65];

3
iguana/exchanges/coins.json

File diff suppressed because one or more lines are too long

1
iguana/exchanges/install

@ -1,5 +1,6 @@
#!/bin/bash
cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts
cp coins.json ..
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

4
iguana/exchanges/stats.c

@ -340,7 +340,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
return(clonestr("{\"error\":\"cant find index7779\"}"));
else return(filestr);
}
else if ( (filestr= OS_filestr(&filesize,furl)) != 0 )
/*else if ( (filestr= OS_filestr(&filesize,furl)) != 0 ) allows arbitrary file access!
{
*jsonflagp = 1;
for (i=(int32_t)strlen(url)-1; i>0; i--)
@ -350,7 +350,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
strcpy(filetype,url+i+1);
//printf("return filetype.(%s) size.%ld\n",filetype,filesize);
return(filestr);
}
}*/
if ( strncmp(&url[i],"/api",strlen("/api")) == 0 )
{
*jsonflagp = 1;

1
iguana/help/InstantDEX_DEXratio.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"DEXratio","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_DEXratio_test.py"}]}

1
iguana/help/InstantDEX_accept.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"accept","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_accept_test.py"}]}

1
iguana/help/InstantDEX_allcoins.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"allcoins","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allcoins_test.py"}]}

1
iguana/help/InstantDEX_allexchanges.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"allexchanges","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allexchanges_test.py"}]}

1
iguana/help/InstantDEX_allpairs.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"allpairs","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_allpairs_test.py"}]}

1
iguana/help/InstantDEX_apikeypair.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"apikeypair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_apikeypair_test.py"}]}

1
iguana/help/InstantDEX_automatched.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"automatched","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_automatched_test.py"}]}

1
iguana/help/InstantDEX_available.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"available","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_available_test.py"}]}

1
iguana/help/InstantDEX_balance.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"balance","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_balance_test.py"}]}

1
iguana/help/InstantDEX_buy.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"buy","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_buy_test.py"}]}

1
iguana/help/InstantDEX_cancelorder.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"cancelorder","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_cancelorder_test.py"}]}

1
iguana/help/InstantDEX_getswaplist.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"getswaplist","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_getswaplist_test.py"}]}

1
iguana/help/InstantDEX_incoming.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"incoming","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_incoming_test.py"}]}

1
iguana/help/InstantDEX_init.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"init","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_init_test.py"}]}

1
iguana/help/InstantDEX_openorders.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"openorders","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_openorders_test.py"}]}

1
iguana/help/InstantDEX_orderbook.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"orderbook","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_orderbook_test.py"}]}

1
iguana/help/InstantDEX_orderstatus.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"orderstatus","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_orderstatus_test.py"}]}

1
iguana/help/InstantDEX_pollgap.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"pollgap","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_pollgap_test.py"}]}

1
iguana/help/InstantDEX_request.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"request","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_request_test.py"}]}

1
iguana/help/InstantDEX_sell.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"sell","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_sell_test.py"}]}

1
iguana/help/InstantDEX_setuserid.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"setuserid","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_setuserid_test.py"}]}

1
iguana/help/InstantDEX_smartaddress.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"smartaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_smartaddress_test.py"}]}

1
iguana/help/InstantDEX_smartaddresses.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"smartaddresses","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_smartaddresses_test.py"}]}

1
iguana/help/InstantDEX_supports.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"supports","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_supports_test.py"}]}

1
iguana/help/InstantDEX_tradehistory.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"tradehistory","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_tradehistory_test.py"}]}

1
iguana/help/InstantDEX_withdraw.json

@ -0,0 +1 @@
{"agent":"InstantDEX","method":"withdraw","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"InstantDEX_withdraw_test.py"}]}

1
iguana/help/SuperNET_activehandle.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"activehandle","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_activehandle_test.py"}]}

1
iguana/help/SuperNET_addr2rmd160.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"addr2rmd160","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_addr2rmd160_test.py"}]}

1
iguana/help/SuperNET_bitcoinrpc.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"bitcoinrpc","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_bitcoinrpc_test.py"}]}

1
iguana/help/SuperNET_broadcastcipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"broadcastcipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_broadcastcipher_test.py"}]}

1
iguana/help/SuperNET_broadcastdecipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"broadcastdecipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_broadcastdecipher_test.py"}]}

1
iguana/help/SuperNET_cipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"cipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_cipher_test.py"}]}

1
iguana/help/SuperNET_decipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"decipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_decipher_test.py"}]}

1
iguana/help/SuperNET_decryptjson.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"decryptjson","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_decryptjson_test.py"}]}

1
iguana/help/SuperNET_encryptjson.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"encryptjson","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_encryptjson_test.py"}]}

1
iguana/help/SuperNET_getpeers.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"getpeers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_getpeers_test.py"}]}

1
iguana/help/SuperNET_help.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"help","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_help_test.py"}]}

1
iguana/help/SuperNET_html.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"html","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_html_test.py"}]}

1
iguana/help/SuperNET_keypair.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"keypair","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_keypair_test.py"}]}

1
iguana/help/SuperNET_layer.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"layer","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_layer_test.py"}]}

1
iguana/help/SuperNET_login.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"login","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_login_test.py"}]}

1
iguana/help/SuperNET_logout.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"logout","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_logout_test.py"}]}

1
iguana/help/SuperNET_multicastcipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"multicastcipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_multicastcipher_test.py"}]}

1
iguana/help/SuperNET_multicastdecipher.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"multicastdecipher","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_multicastdecipher_test.py"}]}

1
iguana/help/SuperNET_myipaddr.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"myipaddr","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_myipaddr_test.py"}]}

1
iguana/help/SuperNET_mypeers.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"mypeers","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_mypeers_test.py"}]}

1
iguana/help/SuperNET_priv2pub.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"priv2pub","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_priv2pub_test.py"}]}

1
iguana/help/SuperNET_priv2wif.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"priv2wif","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_priv2wif_test.py"}]}

1
iguana/help/SuperNET_rmd160conv.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"rmd160conv","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_rmd160conv_test.py"}]}

1
iguana/help/SuperNET_rosetta.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"rosetta","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_rosetta_test.py"}]}

1
iguana/help/SuperNET_saveconf.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"saveconf","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_saveconf_test.py"}]}

1
iguana/help/SuperNET_setmyipaddr.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"setmyipaddr","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_setmyipaddr_test.py"}]}

1
iguana/help/SuperNET_stop.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"stop","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_stop_test.py"}]}

1
iguana/help/SuperNET_utc2utime.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"utc2utime","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_utc2utime_test.py"}]}

1
iguana/help/SuperNET_utime2utc.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"utime2utc","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_utime2utc_test.py"}]}

1
iguana/help/SuperNET_wif2priv.json

@ -0,0 +1 @@
{"agent":"SuperNET","method":"wif2priv","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"SuperNET_wif2priv_test.py"}]}

1
iguana/help/basilisk_addrelay.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"addrelay","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_addrelay_test.py"}]}

1
iguana/help/basilisk_balances.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"balances","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_balances_test.py"}]}

1
iguana/help/basilisk_cancelrefresh.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"cancelrefresh","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_cancelrefresh_test.py"}]}

1
iguana/help/basilisk_dispatch.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"dispatch","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_dispatch_test.py"}]}

1
iguana/help/basilisk_forward.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"forward","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_forward_test.py"}]}

1
iguana/help/basilisk_geckoblock.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"geckoblock","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoblock_test.py"}]}

1
iguana/help/basilisk_geckoget.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"geckoget","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoget_test.py"}]}

1
iguana/help/basilisk_geckoheaders.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"geckoheaders","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckoheaders_test.py"}]}

1
iguana/help/basilisk_geckotx.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"geckotx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_geckotx_test.py"}]}

1
iguana/help/basilisk_genesis_opreturn.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"genesis_opreturn","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_genesis_opreturn_test.py"}]}

1
iguana/help/basilisk_getmessage.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"getmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_getmessage_test.py"}]}

1
iguana/help/basilisk_history.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"history","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_history_test.py"}]}

1
iguana/help/basilisk_mailbox.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"mailbox","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_mailbox_test.py"}]}

1
iguana/help/basilisk_paxfiats.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"paxfiats","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_paxfiats_test.py"}]}

1
iguana/help/basilisk_publish.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"publish","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_publish_test.py"}]}

1
iguana/help/basilisk_rawtx.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"rawtx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_rawtx_test.py"}]}

1
iguana/help/basilisk_refresh.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"refresh","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_refresh_test.py"}]}

1
iguana/help/basilisk_sendmessage.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"sendmessage","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_sendmessage_test.py"}]}

1
iguana/help/basilisk_subscribe.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"subscribe","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_subscribe_test.py"}]}

1
iguana/help/basilisk_utxocombine.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"utxocombine","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_utxocombine_test.py"}]}

1
iguana/help/basilisk_utxorawtx.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"utxorawtx","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_utxorawtx_test.py"}]}

1
iguana/help/basilisk_value.json

@ -0,0 +1 @@
{"agent":"basilisk","method":"value","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"basilisk_value_test.py"}]}

1
iguana/help/bitcoinrpc_addmultisigaddress.json

@ -0,0 +1 @@
{"agent":"bitcoinrpc","method":"addmultisigaddress","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_addmultisigaddress_test.py"}]}

1
iguana/help/bitcoinrpc_backupwallet.json

@ -0,0 +1 @@
{"agent":"bitcoinrpc","method":"backupwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_backupwallet_test.py"}]}

1
iguana/help/bitcoinrpc_checkwallet.json

@ -0,0 +1 @@
{"agent":"bitcoinrpc","method":"checkwallet","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_checkwallet_test.py"}]}

1
iguana/help/bitcoinrpc_createmultisig.json

@ -0,0 +1 @@
{"agent":"bitcoinrpc","method":"createmultisig","field0":"put in helpful info field0","field1":"put in helpful info for field1","help":"put helpful info here","teststatus":[{"tester":"bob","result":"put result here","notes":"put useful notes here","automated":"notyet","sourcefile":"bitcoinrpc_createmultisig_test.py"}]}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save