MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TxnBegin

Method TxnBegin

src/wallet/sqlite.cpp:658–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658bool SQLiteBatch::TxnBegin()
659{
660 if (!m_database.m_db || m_txn) return false;
661 m_database.m_write_semaphore.acquire();
662 Assert(!m_database.HasActiveTxn());
663 int res = Assert(m_exec_handler)->Exec(m_database, "BEGIN TRANSACTION");
664 if (res != SQLITE_OK) {
665 LogWarning("SQLiteBatch: Failed to begin the transaction");
666 m_database.m_write_semaphore.release();
667 } else {
668 m_txn = true;
669 }
670 return res == SQLITE_OK;
671}
672
673bool SQLiteBatch::TxnCommit()
674{

Callers 9

ExportWatchOnlyWalletFunction · 0.45
MigrateToDescriptorMethod · 0.45
TopUpMethod · 0.45
EncryptWalletMethod · 0.45
MigrateToSQLiteMethod · 0.45
ApplyMigrationDataMethod · 0.45
CreateFromDumpFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 3

releaseMethod · 0.80
HasActiveTxnMethod · 0.45
ExecMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.36