From a11e51f94624c6d7f7bd618a1ad7fa030cda1832 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 20 Aug 2017 22:30:41 +0200 Subject: [PATCH 001/109] 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 002/109] 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 003/109] 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 004/109] 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 005/109] 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 006/109] 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 007/109] 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 008/109] 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 009/109] 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 010/109] 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 011/109] 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 012/109] 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 013/109] 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 014/109] 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 015/109] 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 016/109] 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 017/109] 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 018/109] 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 019/109] 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 020/109] 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 021/109] 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 022/109] 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 023/109] 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 024/109] 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 025/109] 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 026/109] 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 027/109] 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 028/109] 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 029/109] 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 030/109] 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 031/109] 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 032/109] 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 033/109] 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 034/109] 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 035/109] 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 036/109] 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 037/109] 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 038/109] 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 039/109] 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 040/109] 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 041/109] 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 042/109] 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 043/109] 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 044/109] 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 045/109] 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 046/109] 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 047/109] 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 048/109] 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 049/109] 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 050/109] 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 051/109] 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 052/109] 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 053/109] 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 054/109] 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 055/109] 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 056/109] 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 057/109] 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 058/109] 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 059/109] 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 060/109] 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 061/109] 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 062/109] 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 063/109] 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 064/109] 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 065/109] 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 066/109] 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 067/109] 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 068/109] 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 069/109] 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 070/109] 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 071/109] 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 072/109] 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 073/109] 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 074/109] 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 075/109] 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 076/109] 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 077/109] 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 078/109] 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 079/109] 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 080/109] 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 081/109] 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 082/109] 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 083/109] 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 084/109] 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 085/109] 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 086/109] 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 087/109] 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 088/109] 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 089/109] 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 090/109] 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 091/109] 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 092/109] 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 093/109] 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 094/109] 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 095/109] 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 096/109] 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 097/109] 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 098/109] 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 099/109] 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 100/109] 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 101/109] 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 102/109] 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 103/109] 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 104/109] 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 105/109] 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 106/109] 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 107/109] 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 108/109] 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 109/109] 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);