MCPcopy Create free account
hub / github.com/ElementsProject/elements / HasKey

Method HasKey

src/wallet/sqlite.cpp:470–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470bool SQLiteBatch::HasKey(CDataStream&& key)
471{
472 if (!m_database.m_db) return false;
473 assert(m_read_stmt);
474
475 // Bind: leftmost parameter in statement is index 1
476 bool ret = false;
477 int res = sqlite3_bind_blob(m_read_stmt, 1, key.data(), key.size(), SQLITE_STATIC);
478 if (res == SQLITE_OK) {
479 res = sqlite3_step(m_read_stmt);
480 if (res == SQLITE_ROW) {
481 ret = true;
482 }
483 }
484
485 sqlite3_clear_bindings(m_read_stmt);
486 sqlite3_reset(m_read_stmt);
487 return ret;
488}
489
490bool SQLiteBatch::StartCursor()
491{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected