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

@MarcoFalke
Copy link
Member

MarcoFalke 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") {

This comment has been minimized.

Copy link
@laanwj

laanwj Jan 20, 2016

Member

Where does this value come from? If from berkeleydb itself: Is it documented, or available as some kind of constant?

This comment has been minimized.

Copy link
@dcousens

dcousens Jan 20, 2016

Contributor

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Jan 20, 2016
fa6d4cc [walletdb] Fix syntax error in key parser (MarcoFalke)
laanwj added a commit that referenced this pull request Jan 20, 2016
Github-Pull: #7381
Rebased-From: fa6d4cc
@MarcoFalke MarcoFalke deleted the MarcoFalke:Mf1601-walletdbKeyparserFix branch Jan 20, 2016
laanwj added a commit that referenced this pull request Jan 20, 2016
Github-Pull: #7381
Rebased-From: fa6d4cc
laanwj added a commit that referenced this pull request Jan 20, 2016
Github-Pull: #7381
Rebased-From: fa6d4cc
@MarcoFalke
Copy link
Member Author

MarcoFalke 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
Member

jonasschnelli commented Jan 20, 2016

Nice catch!
Thanks for fixing.
Post merge ACK.

@MarcoFalke MarcoFalke mentioned this pull request Jan 21, 2016
dexX7 added a commit to dexX7/bitcoin that referenced this pull request Apr 24, 2016
Github-Pull: bitcoin#7381
Rebased-From: fa6d4cc
reddink added a commit to reddcoin-project/reddcoin that referenced this pull request May 27, 2020
Github-Pull: bitcoin#7381
Rebased-From: fa6d4cc
(cherry picked from commit b0c97ce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.