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

Method GetDexOperatorByOwner

src/persistence/dexdb.cpp:137–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137bool CDexDBCache::GetDexOperatorByOwner(const CRegID &regid, DexID &idOut, DexOperatorDetail& detail) {
138 decltype(operator_owner_map_cache)::ValueType dexID;
139 if (operator_owner_map_cache.GetData(regid, dexID)) {
140 idOut = dexID.value().get();
141 return GetDexOperator(dexID.value().get(), detail);
142 }else {
143 CRegID sysRegId = SysCfg().GetDex0OwnerRegId();
144 if (sysRegId == regid) {
145 idOut = MAIN_DEX_ID;
146 bool result = GetDexOperator(idOut ,detail);
147 if (result && detail.owner_regid == regid)
148 return result;
149 }
150 }
151 return false;
152}
153
154bool CDexDBCache::HaveDexOperator(const DexID &id) {
155 if (id == MAIN_DEX_ID )

Callers 1

getdexoperatorbyownerFunction · 0.80

Calls 5

GetDex0OwnerRegIdMethod · 0.80
GetDexOperatorFunction · 0.50
GetDataMethod · 0.45
getMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected