[walletdb] Fix syntax error in key parser #7381

Merged
merged 1 commit into from Jan 20, 2016

Conversation

Projects
None yet
4 participants
@MarcoFalke
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.

@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?

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

@dcousens

dcousens Jan 20, 2016

Contributor

We could probably make it a constant for our sakes anyway.

@dcousens

dcousens Jan 20, 2016

Contributor

We could probably make it a constant for our sakes anyway.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jan 20, 2016

Member

Fixes #7379 I suppose?

Member

laanwj commented Jan 20, 2016

Fixes #7379 I suppose?

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jan 20, 2016

Member

utACK

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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Jan 20, 2016

Merge #7381: [walletdb] Fix syntax error in key parser
fa6d4cc [walletdb] Fix syntax error in key parser (MarcoFalke)

laanwj added a commit that referenced this pull request Jan 20, 2016

@MarcoFalke MarcoFalke deleted the MarcoFalke:Mf1601-walletdbKeyparserFix branch Jan 20, 2016

laanwj added a commit that referenced this pull request Jan 20, 2016

laanwj added a commit that referenced this pull request Jan 20, 2016

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Jan 20, 2016

Member

Fixes #7379 I suppose?

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

Member

MarcoFalke commented Jan 20, 2016

Fixes #7379 I suppose?

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

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jan 20, 2016

Member
Member

laanwj commented Jan 20, 2016

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jan 20, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jan 20, 2016

Member

Nice catch!
Thanks for fixing.
Post merge ACK.

Member

jonasschnelli commented Jan 20, 2016

Nice catch!
Thanks for fixing.
Post merge ACK.

@MarcoFalke MarcoFalke referenced this pull request Jan 21, 2016

Merged

[0.12] backports #7371

@crowning- crowning- referenced this pull request in dashpay/dash Feb 1, 2016

Closed

[walletdb] Fix syntax error in key parser #691

dexX7 added a commit to dexX7/bitcoin that referenced this pull request Apr 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment