From 0a505e302e99f01b45acfc91c2958de241326f9a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:12:45 -1100 Subject: [PATCH 1/7] +print --- src/txdb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index cb853331f..5ff3beda4 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -453,7 +453,7 @@ UniValue CBlockTreeDB::Snapshot(int top) }; int64_t startingHeight = chainActive.Height(); - //fprintf(stderr, "Starting snapshot at height %lli\n", startingHeight); + fprintf(stderr, "Starting snapshot at height %lli\n", startingHeight); for (iter->SeekToLast(); iter->Valid(); iter->Prev()) { boost::this_thread::interruption_point(); @@ -467,7 +467,7 @@ UniValue CBlockTreeDB::Snapshot(int top) ssKey >> chType; ssKey >> indexKey; - //fprintf(stderr, "chType=%d\n", chType); + fprintf(stderr, "chType=%d vs %d\n", chType,DB_ADDRESSUNSPENTINDEX); if (chType == DB_ADDRESSUNSPENTINDEX) { try { @@ -512,7 +512,7 @@ UniValue CBlockTreeDB::Snapshot(int top) } UniValue addresses(UniValue::VARR); - //fprintf(stderr, "total=%f, totalAddresses=%li, utxos=%li, ignored=%li\n", (double) total / COIN, totalAddresses, utxos, ignoredAddresses); + fprintf(stderr, "total=%f, totalAddresses=%li, utxos=%li, ignored=%li\n", (double) total / COIN, totalAddresses, utxos, ignoredAddresses); for (std::pair element : addressAmounts) { vaddr.push_back( make_pair(element.second, element.first) ); From 17e50f2d48b3a8ab1cc5cc24d3f7a867e53d93de Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:33:58 -1100 Subject: [PATCH 2/7] -print --- src/txdb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 5ff3beda4..cb853331f 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -453,7 +453,7 @@ UniValue CBlockTreeDB::Snapshot(int top) }; int64_t startingHeight = chainActive.Height(); - fprintf(stderr, "Starting snapshot at height %lli\n", startingHeight); + //fprintf(stderr, "Starting snapshot at height %lli\n", startingHeight); for (iter->SeekToLast(); iter->Valid(); iter->Prev()) { boost::this_thread::interruption_point(); @@ -467,7 +467,7 @@ UniValue CBlockTreeDB::Snapshot(int top) ssKey >> chType; ssKey >> indexKey; - fprintf(stderr, "chType=%d vs %d\n", chType,DB_ADDRESSUNSPENTINDEX); + //fprintf(stderr, "chType=%d\n", chType); if (chType == DB_ADDRESSUNSPENTINDEX) { try { @@ -512,7 +512,7 @@ UniValue CBlockTreeDB::Snapshot(int top) } UniValue addresses(UniValue::VARR); - fprintf(stderr, "total=%f, totalAddresses=%li, utxos=%li, ignored=%li\n", (double) total / COIN, totalAddresses, utxos, ignoredAddresses); + //fprintf(stderr, "total=%f, totalAddresses=%li, utxos=%li, ignored=%li\n", (double) total / COIN, totalAddresses, utxos, ignoredAddresses); for (std::pair element : addressAmounts) { vaddr.push_back( make_pair(element.second, element.first) ); From 0893e621822df6848a14f0d42e22faf2f795bac2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:49:54 -1100 Subject: [PATCH 3/7] Test --- src/txdb.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index cb853331f..abea9a018 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -424,7 +424,8 @@ bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &addr UniValue CBlockTreeDB::Snapshot(int top) { - char chType; int64_t total = 0; int64_t totalAddresses = 0; std::string address; + //char chType; + int64_t total = 0; int64_t totalAddresses = 0; std::string address; int64_t utxos = 0; int64_t ignoredAddresses; boost::scoped_ptr iter(NewIterator()); std::map addressAmounts; @@ -459,15 +460,20 @@ UniValue CBlockTreeDB::Snapshot(int top) boost::this_thread::interruption_point(); try { - std::vector slKey = std::vector(); + /*std::vector slKey = std::vector(); iter->GetKey(slKey); CDataStream ssKey(slKey, SER_DISK, CLIENT_VERSION); CAddressIndexIteratorKey indexKey; ssKey >> chType; - ssKey >> indexKey; + ssKey >> indexKey;*/ - //fprintf(stderr, "chType=%d\n", chType); + pair keyObj; + iter->GetKey(keyObj); + char chType = keyObj.first; + CAddressIndexKey indexKey = keyObj.second; + + fprintf(stderr, "chType=%d\n", chType); if (chType == DB_ADDRESSUNSPENTINDEX) { try { From e49f46e29440c6e518d065ea8592ca574ca7949b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:53:30 -1100 Subject: [PATCH 4/7] Test --- src/txdb.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index abea9a018..18b9d2981 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -473,15 +473,17 @@ UniValue CBlockTreeDB::Snapshot(int top) char chType = keyObj.first; CAddressIndexKey indexKey = keyObj.second; - fprintf(stderr, "chType=%d\n", chType); + fprintf(stderr, "chType=%d vs. %d, %d\n", chType,DB_ADDRESSUNSPENTINDEX,DB_ADDRESSINDEX); if (chType == DB_ADDRESSUNSPENTINDEX) { try { - std::vector slValue = std::vector(); + /*std::vector slValue = std::vector(); iter->GetValue(slValue); - CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION); + CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION);*/ CAmount nValue; - ssValue >> nValue; + //ssValue >> nValue; + + iter->GetValue(nValue); getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); From 632dac91e619130289287b14f2716192edb5570a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:55:17 -1100 Subject: [PATCH 5/7] Revert --- src/txdb.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 18b9d2981..cb853331f 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -424,8 +424,7 @@ bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &addr UniValue CBlockTreeDB::Snapshot(int top) { - //char chType; - int64_t total = 0; int64_t totalAddresses = 0; std::string address; + char chType; int64_t total = 0; int64_t totalAddresses = 0; std::string address; int64_t utxos = 0; int64_t ignoredAddresses; boost::scoped_ptr iter(NewIterator()); std::map addressAmounts; @@ -460,30 +459,23 @@ UniValue CBlockTreeDB::Snapshot(int top) boost::this_thread::interruption_point(); try { - /*std::vector slKey = std::vector(); + std::vector slKey = std::vector(); iter->GetKey(slKey); CDataStream ssKey(slKey, SER_DISK, CLIENT_VERSION); CAddressIndexIteratorKey indexKey; ssKey >> chType; - ssKey >> indexKey;*/ + ssKey >> indexKey; - pair keyObj; - iter->GetKey(keyObj); - char chType = keyObj.first; - CAddressIndexKey indexKey = keyObj.second; - - fprintf(stderr, "chType=%d vs. %d, %d\n", chType,DB_ADDRESSUNSPENTINDEX,DB_ADDRESSINDEX); + //fprintf(stderr, "chType=%d\n", chType); if (chType == DB_ADDRESSUNSPENTINDEX) { try { - /*std::vector slValue = std::vector(); + std::vector slValue = std::vector(); iter->GetValue(slValue); - CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION);*/ + CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION); CAmount nValue; - //ssValue >> nValue; - - iter->GetValue(nValue); + ssValue >> nValue; getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); From 593e81ac696796ea1a022c4591c7e7cd67a42ac4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Nov 2018 08:41:02 -1100 Subject: [PATCH 6/7] Increase std amount to 10k --- src/cc/dapps/zmigrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index a86b529ad..81de2c13d 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -906,7 +906,7 @@ int32_t main(int32_t argc,char **argv) zsaddr = clonestr(argv[2]); printf("%s: %s %s\n",REFCOIN_CLI,coinstr,zsaddr); uint32_t lastopid; char coinaddr[64],zcaddr[128],opidstr[128]; int32_t finished; int64_t amount,stdamount,txfee; - stdamount = 1000 * SATOSHIDEN; + stdamount = 10000 * SATOSHIDEN; txfee = 10000; again: printf("start processing zmigrate\n"); From 0b71e4822a23ee361bbbf840c6c74071c5b9dbbe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Nov 2018 08:50:44 -1100 Subject: [PATCH 7/7] Fix komodo_txnotarizedconfirmed --- src/cc/CCutils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index 93fddee67..9d024cded 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -492,12 +492,12 @@ bool komodo_txnotarizedconfirmed(uint256 txid) return(0); } confirms=1 + pindex->GetHeight() - txheight; - if ( KOMODO_DPOWCONFS != 0 && txheight > 0 && confirms > 0 && (sp= komodo_stateptr(symbol,dest)) != 0 ) + if ( txheight > 0 && confirms > 0 && (sp= komodo_stateptr(symbol,dest)) != 0 ) { if ( (notarized=sp->NOTARIZED_HEIGHT) > 0 ) { if ( txheight >= sp->NOTARIZED_HEIGHT ) - confirms=1; + confirms = (txheight - sp->NOTARIZED_HEIGHT); } } #ifdef TESTMODE @@ -508,4 +508,4 @@ bool komodo_txnotarizedconfirmed(uint256 txid) else if (notarized==0 && confirms >= MIN_NON_NOTARIZED_CONFIRMS) return (true); return (false); -} \ No newline at end of file +}