-
Notifications
You must be signed in to change notification settings - Fork 36.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[walletdb] Fix syntax error in key parser #7381
Conversation
@@ -205,7 +205,7 @@ bool CDBEnv::Salvage(const std::string& strFile, bool fAggressive, std::vector<C | |||
std::string keyHex, valueHex; | |||
while (!strDump.eof() && keyHex != "DATA=END") { | |||
getline(strDump, keyHex); | |||
if (keyHex != "DATA_END") { | |||
if (keyHex != "DATA=END") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this value come from? If from berkeleydb itself: Is it documented, or available as some kind of constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db_dump ~/.bitcoin/regtest/wallet.dat
https://docs.oracle.com/cd/E17275_01/html/api_reference/C/db_dump.html
http://web.deu.edu.tr/doc/berkeley/berkeleyDB/ref/dumpload/format.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably make it a constant for our sakes anyway.
Fixes #7379 I suppose? |
utACK |
fa6d4cc [walletdb] Fix syntax error in key parser (MarcoFalke)
There are other issues with salvagewallet, so I can't guarantee that. |
Right, I meant the specific problem. It's never possible to guarantee that you've solved all bugs. If only... |
Nice catch! |
Github-Pull: bitcoin#7381 Rebased-From: fa6d4cc
Github-Pull: bitcoin#7381 Rebased-From: fa6d4cc (cherry picked from commit b0c97ce)
This needs backport to all versions of bitcoin/altcoins after merge.
A dump may look like:
So the current parser gives us odd data like:
keyHex="DATA=END";
valueHex="";
(sometimes the other way round)