Skip to content
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

Merged
merged 1 commit into from
Jan 20, 2016

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jan 20, 2016

This needs backport to all versions of bitcoin/altcoins after merge.

A dump may look like:

VERSION=3
format=bytevalue
database=main
type=btree
db_pagesize=4096
HEADER=END
<{Data}>
DATA=END

So the current parser gives us odd data like:

keyHex="DATA=END";
valueHex="";

(sometimes the other way round)

@@ -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") {
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

@laanwj
Copy link
Member

laanwj commented Jan 20, 2016

Fixes #7379 I suppose?

@laanwj
Copy link
Member

laanwj commented Jan 20, 2016

utACK

@laanwj laanwj added this to the 0.12.0 milestone Jan 20, 2016
@laanwj laanwj merged commit fa6d4cc into bitcoin:master Jan 20, 2016
laanwj added a commit that referenced this pull request Jan 20, 2016
fa6d4cc [walletdb] Fix syntax error in key parser (MarcoFalke)
laanwj pushed a commit that referenced this pull request Jan 20, 2016
@maflcko maflcko deleted the Mf1601-walletdbKeyparserFix branch January 20, 2016 12:09
laanwj pushed a commit that referenced this pull request Jan 20, 2016
laanwj pushed a commit that referenced this pull request Jan 20, 2016
@maflcko
Copy link
Member Author

maflcko commented Jan 20, 2016

Fixes #7379 I suppose?

There are other issues with salvagewallet, so I can't guarantee that.

@laanwj
Copy link
Member

laanwj commented Jan 20, 2016

@laanwj
Copy link
Member

laanwj commented Jan 20, 2016

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...

@jonasschnelli
Copy link
Contributor

Nice catch!
Thanks for fixing.
Post merge ACK.

@maflcko maflcko mentioned this pull request Jan 21, 2016
dexX7 pushed a commit to dexX7/bitcoin that referenced this pull request Apr 24, 2016
reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
Github-Pull: bitcoin#7381
Rebased-From: fa6d4cc
(cherry picked from commit b0c97ce)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants