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

Function wallet_block_add

wallet/wallet.c:4896–4910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4894}
4895
4896void wallet_block_add(struct wallet *w, struct block *b)
4897{
4898 struct db_stmt *stmt =
4899 db_prepare_v2(w->db, SQL("INSERT INTO blocks "
4900 "(height, hash, prev_hash) "
4901 "VALUES (?, ?, ?);"));
4902 db_bind_int(stmt, b->height);
4903 db_bind_sha256d(stmt, &b->blkid.shad);
4904 if (b->prev) {
4905 db_bind_sha256d(stmt, &b->prev->blkid.shad);
4906 } else {
4907 db_bind_null(stmt);
4908 }
4909 db_exec_prepared_v2(take(stmt));
4910}
4911
4912void wallet_block_remove(struct wallet *w, struct block *b)
4913{

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