From a35f7eee4371725e47f0d9b6d66a1e5ef812ba3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Feb 2017 17:22:48 +0200 Subject: [PATCH 1/6] test --- README.md | 12 ++++++++++++ src/komodo_gateway.h | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 463c3f983..ddb6a044d 100644 --- a/README.md +++ b/README.md @@ -162,3 +162,15 @@ License ------- For license information see the file [COPYING](COPYING). + + +NOTE TO EXCHANGES: +https://bitcointalk.org/index.php?topic=1605144.msg17732151#msg17732151 +There is a small chance that an outbound transaction will give an error due to mismatched values in wallet calculations. There is a -exchange option that you can run komodod with, but make sure to have the entire transaction history under the same -exchange mode. Otherwise you will get wallet conflicts. + +To change modes: +a) backup all privkeys (launch komodod with -exportdir= and dumpwallet) +b) start a totally new sync including wallet.dat +c) stop it before it gets too far and import all the privkeys from a) +d) resume sync till it gets to chaintip + diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2417f077e..488962158 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -704,7 +704,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 bitcoin_address(coinaddr,addrtype,rmd160,20); checktoshis = PAX_fiatdest(&seed,tokomodo,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis); typestr = "deposit"; - if ( kmdheight <= height ) + //if ( kmdheight <= height ) { didstats = 0; if ( 0 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) @@ -769,7 +769,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } else if ( seed != 0 && kmdheight > 182000 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) printf("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n",base,dstr(fiatoshis),kmdheight,dstr(value),dstr(checktoshis),(long long)seed); - } else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight); + } //else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight); } } else if ( opretbuf[0] == 'I' ) From c9ef1c89433c47787a75affa2302cbc2af97782d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Feb 2017 17:57:10 +0200 Subject: [PATCH 2/6] -exchange instructions --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ddb6a044d..36be47e98 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,16 @@ There is a small chance that an outbound transaction will give an error due to m To change modes: a) backup all privkeys (launch komodod with -exportdir= and dumpwallet) -b) start a totally new sync including wallet.dat -c) stop it before it gets too far and import all the privkeys from a) +b) start a totally new sync including wallet.dat, launch with same exportdir +c) stop it before it gets too far and import all the privkeys from a) using komodo-cli importwallet filename d) resume sync till it gets to chaintip +For example: +./komodod -exportdir=/tmp & +./komodo-cli dumpwallet example +./komodo-cli stop +mv ~/.komodo ~/.komodo.old && mkdir ~/.komodo && cp ~/.komodo.old/komodo.conf ~/.komodo.old/peers.dat ~/.komodo +./komodod -exchange -exportdir=/tmp & +./komodo-cli importwallet example + + From 02b021735a001ac43deacc2bd2e8f9e39416d111 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Feb 2017 21:27:19 +0200 Subject: [PATCH 3/6] fix doc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36be47e98..28160dd6e 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,6 @@ For example: ./komodo-cli stop mv ~/.komodo ~/.komodo.old && mkdir ~/.komodo && cp ~/.komodo.old/komodo.conf ~/.komodo.old/peers.dat ~/.komodo ./komodod -exchange -exportdir=/tmp & -./komodo-cli importwallet example +./komodo-cli importwallet /tmp/example From 435a0ea80ba1434f86f38361c7e8b7ab23fa7627 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Feb 2017 01:51:13 +0200 Subject: [PATCH 4/6] test --- src/komodo_gateway.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 488962158..2417f077e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -704,7 +704,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 bitcoin_address(coinaddr,addrtype,rmd160,20); checktoshis = PAX_fiatdest(&seed,tokomodo,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis); typestr = "deposit"; - //if ( kmdheight <= height ) + if ( kmdheight <= height ) { didstats = 0; if ( 0 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) @@ -769,7 +769,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } else if ( seed != 0 && kmdheight > 182000 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) printf("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n",base,dstr(fiatoshis),kmdheight,dstr(value),dstr(checktoshis),(long long)seed); - } //else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight); + } else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight); } } else if ( opretbuf[0] == 'I' ) From 693f7b76040207d76c1c382312898cedd15afeca Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Feb 2017 12:12:40 +0200 Subject: [PATCH 5/6] kolo test --- src/miner.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index f7851e75d..e2e42a067 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -562,7 +562,7 @@ void static BitcoinMiner(CWallet *pwallet) ); try { - //fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); + fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); while (true) { if (chainparams.MiningRequiresPeers()) @@ -571,7 +571,7 @@ void static BitcoinMiner(CWallet *pwallet) // break; // Busy-wait for the network to come online so we don't waste time mining // on an obsolete chain. In regtest mode we expect to fly solo. - //fprintf(stderr,"Wait for peers...\n"); + fprintf(stderr,"Wait for peers...\n"); do { bool fvNodesEmpty; { @@ -584,7 +584,7 @@ void static BitcoinMiner(CWallet *pwallet) //fprintf(stderr,"fvNodesEmpty %d IsInitialBlockDownload(%s) %d\n",(int32_t)fvNodesEmpty,ASSETCHAINS_SYMBOL,(int32_t)IsInitialBlockDownload()); } while (true); - //fprintf(stderr,"%s Found peers\n",ASSETCHAINS_SYMBOL); + fprintf(stderr,"%s Found peers\n",ASSETCHAINS_SYMBOL); } /*while ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight < ASSETCHAINS_MINHEIGHT ) { @@ -601,7 +601,7 @@ void static BitcoinMiner(CWallet *pwallet) Mining_height = pindexPrev->nHeight+1; Mining_start = (uint32_t)time(NULL); } - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); @@ -624,6 +624,9 @@ void static BitcoinMiner(CWallet *pwallet) if ( (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 ) { komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); + for (j=0; j<65; j++) + fprintf(stderr,"%d ",mids[j]); + fprintf(stderr," <- prev minerids from ht.%d notary.%d\n",pindexPrev->nHeight,notaryid); if ( nonzpkeys > 0 ) { for (i=0; i<33; i++) From 3607e409151341618b8332f72de5303427777d54 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Feb 2017 12:19:24 +0200 Subject: [PATCH 6/6] revert --- src/miner.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index e2e42a067..f7851e75d 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -562,7 +562,7 @@ void static BitcoinMiner(CWallet *pwallet) ); try { - fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); + //fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); while (true) { if (chainparams.MiningRequiresPeers()) @@ -571,7 +571,7 @@ void static BitcoinMiner(CWallet *pwallet) // break; // Busy-wait for the network to come online so we don't waste time mining // on an obsolete chain. In regtest mode we expect to fly solo. - fprintf(stderr,"Wait for peers...\n"); + //fprintf(stderr,"Wait for peers...\n"); do { bool fvNodesEmpty; { @@ -584,7 +584,7 @@ void static BitcoinMiner(CWallet *pwallet) //fprintf(stderr,"fvNodesEmpty %d IsInitialBlockDownload(%s) %d\n",(int32_t)fvNodesEmpty,ASSETCHAINS_SYMBOL,(int32_t)IsInitialBlockDownload()); } while (true); - fprintf(stderr,"%s Found peers\n",ASSETCHAINS_SYMBOL); + //fprintf(stderr,"%s Found peers\n",ASSETCHAINS_SYMBOL); } /*while ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight < ASSETCHAINS_MINHEIGHT ) { @@ -601,7 +601,7 @@ void static BitcoinMiner(CWallet *pwallet) Mining_height = pindexPrev->nHeight+1; Mining_start = (uint32_t)time(NULL); } - //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); @@ -624,9 +624,6 @@ void static BitcoinMiner(CWallet *pwallet) if ( (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 ) { komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); - for (j=0; j<65; j++) - fprintf(stderr,"%d ",mids[j]); - fprintf(stderr," <- prev minerids from ht.%d notary.%d\n",pindexPrev->nHeight,notaryid); if ( nonzpkeys > 0 ) { for (i=0; i<33; i++)