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

Function wallet_block_add

wallet/wallet.c:4919–4933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4917}
4918
4919void wallet_block_add(struct wallet *w, struct block *b)
4920{
4921 struct db_stmt *stmt =
4922 db_prepare_v2(w->db, SQL("INSERT INTO blocks "
4923 "(height, hash, prev_hash) "
4924 "VALUES (?, ?, ?);"));
4925 db_bind_int(stmt, b->height);
4926 db_bind_sha256d(stmt, &b->blkid.shad);
4927 if (b->prev) {
4928 db_bind_sha256d(stmt, &b->prev->blkid.shad);
4929 } else {
4930 db_bind_null(stmt);
4931 }
4932 db_exec_prepared_v2(take(stmt));
4933}
4934
4935void wallet_block_remove(struct wallet *w, struct block *b)
4936{

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