Fix: DHT cannot bootstrap if bdboot.txt is corrupted.

If the bdboot.txt file is broken in profile folder, attempt to load the data from the file installed with RS.
This commit is contained in:
hunbernd 2021-01-02 18:44:32 +01:00
parent 9c13dc2ff8
commit a97d0ff15c
11 changed files with 41 additions and 23 deletions

View file

@ -53,7 +53,7 @@
/*************************************/
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, const std::string& filteredipfile, bdDhtFunctions *fns)
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, std::string bootstrapfilebak, const std::string& filteredipfile, bdDhtFunctions *fns)
:UdpSubReceiver(pub), dhtMtx(true)//, mFns(fns)
{
std::string usedVersion;
@ -72,7 +72,7 @@ UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, st
/* setup nodeManager */
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, filteredipfile, fns);
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, bootstrapfilebak, filteredipfile, fns);
}

View file

@ -45,7 +45,7 @@ class UdpBitDht: public UdpSubReceiver, public bdThread, public BitDhtInterface
{
public:
UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string dhtVersion, std::string bootstrapfile, const std::string& filteredipfile,bdDhtFunctions *fns);
UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string dhtVersion, std::string bootstrapfile, std::string bootstrapfilebak, const std::string& filteredipfile,bdDhtFunctions *fns);
virtual ~UdpBitDht();