Skip to content

Commit f4c9814

Browse files
committed
minor formatting and update some comments
1 parent d78dead commit f4c9814

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main/java/prof7bit/bitcoin/wallettool/fileformats/WalletDatHandler.xtend

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import prof7bit.bitcoin.wallettool.exceptions.FormatFoundNeedPasswordException
2828
class WalletDatHandler extends AbstractImportExportHandler {
2929
val log = LoggerFactory.getLogger(this.class)
3030

31-
3231
/**
3332
* Try to parse keys from a bitcoin-core wallet.dat file.
3433
* Reverse engineered with inspiration from pywallet.py,
@@ -133,21 +132,26 @@ class WalletDat {
133132
}
134133
}
135134

135+
136+
//
136137
//
137-
// Bitcoin stuff
138138
//
139+
// Bitcoin specific stuff
139140

140141
/**
141142
* parse an individual key/value pair and see if it contains
142143
* relevant information, extract this information (we only
143144
* care about private keys and ignore all other stuff) and
144-
* add it to the rawKeyList.
145+
* add it to the rawKeyList. "key" here means key as in
146+
* "key/value", it does not mean bitcoin private key. This
147+
* method will be called for every key/value pair that is
148+
* found in the database while the database is being read.
145149
*/
146150
private def parseKeyValuePair(ByteBuffer key, ByteBuffer value) {
147151
if (Arrays.equals(key.array, "main".bytes)){
148152
// ignore this key, it appears on page #1
149153
// as the only item and seems to be some
150-
// bdb internal thing.
154+
// bdb internal thing, not Bitcoin related.
151155
return
152156
}
153157

@@ -162,7 +166,7 @@ class WalletDat {
162166
val type = key.readString
163167
switch(type){
164168
case "name": parseName(key, value)
165-
case "key": parseKey(key, value)
169+
case "key" : parseKey(key, value)
166170
case "wkey": parseWkey(key, value)
167171
case "ckey": parseCkey(key, value)
168172
case "mkey": parseMkey(key, value) // encrypted master key
@@ -305,9 +309,11 @@ class WalletDat {
305309
rawKeyList.getName(addr)
306310
}
307311

312+
313+
//
308314
//
309-
// Berkeley-db stuff
310315
//
316+
// Berkeley-db specific stuff, not Bitcoin-related
311317

312318
/**
313319
* Parse the wallet.dat file, find all b-tree leaf

0 commit comments

Comments
 (0)