| 3856 | } |
| 3857 | |
| 3858 | void wallet_utxoset_add(struct wallet *w, |
| 3859 | const struct bitcoin_outpoint *outpoint, |
| 3860 | const u32 blockheight, |
| 3861 | const u32 txindex, const u8 *scriptpubkey, |
| 3862 | struct amount_sat sat) |
| 3863 | { |
| 3864 | struct db_stmt *stmt; |
| 3865 | |
| 3866 | stmt = db_prepare_v2(w->db, SQL("INSERT INTO utxoset (" |
| 3867 | " txid," |
| 3868 | " outnum," |
| 3869 | " blockheight," |
| 3870 | " spendheight," |
| 3871 | " txindex," |
| 3872 | " scriptpubkey," |
| 3873 | " satoshis" |
| 3874 | ") VALUES(?, ?, ?, ?, ?, ?, ?);")); |
| 3875 | db_bind_txid(stmt, 0, &outpoint->txid); |
| 3876 | db_bind_int(stmt, 1, outpoint->n); |
| 3877 | db_bind_int(stmt, 2, blockheight); |
| 3878 | db_bind_null(stmt, 3); |
| 3879 | db_bind_int(stmt, 4, txindex); |
| 3880 | db_bind_talarr(stmt, 5, scriptpubkey); |
| 3881 | db_bind_amount_sat(stmt, 6, &sat); |
| 3882 | db_exec_prepared_v2(take(stmt)); |
| 3883 | |
| 3884 | outpointfilter_add(w->utxoset_outpoints, outpoint); |
| 3885 | } |
| 3886 | |
| 3887 | void wallet_filteredblock_add(struct wallet *w, const struct filteredblock *fb) |
| 3888 | { |
no test coverage detected