added code in exportUserDataFromOneSupernodeToAnother to remove users from kbucket and kbucktStore, added code to remove is_deletable data during primary sync
This commit is contained in:
parent
ea1c155681
commit
5927845f7c
@ -12580,12 +12580,6 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// const oldSupernodeKbucket = await localbitcoinplusplus.kademlia.restoreKbucket(
|
|
||||||
// myFloId,
|
|
||||||
// "FLO_TEST",
|
|
||||||
// KBucket
|
|
||||||
// );
|
|
||||||
|
|
||||||
const allUsersData = await readAllDB("userPublicData");
|
const allUsersData = await readAllDB("userPublicData");
|
||||||
|
|
||||||
const supernodesFloList = localbitcoinplusplus.master_configurations.supernodesPubKeys
|
const supernodesFloList = localbitcoinplusplus.master_configurations.supernodesPubKeys
|
||||||
@ -12616,12 +12610,24 @@
|
|||||||
immigrants_data
|
immigrants_data
|
||||||
)
|
)
|
||||||
.then(server_sync_response => doSend(server_sync_response));
|
.then(server_sync_response => doSend(server_sync_response));
|
||||||
|
|
||||||
|
// Delete this user from kBucketStore datastore and Kbucket
|
||||||
|
const UintID = localbitcoinplusplus.kademlia.floIdToKbucketId('FLO_TEST', closestSu[0].data.id);
|
||||||
|
await removeinDB('kBucketStore', UintID);
|
||||||
|
KBucket.remove(UintID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
localbitcoinplusplus.kademlia.updateClosestSupernodeSeeds(myFloId);
|
localbitcoinplusplus.kademlia.updateClosestSupernodeSeeds(myFloId);
|
||||||
|
|
||||||
|
// Rebuild KBucket
|
||||||
|
// localbitcoinplusplus.kademlia.restoreKbucket(
|
||||||
|
// myFloId,
|
||||||
|
// "FLO_TEST",
|
||||||
|
// KBucket
|
||||||
|
// );
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -22507,17 +22513,23 @@
|
|||||||
if (obj.length > 0) {
|
if (obj.length > 0) {
|
||||||
for (var prop in obj) {
|
for (var prop in obj) {
|
||||||
if (!obj.hasOwnProperty(prop)) continue;
|
if (!obj.hasOwnProperty(prop)) continue;
|
||||||
|
|
||||||
|
if(typeof obj[prop].is_deletable==="boolean"
|
||||||
|
&& obj[prop].is_deletable===true) {
|
||||||
|
removeinDB(tableStoreName, obj[prop].id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
await updateinDB(
|
await updateinDB(
|
||||||
tableStoreName,
|
tableStoreName,
|
||||||
obj[prop],
|
obj[prop],
|
||||||
obj[prop].id,
|
obj[prop].id,
|
||||||
true,
|
true,
|
||||||
false
|
false
|
||||||
).then(() => {
|
);
|
||||||
showMessage(
|
showMessage(
|
||||||
`INFO: "${tableStoreName}" datastore syncing is complete.`
|
`INFO: "${tableStoreName}" datastore syncing is complete.`
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28363,6 +28375,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.request.onerror = function (event) {
|
this.request.onerror = function (event) {
|
||||||
|
console.trace(event);
|
||||||
reject(event);
|
reject(event);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user