MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / GetGlobalFinBlockHash

Method GetGlobalFinBlockHash

src/miner/pbftmanager.cpp:44–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44uint256 CPBFTMan::GetGlobalFinBlockHash() {
45 if(!globalFinIndex) {
46 if(globalFinHash != uint256())
47 return globalFinHash;
48 {
49 LOCK(cs_main);
50 std::pair<int32_t ,uint256> globalfinblock = std::make_pair(0,uint256());
51 if (pCdMan->pBlockCache->ReadGlobalFinBlock(globalfinblock)){
52 globalFinHash = globalfinblock.second;
53 } else if (chainActive[0] != nullptr) {
54 globalFinHash = chainActive[0]->GetBlockHash();
55 }
56 return globalFinHash;
57 }
58
59 }
60 return globalFinIndex->GetBlockHash();
61
62}
63
64bool CPBFTMan::SetLocalFinTimeout() {
65 LOCK(cs_finblock);

Callers 1

ActivateBestChainFunction · 0.80

Calls 3

ReadGlobalFinBlockMethod · 0.80
uint256Class · 0.50
GetBlockHashMethod · 0.45

Tested by

no test coverage detected