mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Sync bug fix
This commit is contained in:
parent
28d0070ce2
commit
760ae07d72
1 changed files with 16 additions and 24 deletions
|
@ -220,9 +220,6 @@ LFDB::LFDB(const Identity &myId,const char *path,const char *lfOwnerPrivate,cons
|
||||||
const uint64_t id = Utils::hexStrToU64(idstr.c_str());
|
const uint64_t id = Utils::hexStrToU64(idstr.c_str());
|
||||||
if ((id >> 24) == controllerAddressInt) { // sanity check
|
if ((id >> 24) == controllerAddressInt) { // sanity check
|
||||||
|
|
||||||
std::lock_guard<std::mutex> sl(_state_l);
|
|
||||||
_NetworkState &ns = _state[id];
|
|
||||||
if (!ns.dirty) {
|
|
||||||
nlohmann::json oldNetwork;
|
nlohmann::json oldNetwork;
|
||||||
if ((timeRangeStart > 0)&&(get(id,oldNetwork))) {
|
if ((timeRangeStart > 0)&&(get(id,oldNetwork))) {
|
||||||
const uint64_t revision = network["revision"];
|
const uint64_t revision = network["revision"];
|
||||||
|
@ -234,7 +231,6 @@ LFDB::LFDB(const Identity &myId,const char *path,const char *lfOwnerPrivate,cons
|
||||||
nlohmann::json nullJson;
|
nlohmann::json nullJson;
|
||||||
_networkChanged(nullJson,network,timeRangeStart > 0);
|
_networkChanged(nullJson,network,timeRangeStart > 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,17 +290,13 @@ LFDB::LFDB(const Identity &myId,const char *path,const char *lfOwnerPrivate,cons
|
||||||
const uint64_t id = Utils::hexStrToU64(idstr.c_str());
|
const uint64_t id = Utils::hexStrToU64(idstr.c_str());
|
||||||
if ((id)&&((nwid >> 24) == controllerAddressInt)) { // sanity check
|
if ((id)&&((nwid >> 24) == controllerAddressInt)) { // sanity check
|
||||||
|
|
||||||
std::lock_guard<std::mutex> sl(_state_l);
|
|
||||||
auto ns = _state.find(nwid);
|
|
||||||
if ((ns == _state.end())||(!ns->second.members[id].dirty)) {
|
|
||||||
nlohmann::json network,oldMember;
|
nlohmann::json network,oldMember;
|
||||||
if ((timeRangeStart > 0)&&(get(nwid,network,id,oldMember))) {
|
if ((timeRangeStart > 0)&&(get(nwid,network,id,oldMember))) {
|
||||||
const uint64_t revision = member["revision"];
|
const uint64_t revision = member["revision"];
|
||||||
const uint64_t prevRevision = oldMember["revision"];
|
const uint64_t prevRevision = oldMember["revision"];
|
||||||
if (prevRevision < revision)
|
if (prevRevision < revision)
|
||||||
_memberChanged(oldMember,member,timeRangeStart > 0);
|
_memberChanged(oldMember,member,timeRangeStart > 0);
|
||||||
}
|
} else if (network.is_object()) {
|
||||||
} else {
|
|
||||||
nlohmann::json nullJson;
|
nlohmann::json nullJson;
|
||||||
_memberChanged(nullJson,member,timeRangeStart > 0);
|
_memberChanged(nullJson,member,timeRangeStart > 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue