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

Function GetFinalBlockMinerCount

src/miner/pbftmanager.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19extern CCacheDBManager *pCdMan;
20
21uint32_t GetFinalBlockMinerCount(const uint256& preHash = uint256()) {
22 set<CRegID> bpSet;
23 if(preHash != uint256() && pbftContext.GetMinerListByBlockHash(preHash, bpSet)) {
24 uint32_t bpsize = bpSet.size();
25 return bpsize - bpsize/3;
26
27 }
28 uint32_t totalBpsSize = pCdMan->pDelegateCache->GetActivedDelegateNum();
29 return totalBpsSize - totalBpsSize/3;
30
31}
32
33CBlockIndex* CPBFTMan::GetLocalFinIndex(){
34 LOCK(cs_finblock);

Callers 2

UpdateLocalFinBlockMethod · 0.85
UpdateGlobalFinBlockMethod · 0.85

Calls 4

GetActivedDelegateNumMethod · 0.80
uint256Class · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected