| 4083 | } |
| 4084 | |
| 4085 | static void wallet_annotation_add(struct wallet *w, const struct bitcoin_txid *txid, int num, |
| 4086 | enum wallet_tx_annotation_type annotation_type, enum wallet_tx_type type, u64 channel) |
| 4087 | { |
| 4088 | struct db_stmt *stmt; |
| 4089 | |
| 4090 | stmt = db_prepare_v2( |
| 4091 | w->db,SQL("INSERT INTO transaction_annotations " |
| 4092 | "(txid, idx, location, type, channel) " |
| 4093 | "VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;")); |
| 4094 | |
| 4095 | db_bind_txid(stmt, 0, txid); |
| 4096 | db_bind_int(stmt, 1, num); |
| 4097 | db_bind_int(stmt, 2, annotation_type); |
| 4098 | db_bind_int(stmt, 3, type); |
| 4099 | if (channel != 0) |
| 4100 | db_bind_u64(stmt, 4, channel); |
| 4101 | else |
| 4102 | db_bind_null(stmt, 4); |
| 4103 | db_exec_prepared_v2(take(stmt)); |
| 4104 | } |
| 4105 | |
| 4106 | void wallet_annotate_txout(struct wallet *w, |
| 4107 | const struct bitcoin_outpoint *outpoint, |
no test coverage detected