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

feat: auto accept channel #58

Merged
merged 2 commits into from
Jun 12, 2024
Merged

feat: auto accept channel #58

merged 2 commits into from
Jun 12, 2024

Conversation

quake
Copy link
Member

@quake quake commented Jun 11, 2024

No description provided.

@quake quake requested review from contrun and chenyukang June 11, 2024 04:27
Copy link
Collaborator

@contrun contrun left a comment

Choose a reason for hiding this comment

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

Generally LTGM. Just some nits.

name = "CKB_OPEN_CHANNEL_MIN_CKB_FUNDING_AMOUNT",
long = "ckb-open-channel-min-ckb-funding-amount",
env,
help = "minimum ckb funding amount for open channel requests, unit: shannons [default: 16100000000 shannons]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we define a constant for the default value 16100000000 so that we can keep various references to this value in sync?

Copy link
Member Author

Choose a reason for hiding this comment

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

let's do it in another PR

@@ -1061,6 +1061,11 @@ enum CommitmentSignedFlags {
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the purpose of this change?

to unify the json format of the output, for example:

"state": {
  "state_name": "SIGNING_COMMITMENT",
  "state_flags": "OUR_COMMITMENT_SIGNED_SENT | THEIR_COMMITMENT_SIGNED_SENT"
}


fn get_channel_states(&self, peer_id: Option<PeerId>) -> Vec<(PeerId, Hash256, ChannelState)> {
let prefix = match peer_id {
Some(peer_id) => [&[64], peer_id.as_bytes()].concat(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can use define a constant for the prefix 64 and refer to that constant instead of directly using the literal 64?

Copy link
Member Author

Choose a reason for hiding this comment

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

let's do it in another PR

@quake quake merged commit a739fdc into nervosnetwork:main Jun 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants