@@ -28,7 +28,6 @@ import prof7bit.bitcoin.wallettool.exceptions.FormatFoundNeedPasswordException
28
28
class WalletDatHandler extends AbstractImportExportHandler {
29
29
val log = LoggerFactory . getLogger(this . class)
30
30
31
-
32
31
/**
33
32
* Try to parse keys from a bitcoin-core wallet.dat file.
34
33
* Reverse engineered with inspiration from pywallet.py,
@@ -133,21 +132,26 @@ class WalletDat {
133
132
}
134
133
}
135
134
135
+
136
+ //
136
137
//
137
- // Bitcoin stuff
138
138
//
139
+ // Bitcoin specific stuff
139
140
140
141
/**
141
142
* parse an individual key/value pair and see if it contains
142
143
* relevant information, extract this information (we only
143
144
* 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.
145
149
*/
146
150
private def parseKeyValuePair (ByteBuffer key , ByteBuffer val ue ) {
147
151
if (Arrays . equals(key. array, " main" . bytes)){
148
152
// ignore this key, it appears on page #1
149
153
// as the only item and seems to be some
150
- // bdb internal thing.
154
+ // bdb internal thing, not Bitcoin related .
151
155
return
152
156
}
153
157
@@ -162,7 +166,7 @@ class WalletDat {
162
166
val type = key. readString
163
167
switch (type){
164
168
case " name" : parseName(key, value)
165
- case " key" : parseKey(key, value)
169
+ case " key" : parseKey(key, value)
166
170
case " wkey" : parseWkey(key, value)
167
171
case " ckey" : parseCkey(key, value)
168
172
case " mkey" : parseMkey(key, value) // encrypted master key
@@ -305,9 +309,11 @@ class WalletDat {
305
309
rawKeyList. getName(addr)
306
310
}
307
311
312
+
313
+ //
308
314
//
309
- // Berkeley-db stuff
310
315
//
316
+ // Berkeley-db specific stuff, not Bitcoin-related
311
317
312
318
/**
313
319
* Parse the wallet.dat file, find all b-tree leaf
0 commit comments