linux-0.1.6-test7

test 7:

Backup your data directory before running this, just in case.

Workaround for the Db::open/Db::close “Bad file descriptor” exception. Might also make the initial block download faster. The workaround is to open the database handles and keep them open for the duration of the program, which is actually the more common thing to do anyway. If we’re not closing and opening all the time, the error shouldn’t get a chance to happen.

The one exception is wallet.dat, which I still close after writing is finished so I can flush the transaction logs into the dat file, making the dat file standalone. That way if someone does a backup while Bitcoin is running, they’ll get a wallet.dat that is valid by itself without the database transaction logs.

This is a restructuring of the database handling, so we might find some new deadlocks. Usually if it deadlocks, either the UI will stop repainting, or it’ll stop using CPU even though it still says Generating.

Source: Published by Martti Malmi on GitHub in February 2024 as part of his testimony in the COPA v. Wright trial. The full correspondence archive is available at mmalmi.github.io/satoshi/.