I have this code which I am trying to loop around all the key/values in wallet.dat but I only get one key, "main". I guess main seems to be logical db name. ( https://github.com/bitcoin/bitcoin/blob/v0.9.0/src/db.cpp#L260 ) Do anyone know why it only finds main and not other key/values? The wallet is unencrypted.
Code
Code:
<?php
print_r(dba_handlers(true));
$id = dba_popen("wallet.dat", "r", "db4");
if (!$id) {
echo "dba_open failed\n";
exit;
}
$key = dba_firstkey($id);
$keys = array();
while ($key != false) {
$value = dba_fetch($key, $id);
$keys[] = array($key, $value);
$key = dba_nextkey($id);
}
print_r($keys);
dba_close($id);
Output
Code:
Array
(
[db4] => Berkeley DB 4.8.24: (August 14, 2009)
)
Array
(
[0] => Array
(
[0] => main
[1] =>
)
)
I ran this in XAMPP 1.7.3 which has PHP 5.3.1 and php_dba.dll