Post
Topic
Board Announcements (Altcoins)
Re: ⚓⚓⚓Doubloons⚓⚓⚓ [BOAT] Hybrid PoW/PoS, HMQ1725
by
Chance567
on 07/02/2017, 09:14:43 UTC

The reason it's set to false, is because if true, the wallet fails to load & returns a 'error finding blkindex.dat' - even though there IS a block index.

Setting that value to true was the only way around it, and the solution has yet to be found.  Quite a mystery (clearing the roaming folder usually helps when other wallets run into this issue, but doesn't work in this case)

I get that. Let me see if I'm reading the code right.

void init_blockindex(leveldb::Options& options, bool fRemoveOld = true) {
    // First time init.
    filesystem::path directory = GetDataDir() / "txleveldb";

    if (fRemoveOld)
        filesystem::remove_all(directory); // remove directory
     
   
    filesystem::create_directory(directory);
    printf("Opening LevelDB in %s\n", directory.string().c_str());
    leveldb::Status status = leveldb::DB::Open(options, directory.string(), &txdb);
    if (!status.ok()) {
        throw runtime_error(strprintf("init_blockindex(): error opening database environment %s", status.ToString().c_str()));
    }
}

Pseudocode translation:

Find the block index.
You're going to look for the txleveldb directory to find it.
If I've specified that you need to get rid of the old directory, go ahead and do that.
Make a new directory.
If you run into trouble, panic and tell me about it.


I'm sure you've gone over this a thousand times, and I have no doubt you're more skilled at writing code than I am, but a fresh set of eyes never hurts. If I am reading the code wrong, please feel free to enlighten me. If nothing else, we'll bump the thread back up and keep it in the public eye.