@@ -47,7 +47,7 @@ struct channel *new_full_channel(const tal_t *ctx,
4747 const struct pubkey * local_funding_pubkey ,
4848 const struct pubkey * remote_funding_pubkey ,
4949 bool option_static_remotekey ,
50- enum side funder )
50+ enum side opener )
5151{
5252 struct channel * channel = new_initial_channel (ctx ,
5353 chain_hash ,
@@ -63,7 +63,7 @@ struct channel *new_full_channel(const tal_t *ctx,
6363 local_funding_pubkey ,
6464 remote_funding_pubkey ,
6565 option_static_remotekey ,
66- funder );
66+ opener );
6767
6868 if (channel ) {
6969 /* Feerates can be different. */
@@ -283,7 +283,7 @@ struct bitcoin_tx **channel_txs(const tal_t *ctx,
283283 txs = tal_arr (ctx , struct bitcoin_tx * , 1 );
284284 txs [0 ] = commit_tx (
285285 ctx , chainparams , & channel -> funding_txid , channel -> funding_txout ,
286- channel -> funding , channel -> funder ,
286+ channel -> funding , channel -> opener ,
287287 channel -> config [!side ].to_self_delay , & keyset ,
288288 channel -> view [side ].feerate_per_kw ,
289289 channel -> config [side ].dust_limit , channel -> view [side ].owed [side ],
@@ -459,7 +459,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
459459 */
460460 /* Also we should not add more htlc's than sender or recipient
461461 * configured. This mitigates attacks in which a peer can force the
462- * funder of the channel to pay unnecessary onchain fees during a fee
462+ * opener of the channel to pay unnecessary onchain fees during a fee
463463 * spike with large commitment transactions.
464464 */
465465 min_concurrent_htlcs = channel -> config [recipient ].max_accepted_htlcs ;
@@ -533,7 +533,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
533533 & balance ))
534534 return CHANNEL_ERR_CHANNEL_CAPACITY_EXCEEDED ;
535535
536- if (channel -> funder == sender ) {
536+ if (channel -> opener == sender ) {
537537 if (amount_msat_less_sat (balance , fee )) {
538538 status_debug ("Cannot afford fee %s with %s above reserve" ,
539539 type_to_string (tmpctx , struct amount_sat ,
@@ -544,12 +544,12 @@ static enum channel_add_err add_htlc(struct channel *channel,
544544 }
545545 }
546546
547- /* Try not to add a payment which will take funder into fees
547+ /* Try not to add a payment which will take opener into fees
548548 * on either our side or theirs. */
549549 if (sender == LOCAL ) {
550550 if (!get_room_above_reserve (channel , view ,
551551 adding , removing ,
552- channel -> funder ,
552+ channel -> opener ,
553553 & balance ))
554554 return CHANNEL_ERR_CHANNEL_CAPACITY_EXCEEDED ;
555555 /* Should be able to afford both their own commit tx
@@ -559,7 +559,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
559559 committed ,
560560 adding ,
561561 removing ,
562- channel -> funder );
562+ channel -> opener );
563563 /* set fee output pointer if given */
564564 if (htlc_fee && amount_sat_greater (fee , * htlc_fee ))
565565 * htlc_fee = fee ;
@@ -577,7 +577,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
577577 committed ,
578578 adding ,
579579 removing ,
580- !channel -> funder );
580+ !channel -> opener );
581581 /* set fee output pointer if given */
582582 if (htlc_fee && amount_sat_greater (fee , * htlc_fee ))
583583 * htlc_fee = fee ;
@@ -873,7 +873,7 @@ u32 approx_max_feerate(const struct channel *channel)
873873 struct amount_sat avail ;
874874 const struct htlc * * committed , * * adding , * * removing ;
875875
876- gather_htlcs (tmpctx , channel , !channel -> funder ,
876+ gather_htlcs (tmpctx , channel , !channel -> opener ,
877877 & committed , & removing , & adding );
878878
879879 /* Assume none are trimmed; this gives lower bound on feerate. */
@@ -883,28 +883,28 @@ u32 approx_max_feerate(const struct channel *channel)
883883
884884 /* We should never go below reserve. */
885885 if (!amount_sat_sub (& avail ,
886- amount_msat_to_sat_round_down (channel -> view [!channel -> funder ].owed [channel -> funder ]),
887- channel -> config [!channel -> funder ].channel_reserve ))
886+ amount_msat_to_sat_round_down (channel -> view [!channel -> opener ].owed [channel -> opener ]),
887+ channel -> config [!channel -> opener ].channel_reserve ))
888888 avail = AMOUNT_SAT (0 );
889889
890890 return avail .satoshis / weight * 1000 ; /* Raw: once-off reverse feerate*/
891891}
892892
893- bool can_funder_afford_feerate (const struct channel * channel , u32 feerate_per_kw )
893+ bool can_opener_afford_feerate (const struct channel * channel , u32 feerate_per_kw )
894894{
895895 struct amount_sat needed , fee ;
896- struct amount_sat dust_limit = channel -> config [!channel -> funder ].dust_limit ;
896+ struct amount_sat dust_limit = channel -> config [!channel -> opener ].dust_limit ;
897897 size_t untrimmed ;
898898 const struct htlc * * committed , * * adding , * * removing ;
899- gather_htlcs (tmpctx , channel , !channel -> funder ,
899+ gather_htlcs (tmpctx , channel , !channel -> opener ,
900900 & committed , & removing , & adding );
901901
902902 untrimmed = commit_tx_num_untrimmed (committed , feerate_per_kw , dust_limit ,
903- !channel -> funder )
903+ !channel -> opener )
904904 + commit_tx_num_untrimmed (adding , feerate_per_kw , dust_limit ,
905- !channel -> funder )
905+ !channel -> opener )
906906 - commit_tx_num_untrimmed (removing , feerate_per_kw , dust_limit ,
907- !channel -> funder );
907+ !channel -> opener );
908908
909909 fee = commit_tx_base_fee (feerate_per_kw , untrimmed );
910910
@@ -914,39 +914,39 @@ bool can_funder_afford_feerate(const struct channel *channel, u32 feerate_per_kw
914914 * node's current commitment transaction:
915915 * - SHOULD fail the channel
916916 */
917- /* Note: sender == funder */
917+ /* Note: sender == opener */
918918
919919 /* How much does it think it has? Must be >= reserve + fee */
920920 if (!amount_sat_add (& needed , fee ,
921- channel -> config [!channel -> funder ].channel_reserve ))
921+ channel -> config [!channel -> opener ].channel_reserve ))
922922 status_failed (STATUS_FAIL_INTERNAL_ERROR ,
923923 "Cannot add fee %s and reserve %s" ,
924924 type_to_string (tmpctx , struct amount_sat ,
925925 & fee ),
926926 type_to_string (tmpctx , struct amount_sat ,
927- & channel -> config [!channel -> funder ].channel_reserve ));
927+ & channel -> config [!channel -> opener ].channel_reserve ));
928928
929929 status_debug ("We need %s at feerate %u for %zu untrimmed htlcs: we have %s/%s" ,
930930 type_to_string (tmpctx , struct amount_sat , & needed ),
931931 feerate_per_kw , untrimmed ,
932932 type_to_string (tmpctx , struct amount_msat ,
933- & channel -> view [LOCAL ].owed [channel -> funder ]),
933+ & channel -> view [LOCAL ].owed [channel -> opener ]),
934934 type_to_string (tmpctx , struct amount_msat ,
935- & channel -> view [REMOTE ].owed [channel -> funder ]));
936- return amount_msat_greater_eq_sat (channel -> view [!channel -> funder ].owed [channel -> funder ],
935+ & channel -> view [REMOTE ].owed [channel -> opener ]));
936+ return amount_msat_greater_eq_sat (channel -> view [!channel -> opener ].owed [channel -> opener ],
937937 needed );
938938}
939939
940940bool channel_update_feerate (struct channel * channel , u32 feerate_per_kw )
941941{
942- if (!can_funder_afford_feerate (channel , feerate_per_kw ))
942+ if (!can_opener_afford_feerate (channel , feerate_per_kw ))
943943 return false;
944944
945945 status_debug ("Setting %s feerate to %u" ,
946- side_to_str (!channel -> funder ), feerate_per_kw );
946+ side_to_str (!channel -> opener ), feerate_per_kw );
947947
948- channel -> view [!channel -> funder ].feerate_per_kw = feerate_per_kw ;
949- channel -> changes_pending [!channel -> funder ] = true;
948+ channel -> view [!channel -> opener ].feerate_per_kw = feerate_per_kw ;
949+ channel -> changes_pending [!channel -> opener ] = true;
950950 return true;
951951}
952952
@@ -994,8 +994,8 @@ bool channel_rcvd_revoke_and_ack(struct channel *channel,
994994 if (change & HTLC_LOCAL_F_PENDING )
995995 channel -> changes_pending [LOCAL ] = true;
996996
997- /* For funder , ack also means time to apply new feerate locally. */
998- if (channel -> funder == LOCAL &&
997+ /* For opener , ack also means time to apply new feerate locally. */
998+ if (channel -> opener == LOCAL &&
999999 (channel -> view [LOCAL ].feerate_per_kw
10001000 != channel -> view [REMOTE ].feerate_per_kw )) {
10011001 status_debug ("Applying feerate %u to LOCAL" ,
@@ -1045,8 +1045,8 @@ bool channel_sending_revoke_and_ack(struct channel *channel)
10451045 if (change & HTLC_REMOTE_F_PENDING )
10461046 channel -> changes_pending [REMOTE ] = true;
10471047
1048- /* For non-funder , sending ack means we apply any fund changes to them */
1049- if (channel -> funder == REMOTE
1048+ /* For non-opener , sending ack means we apply any fund changes to them */
1049+ if (channel -> opener == REMOTE
10501050 && (channel -> view [LOCAL ].feerate_per_kw
10511051 != channel -> view [REMOTE ].feerate_per_kw )) {
10521052 status_debug ("Applying feerate %u to REMOTE" ,
0 commit comments