| 7413 | } |
| 7414 | |
| 7415 | void wallet_network_events_extract(const tal_t *ctx, |
| 7416 | struct db_stmt *stmt, |
| 7417 | u64 *id, |
| 7418 | struct node_id *peer_id, |
| 7419 | u64 *timestamp, |
| 7420 | enum network_event *etype, |
| 7421 | const char **reason, |
| 7422 | u64 *duration_nsec, |
| 7423 | bool *connect_attempted) |
| 7424 | { |
| 7425 | *id = db_col_u64(stmt, "id"); |
| 7426 | db_col_node_id(stmt, "peer_id", peer_id); |
| 7427 | *etype = network_event_in_db(db_col_int(stmt, "type")); |
| 7428 | *timestamp = db_col_u64(stmt, "timestamp"); |
| 7429 | *reason = db_col_strdup_optional(ctx, stmt, "reason"); |
| 7430 | *duration_nsec = db_col_u64(stmt, "duration_nsec"); |
| 7431 | *connect_attempted = db_col_int(stmt, "connect_attempted"); |
| 7432 | } |
| 7433 | |
| 7434 | static u64 network_event_index_inc(struct lightningd *ld, |
| 7435 | /* NULL means it's being created */ |
no test coverage detected