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

Function json_add_channel_event

plugins/bkpr/channel_event.c:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void json_add_channel_event(struct json_stream *out,
36 struct channel_event *ev)
37{
38 json_object_start(out, NULL);
39 json_add_string(out, "account", ev->acct_name);
40 json_add_string(out, "type", "channel");
41 json_add_string(out, "tag", ev->tag);
42 json_add_amount_msat_only(out, "credit_msat", ev->credit);
43 json_add_amount_msat_only(out, "debit_msat", ev->debit);
44 if (!amount_msat_zero(ev->fees))
45 json_add_amount_msat_only(out, "fees_msat", ev->fees);
46 json_add_string(out, "currency", ev->currency);
47 if (ev->payment_id) {
48 json_add_sha256(out, "payment_id", ev->payment_id);
49 json_add_u32(out, "part_id", ev->part_id);
50 }
51 json_add_u64(out, "timestamp", ev->timestamp);
52 if (ev->desc)
53 json_add_string(out, "description", ev->desc);
54 json_add_bool(out, "is_rebalance", ev->rebalance_id != NULL);
55 json_object_end(out);
56}

Callers 1

json_list_account_eventsFunction · 0.85

Calls 9

amount_msat_zeroFunction · 0.85
json_object_startFunction · 0.50
json_add_stringFunction · 0.50
json_add_sha256Function · 0.50
json_add_u32Function · 0.50
json_add_u64Function · 0.50
json_add_boolFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected