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

Method Execute

src/persistence/blockundo.cpp:112–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110// class CBlockUndoExecutor
111
112bool CBlockUndoExecutor::Execute() {
113 // undoFuncMap
114 // RegisterUndoFunc();
115 const UndoDataFuncMap &undoDataFuncMap = cw.GetUndoDataFuncMap();
116
117 for (auto it = block_undo.vtxundo.rbegin(); it != block_undo.vtxundo.rend(); it++) {
118 for (const auto &opLogPair : it->dbOpLogMap.GetMap()) {
119 dbk::PrefixType prefixType = dbk::ParseKeyPrefixType(opLogPair.first);
120 if (prefixType == dbk::EMPTY)
121 return ERRORMSG("%s(), unkown prefix! prefix_type=%s", __FUNCTION__,
122 opLogPair.first);
123 auto funcMapIt = undoDataFuncMap.find(prefixType);
124 if (funcMapIt == undoDataFuncMap.end()) {
125 return ERRORMSG("%s(), unfound prefix in db! prefix_type=%s", __FUNCTION__,
126 opLogPair.first);
127 }
128 funcMapIt->second(opLogPair.second);
129 }
130 }
131 return true;
132}

Callers

nothing calls this directly

Calls 4

ParseKeyPrefixTypeFunction · 0.85
GetUndoDataFuncMapMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected