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

Function fromwire_account

plugins/bkpr/account.c:93–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static struct account *fromwire_account(struct accounts *accounts,
94 const u8 **pptr, size_t *max)
95{
96 const char *name;
97 struct account *account;
98
99 name = fromwire_wirestring(NULL, pptr, max);
100 if (!name)
101 return NULL;
102
103 account = new_account(accounts, take(name));
104 if (fromwire_bool(pptr, max)) {
105 account->peer_id = tal(account, struct node_id);
106 fromwire_node_id(pptr, max, account->peer_id);
107 } else
108 account->peer_id = NULL;
109 account->we_opened = fromwire_bool(pptr, max);
110 account->leased = fromwire_bool(pptr, max);
111 account->onchain_resolved_block = fromwire_u64(pptr, max);
112 if (fromwire_bool(pptr, max)) {
113 account->open_event_db_id = tal(account, u64);
114 *account->open_event_db_id = fromwire_u64(pptr, max);
115 } else
116 account->open_event_db_id = NULL;
117 if (fromwire_bool(pptr, max)) {
118 account->closed_event_db_id = tal(account, u64);
119 *account->closed_event_db_id = fromwire_u64(pptr, max);
120 } else
121 account->closed_event_db_id = NULL;
122 account->closed_count = fromwire_u32(pptr, max);
123
124 if (!pptr)
125 return tal_free(account);
126 return account;
127}
128
129struct account **list_accounts(const tal_t *ctx, const struct bkpr *bkpr)
130{

Callers 1

init_accountsFunction · 0.85

Calls 7

new_accountFunction · 0.85
tal_freeFunction · 0.85
fromwire_wirestringFunction · 0.50
fromwire_boolFunction · 0.50
fromwire_node_idFunction · 0.50
fromwire_u64Function · 0.50
fromwire_u32Function · 0.50

Tested by

no test coverage detected