sugarchain-project / yumekawa

[TEST] Yumekawa 2.0 Taproot
MIT License
6 stars 5 forks source link

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

Open decryp2kanon opened 3 years ago

decryp2kanon commented 3 years ago
    // 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