MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wallet_block_add

Function wallet_block_add

wallet/wallet.c:4859–4873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4857}
4858
4859void wallet_block_add(struct wallet *w, struct block *b)
4860{
4861 struct db_stmt *stmt =
4862 db_prepare_v2(w->db, SQL("INSERT INTO blocks "
4863 "(height, hash, prev_hash) "
4864 "VALUES (?, ?, ?);"));
4865 db_bind_int(stmt, b->height);
4866 db_bind_sha256d(stmt, &b->blkid.shad);
4867 if (b->prev) {
4868 db_bind_sha256d(stmt, &b->prev->blkid.shad);
4869 } else {
4870 db_bind_null(stmt);
4871 }
4872 db_exec_prepared_v2(take(stmt));
4873}
4874
4875void wallet_block_remove(struct wallet *w, struct block *b)
4876{

Callers 2

test_wallet_outputsFunction · 0.85
add_tipFunction · 0.85

Calls 4

db_bind_intFunction · 0.85
db_bind_sha256dFunction · 0.85
db_bind_nullFunction · 0.85
db_exec_prepared_v2Function · 0.85

Tested by 1

test_wallet_outputsFunction · 0.68