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

Method GetNewCursor

src/wallet/sqlite.cpp:601–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewCursor()
602{
603 if (!m_database.m_db) return nullptr;
604 auto cursor = std::make_unique<SQLiteCursor>();
605
606 const char* stmt_text = "SELECT key, value FROM main";
607 int res = sqlite3_prepare_v2(m_database.m_db, stmt_text, -1, &cursor->m_cursor_stmt, nullptr);
608 if (res != SQLITE_OK) {
609 throw std::runtime_error(strprintf(
610 "%s: Failed to setup cursor SQL statement: %s\n", __func__, sqlite3_errstr(res)));
611 }
612
613 return cursor;
614}
615
616std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewPrefixCursor(std::span<const std::byte> prefix)
617{

Callers 2

MigrateToSQLiteMethod · 0.45
DumpWalletFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected