Merge remote-tracking branch 'jl777/dev' into cryptoconditions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
source pubkey.txt
|
||||
args=("$@")
|
||||
seed_ip=`getent hosts seed.mewhub.com | awk '{ print $1 }'`
|
||||
seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'`
|
||||
komodo_binary='./komodod'
|
||||
delay=20
|
||||
|
||||
@@ -35,11 +35,9 @@ komodo_asset JUMBLR 999999
|
||||
komodo_asset BET 999999
|
||||
komodo_asset CRYPTO 999999
|
||||
komodo_asset HODL 9999999
|
||||
#komodo_asset SHARK 1401
|
||||
komodo_asset MSHARK 1400000
|
||||
komodo_asset BOTS 999999
|
||||
komodo_asset MGW 999999
|
||||
#komodo_asset MVP 1000000
|
||||
komodo_asset COQUI 72000000
|
||||
komodo_asset WLC 210000000
|
||||
komodo_asset KV 1000000
|
||||
@@ -49,37 +47,8 @@ komodo_asset MNZ 257142858
|
||||
komodo_asset AXO 200000000
|
||||
komodo_asset ETOMIC 100000000
|
||||
komodo_asset BTCH 20998641
|
||||
komodo_asset VOTE 49999999999
|
||||
|
||||
#komodo_asset USD
|
||||
#komodo_asset EUR
|
||||
#komodo_asset JPY
|
||||
#komodo_asset GBP
|
||||
#komodo_asset AUD
|
||||
#komodo_asset CAD
|
||||
#komodo_asset CHF
|
||||
#komodo_asset NZD
|
||||
#komodo_asset CNY
|
||||
#komodo_asset RUB
|
||||
#komodo_asset MXN
|
||||
#komodo_asset BRL
|
||||
#komodo_asset INR
|
||||
#komodo_asset HKD
|
||||
#komodo_asset TRY
|
||||
#komodo_asset ZAR
|
||||
#komodo_asset PLN
|
||||
#komodo_asset NOK
|
||||
#komodo_asset SEK
|
||||
#komodo_asset DKK
|
||||
#komodo_asset CZK
|
||||
#komodo_asset HUF
|
||||
#komodo_asset ILS
|
||||
#komodo_asset KRW
|
||||
#komodo_asset MYR
|
||||
#komodo_asset PHP
|
||||
#komodo_asset RON
|
||||
#komodo_asset SGD
|
||||
#komodo_asset THB
|
||||
#komodo_asset BGN
|
||||
#komodo_asset IDR
|
||||
#komodo_asset HRK
|
||||
komodo_asset VOTE2018 600000000
|
||||
komodo_asset PIZZA 100000000
|
||||
komodo_asset BEER 100000000
|
||||
komodo_asset NINJA 100000000
|
||||
komodo_asset OOT 216000000
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
set -x
|
||||
delay=60
|
||||
source pubkey.txt
|
||||
@@ -24,9 +24,11 @@ echo $pubkey
|
||||
./komodod -pubkey=$pubkey -ac_name=AXO -ac_supply=200000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=ETOMIC -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=BTCH -ac_supply=20998641 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=VOTE -ac_supply=49999999999 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=BEER -ac_supply=100000000 -addnode=24.54.206.138 &
|
||||
./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=24.54.206.138 &
|
||||
./komodod -pubkey=$pubkey -ac_name=VOTE2018 -ac_supply=600000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=BEER -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=78.47.196.146 &
|
||||
./komodod -pubkey=$pubkey -ac_name=OOT -ac_supply=216000000-addnode=174.138.107.226 &
|
||||
#sleep $delay
|
||||
|
||||
#./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 &
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#define FROM_CLI
|
||||
#include "uint256.h"
|
||||
#include "arith_uint256.h"
|
||||
|
||||
|
||||
@@ -98,8 +98,9 @@ public:
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
|
||||
vFixedSeeds.clear();
|
||||
vSeeds.clear();
|
||||
vSeeds.push_back(CDNSSeedData("komodoplatform.com", "seeds.komodoplatform.com")); // @kolo
|
||||
vSeeds.push_back(CDNSSeedData("komodo.mewhub.com", "seeds.komodo.mewhub.com")); // @kolo
|
||||
vSeeds.push_back(CDNSSeedData("komodoplatform.com", "seeds.komodoplatform.com")); // @kolo - old static dns seeds
|
||||
vSeeds.push_back(CDNSSeedData("kolo.supernet.org", "static.kolo.supernet.org")); // @kolo - new static dns seeds ToDo
|
||||
vSeeds.push_back(CDNSSeedData("kolo.supernet.org", "dynamic.kolo.supernet.org")); // @kolo - crawler seeds ToDo
|
||||
// TODO: set up bootstrapping for mainnet
|
||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,60);
|
||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,85);
|
||||
|
||||
@@ -27,40 +27,9 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dp
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ETOMIC\",\"pubkey\":\"$pubkey\"}"
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BTCH\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CHAIN\",\"pubkey\":\"$pubkey\"}"
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VOTE\",\"pubkey\":\"$pubkey\"}"
|
||||
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VOTE2018\",\"pubkey\":\"$pubkey\"}"
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NINJA\",\"pubkey\":\"$pubkey\"}"
|
||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"OOT\",\"pubkey\":\"$pubkey\"}"
|
||||
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}"
|
||||
#
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JPY\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"GBP\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"AUD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CAD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CHF\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NZD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CNY\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RUB\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MXN\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BRL\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"INR\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HKD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"TRY\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ZAR\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PLN\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NOK\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEK\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DKK\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CZK\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HUF\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ILS\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KRW\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MYR\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PHP\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RON\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SGD\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"THB\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BGN\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"IDR\",\"pubkey\":\"$pubkey\"}"
|
||||
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HRK\",\"pubkey\":\"$pubkey\"}"
|
||||
|
||||
|
||||
38
src/fiat-cli
38
src/fiat-cli
@@ -1,37 +1,5 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
#echo aud; fiat/aud $1 $2 $3 $4
|
||||
#echo bgn; fiat/bgn $1 $2 $3 $4
|
||||
#echo cad; fiat/cad $1 $2 $3 $4
|
||||
#echo chf; fiat/chf $1 $2 $3 $4
|
||||
#echo cny; fiat/cny $1 $2 $3 $4
|
||||
#echo czk; fiat/czk $1 $2 $3 $4
|
||||
#echo dkk; fiat/dkk $1 $2 $3 $4
|
||||
#echo eur; fiat/eur $1 $2 $3 $4
|
||||
#echo gbp; fiat/gbp $1 $2 $3 $4
|
||||
#echo hkd; fiat/hkd $1 $2 $3 $4
|
||||
#echo hrk; fiat/hrk $1 $2 $3 $4
|
||||
#echo huf; fiat/huf $1 $2 $3 $4
|
||||
#echo idr; fiat/idr $1 $2 $3 $4
|
||||
#echo ils; fiat/ils $1 $2 $3 $4
|
||||
#echo inr; fiat/inr $1 $2 $3 $4
|
||||
#echo jpy; fiat/jpy $1 $2 $3 $4
|
||||
#echo krw; fiat/krw $1 $2 $3 $4
|
||||
#echo mxn; fiat/mxn $1 $2 $3 $4
|
||||
#echo myr; fiat/myr $1 $2 $3 $4
|
||||
#echo nok; fiat/nok $1 $2 $3 $4
|
||||
#echo nzd; fiat/nzd $1 $2 $3 $4
|
||||
#echo php; fiat/php $1 $2 $3 $4
|
||||
#echo pln; fiat/pln $1 $2 $3 $4
|
||||
#echo brl; fiat/brl $1 $2 $3 $4
|
||||
#echo ron; fiat/ron $1 $2 $3 $4
|
||||
#echo rub; fiat/rub $1 $2 $3 $4
|
||||
#echo sek; fiat/sek $1 $2 $3 $4
|
||||
#echo sgd; fiat/sgd $1 $2 $3 $4
|
||||
#echo thb; fiat/thb $1 $2 $3 $4
|
||||
#echo try; fiat/try $1 $2 $3 $4
|
||||
#echo usd; fiat/usd $1 $2 $3 $4
|
||||
#echo zar; fiat/zar $1 $2 $3 $4
|
||||
echo revs; fiat/revs $1 $2 $3 $4
|
||||
echo supernet; fiat/supernet $1 $2 $3 $4
|
||||
echo dex; fiat/dex $1 $2 $3 $4
|
||||
@@ -40,11 +8,9 @@ echo jumblr; fiat/jumblr $1 $2 $3 $4
|
||||
echo bet; fiat/bet $1 $2 $3 $4
|
||||
echo crypto; fiat/crypto $1 $2 $3 $4
|
||||
echo hodl; fiat/hodl $1 $2 $3 $4
|
||||
#echo shark; fiat/shark $1 $2 $3 $4
|
||||
echo mshark; fiat/mshark $1 $2 $3 $4
|
||||
echo bots; fiat/bots $1 $2 $3 $4
|
||||
echo mgw; fiat/mgw $1 $2 $3 $4
|
||||
#echo mvp; fiat/mvp $1 $2 $3 $4
|
||||
echo coqui; fiat/coqui $1 $2 $3 $4
|
||||
echo wlc; fiat/wlc $1 $2 $3 $4
|
||||
echo kv; fiat/kv $1 $2 $3 $4
|
||||
@@ -56,4 +22,6 @@ echo etomic; fiat/etomic $1 $2 $3 $4
|
||||
echo btch; fiat/btch $1 $2 $3 $4
|
||||
echo pizza; fiat/pizza $1 $2 $3 $4
|
||||
echo beer; fiat/beer $1 $2 $3 $4
|
||||
echo vote; fiat/vote $1 $2 $3 $4
|
||||
echo vote2018; fiat/vote2018 $1 $2 $3 $4
|
||||
echo ninja; fiat/ninja $1 $2 $3 $4
|
||||
echo oot; fiat/oot $1 $2 $3 $4
|
||||
|
||||
2
src/fiat/ninja
Executable file
2
src/fiat/ninja
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
./komodo-cli -ac_name=NINJA $1 $2 $3 $4 $5 $6
|
||||
2
src/fiat/oot
Executable file
2
src/fiat/oot
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
./komodo-cli -ac_name=OOT $1 $2 $3 $4 $5 $6
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
./komodo-cli -ac_name=VOTE $1 $2 $3 $4 $5 $6
|
||||
2
src/fiat/vote2018
Executable file
2
src/fiat/vote2018
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
./komodo-cli -ac_name=VOTE2018 $1 $2 $3 $4 $5 $6
|
||||
@@ -365,7 +365,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
|
||||
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
|
||||
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
|
||||
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 8233, 18233));
|
||||
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 7770, 17770));
|
||||
strUsage += HelpMessageOpt("-proxy=<ip:port>", _("Connect through SOCKS5 proxy"));
|
||||
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));
|
||||
strUsage += HelpMessageOpt("-seednode=<ip>", _("Connect to a node to retrieve peer addresses, and disconnect"));
|
||||
@@ -485,7 +485,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-rpcbind=<addr>", _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)"));
|
||||
strUsage += HelpMessageOpt("-rpcuser=<user>", _("Username for JSON-RPC connections"));
|
||||
strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections"));
|
||||
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 8232, 18232));
|
||||
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 7771, 17771));
|
||||
strUsage += HelpMessageOpt("-rpcallowip=<ip>", _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
|
||||
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS));
|
||||
if (showDebug) {
|
||||
|
||||
@@ -814,16 +814,17 @@ int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 has
|
||||
{
|
||||
if ( nHeight < notarized_height )
|
||||
{
|
||||
fprintf(stderr,"nHeight.%d < NOTARIZED_HEIGHT.%d\n",nHeight,notarized_height);
|
||||
//fprintf(stderr,"[%s] nHeight.%d < NOTARIZED_HEIGHT.%d\n",ASSETCHAINS_SYMBOL,nHeight,notarized_height);
|
||||
return(-1);
|
||||
}
|
||||
else if ( nHeight == notarized_height && memcmp(&hash,¬arized_hash,sizeof(hash)) != 0 )
|
||||
{
|
||||
fprintf(stderr,"nHeight.%d == NOTARIZED_HEIGHT.%d, diff hash\n",nHeight,notarized_height);
|
||||
fprintf(stderr,"[%s] nHeight.%d == NOTARIZED_HEIGHT.%d, diff hash\n",ASSETCHAINS_SYMBOL,nHeight,notarized_height);
|
||||
return(-1);
|
||||
}
|
||||
} else fprintf(stderr,"unexpected error notary_hash %s ht.%d at ht.%d\n",notarized_hash.ToString().c_str(),notarized_height,notary->nHeight);
|
||||
} else if ( notarized_height > 0 && notarized_height != 73880 && notarized_height >= 170000 )
|
||||
} else fprintf(stderr,"[%s] unexpected error notary_hash %s ht.%d at ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,notary->nHeight);
|
||||
}
|
||||
else if ( notarized_height > 0 && notarized_height != 73880 && notarized_height >= 170000 )
|
||||
fprintf(stderr,"[%s] couldnt find notarized.(%s %d) ht.%d\n",ASSETCHAINS_SYMBOL,notarized_hash.ToString().c_str(),notarized_height,pindex->nHeight);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1362,12 +1362,14 @@ void komodo_configfile(char *symbol,uint16_t port)
|
||||
#endif
|
||||
if ( (fp= fopen(fname,"rb")) == 0 )
|
||||
{
|
||||
#ifndef FROM_CLI
|
||||
if ( (fp= fopen(fname,"wb")) != 0 )
|
||||
{
|
||||
fprintf(fp,"rpcuser=user%u\nrpcpassword=pass%s\nrpcport=%u\nserver=1\ntxindex=1\nrpcworkqueue=64\n",crc,password,port);
|
||||
fclose(fp);
|
||||
printf("Created (%s)\n",fname);
|
||||
} else printf("Couldnt create (%s)\n",fname);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1399,7 +1401,7 @@ void komodo_configfile(char *symbol,uint16_t port)
|
||||
sprintf(KMDUSERPASS,"%s:%s",username,password);
|
||||
fclose(fp);
|
||||
//printf("KOMODO.(%s) -> userpass.(%s)\n",fname,KMDUSERPASS);
|
||||
} else printf("couldnt open.(%s)\n",fname);
|
||||
} //else printf("couldnt open.(%s)\n",fname);
|
||||
}
|
||||
|
||||
uint16_t komodo_userpass(char *userpass,char *symbol)
|
||||
@@ -1442,24 +1444,13 @@ uint32_t komodo_assetmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_
|
||||
return(calc_crc32(crc0,buf,len));
|
||||
}
|
||||
|
||||
/*int32_t komodo_shortflag(char *symbol)
|
||||
{
|
||||
int32_t i,shortflag = 0;
|
||||
if ( symbol[0] == '-' )
|
||||
{
|
||||
shortflag = 1;
|
||||
for (i=0; symbol[i+1]!=0; i++)
|
||||
symbol[i] = symbol[i+1];
|
||||
symbol[i] = 0;
|
||||
}
|
||||
return(shortflag);
|
||||
}*/
|
||||
|
||||
uint16_t komodo_assetport(uint32_t magic)
|
||||
uint16_t komodo_assetport(uint32_t magic,int32_t extralen)
|
||||
{
|
||||
if ( magic == 0x8de4eef9 )
|
||||
return(7770);
|
||||
else return(8000 + (magic % 7777));
|
||||
else if ( extralen == 0 )
|
||||
return(8000 + (magic % 7777));
|
||||
else return(16000 + (magic % 49500));
|
||||
}
|
||||
|
||||
uint16_t komodo_port(char *symbol,uint64_t supply,uint32_t *magicp,uint8_t *extraptr,int32_t extralen)
|
||||
@@ -1470,7 +1461,7 @@ uint16_t komodo_port(char *symbol,uint64_t supply,uint32_t *magicp,uint8_t *extr
|
||||
return(7770);
|
||||
}
|
||||
*magicp = komodo_assetmagic(symbol,supply,extraptr,extralen);
|
||||
return(komodo_assetport(*magicp));
|
||||
return(komodo_assetport(*magicp,extralen));
|
||||
}
|
||||
|
||||
/*void komodo_ports(uint16_t ports[MAX_CURRENCIES])
|
||||
@@ -1535,7 +1526,7 @@ void komodo_args(char *argv0)
|
||||
}
|
||||
}
|
||||
}
|
||||
ASSETCHAINS_CC = GetArg("-ac_cc",0);
|
||||
ASSETCHAINS_CC = GetArg("-ac_cc",0); // keep it outside the assetchains hashing so KMD can do it and we dont have two identical chains other than -ac_cc
|
||||
if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 )
|
||||
{
|
||||
printf("KOMODO_REWIND %d\n",KOMODO_REWIND);
|
||||
@@ -1617,6 +1608,7 @@ void komodo_args(char *argv0)
|
||||
for (i=0; i<4; i++)
|
||||
sprintf(&magicstr[i<<1],"%02x",magic[i]);
|
||||
magicstr[8] = 0;
|
||||
#ifndef FROM_CLI
|
||||
sprintf(fname,"gen%s",ASSETCHAINS_SYMBOL);
|
||||
if ( (fp= fopen(fname,"wb")) != 0 )
|
||||
{
|
||||
@@ -1624,6 +1616,7 @@ void komodo_args(char *argv0)
|
||||
fclose(fp);
|
||||
//printf("created (%s)\n",fname);
|
||||
} else printf("error creating (%s)\n",fname);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1657,7 +1650,7 @@ void komodo_args(char *argv0)
|
||||
sprintf(iter == 0 ? KMDUSERPASS : BTCUSERPASS,"%s:%s",username,password);
|
||||
fclose(fp);
|
||||
//printf("KOMODO.(%s) -> userpass.(%s)\n",fname,KMDUSERPASS);
|
||||
} else printf("couldnt open.(%s)\n",fname);
|
||||
} //else printf("couldnt open.(%s)\n",fname);
|
||||
if ( IS_KOMODO_NOTARY == 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
53
src/main.cpp
53
src/main.cpp
@@ -740,7 +740,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
|
||||
}
|
||||
else if (!txin.IsFinal())
|
||||
{
|
||||
//printf("non-final txin seq.%x locktime.%u vs nTime.%u\n",txin.nSequence,(uint32_t)tx.nLockTime,(uint32_t)nBlockTime);
|
||||
printf("non-final txin seq.%x locktime.%u vs nTime.%u\n",txin.nSequence,(uint32_t)tx.nLockTime,(uint32_t)nBlockTime);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1665,10 +1665,10 @@ bool IsInitialBlockDownload()
|
||||
ptr = pindexBestHeader;
|
||||
else if ( pindexBestHeader != 0 && pindexBestHeader->nHeight > ptr->nHeight )
|
||||
ptr = pindexBestHeader;
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||
//if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||
state = ((chainActive.Height() < ptr->nHeight - 24*60) ||
|
||||
ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge()));
|
||||
else state = (chainActive.Height() < ptr->nHeight - 10);
|
||||
//else state = (chainActive.Height() < ptr->nHeight - 24*60);
|
||||
//fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge()));
|
||||
if (!state)
|
||||
{
|
||||
@@ -3445,7 +3445,14 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
||||
if (pcheckpoint && (nHeight < pcheckpoint->nHeight || nHeight == 1 && chainActive.Tip() != 0 && chainActive.Tip()->nHeight > 1) )
|
||||
return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d) vs %d", __func__, nHeight,pcheckpoint->nHeight));
|
||||
else if ( komodo_checkpoint(¬arized_height,nHeight,hash) < 0 )
|
||||
return state.DoS(100, error("%s: forked chain %d older than last notarized (height %d) vs %d", __func__,nHeight, notarized_height));
|
||||
{
|
||||
CBlockIndex *heightblock = chainActive[nHeight];
|
||||
if ( heightblock != 0 && heightblock->GetBlockHash() == hash )
|
||||
{
|
||||
//fprintf(stderr,"got a pre notarization block that matches height.%d\n",(int32_t)nHeight);
|
||||
return true;
|
||||
} else return state.DoS(100, error("%s: forked chain %d older than last notarized (height %d) vs %d", __func__,nHeight, notarized_height));
|
||||
}
|
||||
}
|
||||
// Reject block.nVersion < 4 blocks
|
||||
if (block.nVersion < 4)
|
||||
@@ -3503,6 +3510,40 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
|
||||
*ppindex = pindex;
|
||||
if (pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK)
|
||||
return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate");
|
||||
if ( pindex != 0 && IsInitialBlockDownload() == 0 ) // jl777 debug test
|
||||
{
|
||||
if (!CheckBlockHeader(pindex->nHeight,pindex, block, state))
|
||||
{
|
||||
pindex->nStatus |= BLOCK_FAILED_MASK;
|
||||
fprintf(stderr,"known block failing CheckBlockHeader %d\n",(int32_t)pindex->nHeight);
|
||||
return false;
|
||||
}
|
||||
CBlockIndex* pindexPrev = NULL;
|
||||
if (hash != chainparams.GetConsensus().hashGenesisBlock)
|
||||
{
|
||||
BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
|
||||
if (mi == mapBlockIndex.end())
|
||||
{
|
||||
pindex->nStatus |= BLOCK_FAILED_MASK;
|
||||
fprintf(stderr,"known block.%d failing to find prevblock\n",(int32_t)pindex->nHeight);
|
||||
return state.DoS(10, error("%s: prev block not found", __func__), 0, "bad-prevblk");
|
||||
}
|
||||
pindexPrev = (*mi).second;
|
||||
if (pindexPrev == 0 || (pindexPrev->nStatus & BLOCK_FAILED_MASK) )
|
||||
{
|
||||
pindex->nStatus |= BLOCK_FAILED_MASK;
|
||||
fprintf(stderr,"known block.%d found invalid prevblock\n",(int32_t)pindex->nHeight);
|
||||
return state.DoS(100, error("%s: prev block invalid", __func__), REJECT_INVALID, "bad-prevblk");
|
||||
}
|
||||
}
|
||||
if (!ContextualCheckBlockHeader(block, state, pindexPrev))
|
||||
{
|
||||
pindex->nStatus |= BLOCK_FAILED_MASK;
|
||||
fprintf(stderr,"known block.%d failing ContextualCheckBlockHeader\n",(int32_t)pindex->nHeight);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3514,7 +3555,9 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
|
||||
if (hash != chainparams.GetConsensus().hashGenesisBlock) {
|
||||
BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
|
||||
if (mi == mapBlockIndex.end())
|
||||
{
|
||||
return state.DoS(10, error("%s: prev block not found", __func__), 0, "bad-prevblk");
|
||||
}
|
||||
pindexPrev = (*mi).second;
|
||||
if (pindexPrev == 0 || (pindexPrev->nStatus & BLOCK_FAILED_MASK) )
|
||||
return state.DoS(100, error("%s: prev block invalid", __func__), REJECT_INVALID, "bad-prevblk");
|
||||
@@ -4289,7 +4332,7 @@ void static CheckBlockIndex()
|
||||
// Build forward-pointing map of the entire block tree.
|
||||
std::multimap<CBlockIndex*,CBlockIndex*> forward;
|
||||
for (BlockMap::iterator it = mapBlockIndex.begin(); it != mapBlockIndex.end(); it++) {
|
||||
forward.insert(std::make_pair(it->second->pprev, it->second));
|
||||
forward.insert(std::make_pair(it->second->pprev, it->second));
|
||||
}
|
||||
|
||||
assert(forward.size() == mapBlockIndex.size());
|
||||
|
||||
@@ -235,8 +235,8 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
|
||||
" ],\n"
|
||||
" \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n"
|
||||
" {\n"
|
||||
" \"vpub_old\" : x.xxx, (numeric) public input value in ZEC\n"
|
||||
" \"vpub_new\" : x.xxx, (numeric) public output value in ZEC\n"
|
||||
" \"vpub_old\" : x.xxx, (numeric) public input value in KMD\n"
|
||||
" \"vpub_new\" : x.xxx, (numeric) public output value in KMD\n"
|
||||
" \"anchor\" : \"hex\", (string) the anchor\n"
|
||||
" \"nullifiers\" : [ (json array of string)\n"
|
||||
" \"hex\" (string) input note nullifier\n"
|
||||
@@ -585,8 +585,8 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
|
||||
" ],\n"
|
||||
" \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n"
|
||||
" {\n"
|
||||
" \"vpub_old\" : x.xxx, (numeric) public input value in ZEC\n"
|
||||
" \"vpub_new\" : x.xxx, (numeric) public output value in ZEC\n"
|
||||
" \"vpub_old\" : x.xxx, (numeric) public input value in KMD\n"
|
||||
" \"vpub_new\" : x.xxx, (numeric) public output value in KMD\n"
|
||||
" \"anchor\" : \"hex\", (string) the anchor\n"
|
||||
" \"nullifiers\" : [ (json array of string)\n"
|
||||
" \"hex\" (string) input note nullifier\n"
|
||||
|
||||
@@ -857,13 +857,13 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s
|
||||
|
||||
std::string HelpExampleCli(const std::string& methodname, const std::string& args)
|
||||
{
|
||||
return "> zcash-cli " + methodname + " " + args + "\n";
|
||||
return "> komodo-cli " + methodname + " " + args + "\n";
|
||||
}
|
||||
|
||||
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
|
||||
{
|
||||
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
|
||||
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/\n";
|
||||
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7771/\n";
|
||||
}
|
||||
|
||||
void RPCRegisterTimerInterface(RPCTimerInterface *iface)
|
||||
|
||||
@@ -1191,7 +1191,10 @@ bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) con
|
||||
// Now that we know we're comparing apples-to-apples, the
|
||||
// comparison is a simple numeric one.
|
||||
if (nLockTime > (int64_t)txTo->nLockTime)
|
||||
{
|
||||
//fprintf(stderr,"CLTV error: nLockTime %llu > %u txTo->nLockTime\n",*(long long *)&nLockTime,(uint32_t)txTo->nLockTime);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Finally the nLockTime feature can be disabled and thus
|
||||
// CHECKLOCKTIMEVERIFY bypassed if every txin has been
|
||||
@@ -1204,7 +1207,10 @@ bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) con
|
||||
// inputs, but testing just this input minimizes the data
|
||||
// required to prove correct CHECKLOCKTIMEVERIFY execution.
|
||||
if (txTo->vin[nIn].IsFinal())
|
||||
{
|
||||
//fprintf(stderr,"CLTV error: nonfinal vin.%d nSequence.%u vs %u\n",(int32_t)nIn,(uint32_t)txTo->vin[nIn].nSequence,(uint32_t)std::numeric_limits<uint32_t>::max());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2508,7 +2508,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
|
||||
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n"
|
||||
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
|
||||
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
|
||||
" \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in ZEC/KB\n"
|
||||
" \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in KMD/KB\n"
|
||||
"}\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("getwalletinfo", "")
|
||||
@@ -3380,7 +3380,7 @@ UniValue z_getbalance(const UniValue& params, bool fHelp)
|
||||
"1. \"address\" (string) The selected address. It may be a transparent or private address.\n"
|
||||
"2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
|
||||
"\nResult:\n"
|
||||
"amount (numeric) The total amount in ZEC received for this address.\n"
|
||||
"amount (numeric) The total amount in KMD received for this address.\n"
|
||||
"\nExamples:\n"
|
||||
"\nThe total amount received by address \"myaddress\"\n"
|
||||
+ HelpExampleCli("z_getbalance", "\"myaddress\"") +
|
||||
@@ -3607,7 +3607,7 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
||||
"2. \"amounts\" (array, required) An array of json objects representing the amounts to send.\n"
|
||||
" [{\n"
|
||||
" \"address\":address (string, required) The address is a taddr or zaddr\n"
|
||||
" \"amount\":amount (numeric, required) The numeric amount in ZEC is the value\n"
|
||||
" \"amount\":amount (numeric, required) The numeric amount in KMD is the value\n"
|
||||
" \"memo\":memo (string, optional) If the address is a zaddr, raw data represented in hexadecimal string format\n"
|
||||
" }, ... ]\n"
|
||||
"3. minconf (numeric, optional, default=1) Only use funds confirmed at least this many times.\n"
|
||||
|
||||
Reference in New Issue
Block a user