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

Method EraseKey

src/wallet/sqlite.cpp:446–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446bool SQLiteBatch::EraseKey(CDataStream&& key)
447{
448 if (!m_database.m_db) return false;
449 assert(m_delete_stmt);
450
451 // Bind: leftmost parameter in statement is index 1
452 int res = sqlite3_bind_blob(m_delete_stmt, 1, key.data(), key.size(), SQLITE_STATIC);
453 if (res != SQLITE_OK) {
454 LogPrintf("%s: Unable to bind statement: %s\n", __func__, sqlite3_errstr(res));
455 sqlite3_clear_bindings(m_delete_stmt);
456 sqlite3_reset(m_delete_stmt);
457 return false;
458 }
459
460 // Execute
461 res = sqlite3_step(m_delete_stmt);
462 sqlite3_clear_bindings(m_delete_stmt);
463 sqlite3_reset(m_delete_stmt);
464 if (res != SQLITE_DONE) {
465 LogPrintf("%s: Unable to execute statement: %s\n", __func__, sqlite3_errstr(res));
466 }
467 return res == SQLITE_DONE;
468}
469
470bool SQLiteBatch::HasKey(CDataStream&& key)
471{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected