| 67 | } |
| 68 | |
| 69 | static void towire_account(u8 **pptr, const struct account *account) |
| 70 | { |
| 71 | towire_wirestring(pptr, account->name); |
| 72 | if (account->peer_id) { |
| 73 | towire_bool(pptr, true); |
| 74 | towire_node_id(pptr, account->peer_id); |
| 75 | } else |
| 76 | towire_bool(pptr, false); |
| 77 | towire_bool(pptr, account->we_opened); |
| 78 | towire_bool(pptr, account->leased); |
| 79 | towire_u64(pptr, account->onchain_resolved_block); |
| 80 | if (account->open_event_db_id) { |
| 81 | towire_bool(pptr, true); |
| 82 | towire_u64(pptr, *account->open_event_db_id); |
| 83 | } else |
| 84 | towire_bool(pptr, false); |
| 85 | if (account->closed_event_db_id) { |
| 86 | towire_bool(pptr, true); |
| 87 | towire_u64(pptr, *account->closed_event_db_id); |
| 88 | } else |
| 89 | towire_bool(pptr, false); |
| 90 | towire_u32(pptr, account->closed_count); |
| 91 | } |
| 92 | |
| 93 | static struct account *fromwire_account(struct accounts *accounts, |
| 94 | const u8 **pptr, size_t *max) |
no test coverage detected