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

Function json_add_onchain_fee

plugins/bkpr/onchain_fee.c:194–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void json_add_onchain_fee(struct json_stream *out,
195 const struct bkpr *bkpr,
196 const struct onchain_fee *fee)
197{
198 json_object_start(out, NULL);
199 json_add_string(out, "account", fee->acct_name);
200 json_add_string(out, "type", "onchain_fee");
201 json_add_string(out, "tag", "onchain_fee");
202 json_add_amount_msat(out, "credit_msat", fee->credit);
203 json_add_amount_msat(out, "debit_msat", fee->debit);
204 json_add_string(out, "currency", chainparams->lightning_hrp);
205 json_add_currencyrate(out, "currencyrate", bkpr, fee->timestamp);
206 json_add_u64(out, "timestamp", fee->timestamp);
207 json_add_txid(out, "txid", &fee->txid);
208 json_object_end(out);
209}
210
211/* Get all onchain_fee for this account */
212struct onchain_fee **account_get_chain_fees(const tal_t *ctx,

Callers 1

json_add_eventsFunction · 0.70

Calls 7

json_object_startFunction · 0.85
json_add_amount_msatFunction · 0.85
json_add_u64Function · 0.85
json_add_txidFunction · 0.85
json_object_endFunction · 0.85
json_add_currencyrateFunction · 0.70
json_add_stringFunction · 0.50

Tested by

no test coverage detected