Bitcoin Forum
January 20, 2019, 10:46:54 PM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why per-wallet db.log and database?  (Read 47 times)
jnano
Member
**
Offline Offline

Activity: 241
Merit: 18


View Profile
March 06, 2018, 05:03:24 PM
 #1

In a GitHub discussion related to multi-wallet there was a mention of (optionally?) each wallet having "its own bdb environment", and storing each wallet.dat in a directory along with db.log and a /database subdirectory.

What's the idea here and what's the database directory supposed to hold?


1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
1548024414
Hero Member
*
Offline Offline

Posts: 1548024414

View Profile Personal Message (Offline)

Ignore
1548024414
Reply with quote  #2

1548024414
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1652
Merit: 1982


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
March 09, 2018, 12:48:20 AM
 #2

Both the file db.log and the directory database are files used by the BDB database engine. The directory database is a temporary directory that is used to store data about the wallet while the wallet database is open. If Bitcoin Core is uncleanly closed, the BDB database will also be uncleanly closed. If it is uncleanly closed, then in order to open it again without having any problems, you must have the database directory as it contains some BDB state data. If they are separated (wallet.dat moved out or database is deleted), then the wallet database can be corrupted and private keys corrupted. This can result in a loss of funds.

Having separate wallet directories containing their own database environments allows for better dynamic wallet handling and a failure to close the BDB environment cleanly may only just effect one wallet instead of all wallets.

jnano
Member
**
Offline Offline

Activity: 241
Merit: 18


View Profile
March 16, 2018, 01:41:14 PM
 #3

So wallet.dat is BDB, and ./database/ is a transactional log?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1652
Merit: 1982


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
March 16, 2018, 05:45:34 PM
 #4

So wallet.dat is BDB, and ./database/ is a transactional log?
database/ is used for whatever other temporary data BDB needs. This includes (but is not necessarily limited to) database transaction logs.

Pages: [1]
  Print  
 
Jump to:  

Bitcointalk.org is not available or authorized for sale. Do not believe any fake listings.
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!