Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/salvage.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | int ret = pdbCopy->open(nullptr, // Txn pointer | ||||
0); | 0); | ||||
if (ret > 0) { | if (ret > 0) { | ||||
LogPrintf("Cannot create database file %s\n", filename); | LogPrintf("Cannot create database file %s\n", filename); | ||||
pdbCopy->close(0); | pdbCopy->close(0); | ||||
return false; | return false; | ||||
} | } | ||||
DbTxn *ptxn = env->TxnBegin(); | DbTxn *ptxn = env->TxnBegin(); | ||||
CWallet dummyWallet(nullptr, WalletLocation(), | CWallet dummyWallet(nullptr, WalletLocation(), CreateDummyWalletDatabase()); | ||||
WalletDatabase::CreateDummy()); | |||||
for (KeyValPair &row : salvagedData) { | for (KeyValPair &row : salvagedData) { | ||||
/* Filter for only private key type KV pairs to be added to the salvaged | /* Filter for only private key type KV pairs to be added to the salvaged | ||||
* wallet */ | * wallet */ | ||||
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); | CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); | ||||
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); | CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); | ||||
std::string strType, strErr; | std::string strType, strErr; | ||||
bool fReadOK; | bool fReadOK; | ||||
{ | { | ||||
Show All 25 Lines |