Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split prefunded Channel into Inbound/Outbound channels #2077

Merged
merged 25 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
883afb3
Move `Channel` fields into `ChannelContext` struct
dunxen Mar 7, 2023
1503ebb
Move `Channel::opt_anchors` to `ChannelContext` impl & move some util…
dunxen Jun 7, 2023
1ee0a66
Move `Channel::get_update_time_counter` and some other methods
dunxen Jun 7, 2023
ede8324
Move `Channel::channel_id` and some other methods to `ChannelContext`…
dunxen Jun 7, 2023
497aeb0
Move `Channel::build_commitment_transaction` to `ChannelContext` impl
dunxen Jun 7, 2023
0d739ee
Move `Channel::build_holder_transaction_keys` and some other methods
dunxen Jun 7, 2023
3ff94fa
Move `Channel::get_feerate_sat_per_1000_weight` and other methods
dunxen Jun 7, 2023
2774aa2
Prepare some methods for upcoming moves to `ChannelContext`
dunxen Jun 13, 2023
ed6a5bb
Move `Channel::get_*_pending_htlc_stats` to `ChannelContext` impl
dunxen Jun 13, 2023
08ee72b
Move `Channel::commit_tx_fee_msat` to file-level utilities
dunxen Jun 13, 2023
9f4e714
Move `Channel::next_*_commit_tx_fee_msat` methods to `ChannelContext`…
dunxen Jun 13, 2023
60706d6
Move `Channel::get_available_balances` to `ChannelContext` impl
dunxen Jun 13, 2023
25c1ad8
Convert `ChannelDetails::from_channel` to `ChannelDetails::from_chann…
dunxen Jun 7, 2023
e3f0c55
Make `ChannelManager::issue_channel_close_events` take a `ChannelCont…
dunxen Jun 13, 2023
1012526
Move channel constants up
dunxen Mar 30, 2023
883e056
Introduce `InboundV1Channel` & `OutboundV1Channel`
dunxen Apr 5, 2023
e6c2f04
Move outbound channel constructor into `OutboundV1Channel` impl
dunxen Jun 7, 2023
baadeb7
Move inbound channel constructor into `InboundV1Channel` impl
dunxen Jun 7, 2023
2ea27e0
Move `Channel::force_shutdown` to `ChannelContext` impl
dunxen Jun 13, 2023
4ad67cf
Refactor channel map update macros for use with `ChannelContext`
dunxen Jun 7, 2023
4b1e286
Create and use methods for counting channels
dunxen Jun 7, 2023
4a0cd5c
Move outbound channel methods into `OutboundV1Channel`'s impl
dunxen Jun 7, 2023
637e03a
Move inbound channel methods into `InboundV1Channel`'s impl
dunxen Jun 7, 2023
8f93e2d
Rename `InboundV1Channel::new_from_req` to `InboundV1Channel::new`
dunxen Jun 7, 2023
d957f36
Rename `inbound_is_awaiting_accept()` to `is_awaiting_accept()`
dunxen Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6265,7 +6265,7 @@ impl<Signer: WriteableEcdsaChannelSigner> InboundV1Channel<Signer> {
Ok(chan)
}

pub fn inbound_is_awaiting_accept(&self) -> bool {
pub fn is_awaiting_accept(&self) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also rename get_funding_outbound_created.

self.context.inbound_awaiting_accept
}

Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4886,7 +4886,7 @@ where
let is_only_peer_channel = peer_state.total_channel_count() == 1;
match peer_state.inbound_v1_channel_by_id.entry(temporary_channel_id.clone()) {
hash_map::Entry::Occupied(mut channel) => {
if !channel.get().inbound_is_awaiting_accept() {
if !channel.get().is_awaiting_accept() {
return Err(APIError::APIMisuseError { err: "The channel isn't currently awaiting to be accepted.".to_owned() });
}
if accept_0conf {
Expand Down