|
|
|
@ -143,9 +143,11 @@ public:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Access to the wallet database.
|
|
|
|
|
* This represents a single transaction at the
|
|
|
|
|
* database. It will be committed when the object goes out of scope.
|
|
|
|
|
* Optionally (on by default) it will flush to disk as well.
|
|
|
|
|
* Opens the database and provides read and write access to it. Each read and write is its own transaction.
|
|
|
|
|
* Multiple operation transactions can be started using TxnBegin() and committed using TxnCommit()
|
|
|
|
|
* Otherwise the transaction will be committed when the object goes out of scope.
|
|
|
|
|
* Optionally (on by default) it will flush to disk on close.
|
|
|
|
|
* Every 1000 writes will automatically trigger a flush to disk.
|
|
|
|
|
*/
|
|
|
|
|
class WalletBatch
|
|
|
|
|
{
|
|
|
|
@ -157,6 +159,9 @@ private:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_database.IncrementUpdateCounter();
|
|
|
|
|
if (m_database.nUpdateCounter % 1000 == 0) {
|
|
|
|
|
m_batch.Flush();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -167,6 +172,9 @@ private:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_database.IncrementUpdateCounter();
|
|
|
|
|
if (m_database.nUpdateCounter % 1000 == 0) {
|
|
|
|
|
m_batch.Flush();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|