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 {
|
||||
|
||||
// const oldSupernodeKbucket = await localbitcoinplusplus.kademlia.restoreKbucket(
|
||||
// myFloId,
|
||||
// "FLO_TEST",
|
||||
// KBucket
|
||||
// );
|
||||
|
||||
const allUsersData = await readAllDB("userPublicData");
|
||||
|
||||
const supernodesFloList = localbitcoinplusplus.master_configurations.supernodesPubKeys
|
||||
@ -12616,12 +12610,24 @@
|
||||
immigrants_data
|
||||
)
|
||||
.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);
|
||||
|
||||
// Rebuild KBucket
|
||||
// localbitcoinplusplus.kademlia.restoreKbucket(
|
||||
// myFloId,
|
||||
// "FLO_TEST",
|
||||
// KBucket
|
||||
// );
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@ -22507,17 +22513,23 @@
|
||||
if (obj.length > 0) {
|
||||
for (var prop in obj) {
|
||||
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(
|
||||
tableStoreName,
|
||||
obj[prop],
|
||||
obj[prop].id,
|
||||
true,
|
||||
false
|
||||
).then(() => {
|
||||
showMessage(
|
||||
`INFO: "${tableStoreName}" datastore syncing is complete.`
|
||||
);
|
||||
});
|
||||
);
|
||||
showMessage(
|
||||
`INFO: "${tableStoreName}" datastore syncing is complete.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28363,6 +28375,7 @@
|
||||
};
|
||||
|
||||
this.request.onerror = function (event) {
|
||||
console.trace(event);
|
||||
reject(event);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user