Seeks to optimize and simplify WalletBatch::EraseRecords
. Currently, this process opens a cursor to iterate over the entire database, searching for records that match the type prefixes, to then call the WalletBatch::Erase
function for each of the matching records.
This PR rewrites this 40-line manual process into a single line; instead of performing all of those actions manually, we can simply utilize the ErasePrefix()
functionality. The result is 06216b344dea6ad6c385fda0b37808ff9ae5273b.
Moreover, it expands the test coverage for the ErasePrefix
functionality and documents the db txn requirement for BerkeleyBatch::ErasePrefix
.