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

Function penalty_base_new

common/penalty_base.c:7–21  ·  view source on GitHub ↗

txout must be within tx! */

Source from the content-addressed store, hash-verified

5
6/* txout must be within tx! */
7struct penalty_base *penalty_base_new(const tal_t *ctx,
8 u64 commitment_num,
9 const struct bitcoin_tx *tx,
10 const struct wally_tx_output *txout)
11{
12 struct penalty_base *pbase = tal(ctx, struct penalty_base);
13
14 pbase->commitment_num = commitment_num;
15 bitcoin_txid(tx, &pbase->txid);
16 pbase->outnum = txout - tx->wtx->outputs;
17 assert(pbase->outnum < tx->wtx->num_outputs);
18 pbase->amount = amount_sat(txout->satoshi);
19
20 return pbase;
21}
22
23void towire_penalty_base(u8 **pptr, const struct penalty_base *pbase)
24{

Callers 5

send_commitFunction · 0.85
fundee_channelFunction · 0.85
accepter_commitsFunction · 0.85
opener_commitsFunction · 0.85

Calls 2

bitcoin_txidClass · 0.70
amount_satFunction · 0.70

Tested by

no test coverage detected