From 5da8e41df2b8232dd88bf1a4e45deb7194475158 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 16 Apr 2018 06:48:44 +0200 Subject: [PATCH 1/9] fix Makefile --- src/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c51489565..90a52c207 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -105,10 +105,10 @@ if BUILD_BITCOIND endif if BUILD_BITCOIN_UTILS - bin_PROGRAMS += komodo-cli komodo-tx - if ENABLE_WALLET - bin_PROGRAMS += wallet-utility - endif + bin_PROGRAMS += komodo-cli komodo-tx +endif +if ENABLE_WALLET + bin_PROGRAMS += wallet-utility endif LIBZCASH_H = \ From 1abdb0de139f72ae8a07efde6b92d396263e9116 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 07:55:00 +0300 Subject: [PATCH 2/9] MAX_MONEY declare --- src/zcash/JoinSplit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index 2685569d3..a801bf735 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -17,6 +17,7 @@ #include "tinyformat.h" #include "sync.h" #include "amount.h" +int64_t MAX_MONEY = 200000000 * 100000000LL; using namespace libsnark; From 12b1a8af4cea1d32e12424e0fc5b25d8c7ee69a7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 07:56:48 +0300 Subject: [PATCH 3/9] Extern MAX_MONEY --- src/zcash/JoinSplit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index a801bf735..b96bb2979 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -17,7 +17,7 @@ #include "tinyformat.h" #include "sync.h" #include "amount.h" -int64_t MAX_MONEY = 200000000 * 100000000LL; +extern int64_t MAX_MONEY; using namespace libsnark; From e8972fab176c32f6de15f6f4dd5e6798cdbbc9f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:00:07 +0300 Subject: [PATCH 4/9] Fix --- src/wallet-utility.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet-utility.cpp b/src/wallet-utility.cpp index f36785df3..f27d50aef 100644 --- a/src/wallet-utility.cpp +++ b/src/wallet-utility.cpp @@ -8,6 +8,7 @@ #include "wallet/crypter.h" #include +#include "komodo_globals.h" void show_help() { @@ -336,4 +337,4 @@ int main(int argc, char* argv[]) return 0; else return -1; -} \ No newline at end of file +} From 60eafafa52395f03df5008492c98095fa619cfd8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:01:06 +0300 Subject: [PATCH 5/9] Use CreateJoinSplit.cpp method for wallet-utility.cpp --- src/wallet-utility.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wallet-utility.cpp b/src/wallet-utility.cpp index f27d50aef..5dfbba065 100644 --- a/src/wallet-utility.cpp +++ b/src/wallet-utility.cpp @@ -8,7 +8,11 @@ #include "wallet/crypter.h" #include -#include "komodo_globals.h" +#include "komodo_defs.h" +char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; +int64_t MAX_MONEY = 200000000 * 100000000LL; +uint16_t BITCOIND_PORT = 7771; +uint32_t ASSETCHAINS_CC = 0; void show_help() { From e60ac1ca044353ecdb4f5a0ad6928c5e1782f20d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:02:27 +0300 Subject: [PATCH 6/9] Fix --- src/script/cc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/cc.h b/src/script/cc.h index ad1666b86..dc019beba 100644 --- a/src/script/cc.h +++ b/src/script/cc.h @@ -6,7 +6,7 @@ #include "cryptoconditions/include/cryptoconditions.h" -extern int32_t ASSETCHAINS_CC; +extern uint32_t ASSETCHAINS_CC; bool IsCryptoConditionsEnabled(); // Limit acceptable condition types From 64c854916446cd61a07ced310fba91145421b2c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:03:53 +0300 Subject: [PATCH 7/9] Fix --- src/komodo_globals.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index ecd8bfd6a..31ba6c32c 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -46,13 +46,13 @@ struct komodo_state KOMODO_STATES[34]; int COINBASE_MATURITY = _COINBASE_MATURITY;//100; int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND; -int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE,ASSETCHAINS_CC; +int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY; uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33]; char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN],ASSETCHAINS_USERPASS[4096]; uint16_t ASSETCHAINS_PORT; -uint32_t ASSETCHAIN_INIT; +uint32_t ASSETCHAIN_INIT,ASSETCHAINS_CC; uint32_t ASSETCHAINS_MAGIC = 2387029918; uint64_t ASSETCHAINS_ENDSUBSIDY,ASSETCHAINS_REWARD,ASSETCHAINS_HALVING,ASSETCHAINS_DECAY,ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED,ASSETCHAINS_SUPPLY = 10; From 6e0857cee193ace07b10882fc6cb3a265d1046d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:09:36 +0300 Subject: [PATCH 8/9] Fix --- src/wallet-utility.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet-utility.cpp b/src/wallet-utility.cpp index 5dfbba065..04b9edf45 100644 --- a/src/wallet-utility.cpp +++ b/src/wallet-utility.cpp @@ -11,8 +11,11 @@ #include "komodo_defs.h" char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; int64_t MAX_MONEY = 200000000 * 100000000LL; +uint64_t ASSETCHAINS_SUPPLY; uint16_t BITCOIND_PORT = 7771; -uint32_t ASSETCHAINS_CC = 0; +uint16_t ASSETCHAINS_PORT; +uint32_t ASSETCHAIN_INIT,ASSETCHAINS_CC; +uint32_t ASSETCHAINS_MAGIC = 2387029918; void show_help() { From 9dd93da4743aced049b078c5fbbe750cc6111f89 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 08:23:29 +0300 Subject: [PATCH 9/9] Test validity in mined block path --- src/miner.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index e571f3617..176fb83a7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -917,6 +917,12 @@ void static BitcoinMiner() // fprintf(stderr," missed target\n"); return false; } + CValidationState state; + if ( !TestBlockValidity(state, *pblock, chainActive.Tip(), true, false)) + { + fprintf(stderr,"Invalid block mined, try again\n"); + return(false); + } if ( ASSETCHAINS_STAKED == 0 ) { if ( Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay ) @@ -934,12 +940,6 @@ void static BitcoinMiner() } else { - CValidationState state; - if ( !TestBlockValidity(state, *pblock, chainActive.Tip(), true, false)) - { - fprintf(stderr,"Invalid block mined, try again\n"); - return(false); - } if ( NOTARY_PUBKEY33[0] != 0 ) { printf("need to wait %d seconds to submit\n",(int32_t)(pblock->nTime - GetAdjustedTime()));