Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YespowerSugar PoW Cache: missing part in validation.cpp #42

Open
decryp2kanon opened this issue Oct 18, 2020 · 0 comments
Open

YespowerSugar PoW Cache: missing part in validation.cpp #42

decryp2kanon opened this issue Oct 18, 2020 · 0 comments

Comments

@decryp2kanon
Copy link
Contributor

    // Look for this block's header in the index like AcceptBlock() will
    uint256 hash = pblock->GetHash();

    {
        LOCK(cs_main);

        BlockMap::iterator miSelf = mapBlockIndex.find(hash);
        CBlockIndex *pindex = NULL;
        if (miSelf != mapBlockIndex.end()) {
            // Block header is already known
            pindex = miSelf->second;
            if (!pblock->cache_init && pindex->cache_init) {
                LOCK(pblock->cache_lock); // Probably unnecessary since no concurrent access to pblock is expected
                pblock->cache_init = true;
                pblock->cache_block_hash = pindex->cache_block_hash;
                pblock->cache_PoW_hash = pindex->cache_PoW_hash;
            }
        }
    }

https://github.com/sugarchain-project/sugarchain/pull/22/files#diff-97c3a52bc5fad452d82670a7fd291800bae20c7bc35bb82686c2c0a4ea7b5b98R3502-R3521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant