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

fix: channel should be public by default #331

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Attempts to open a channel with a peer.

* `peer_id` - PeerId, The peer ID to open a channel with.
* `funding_amount` - u128, The amount of CKB or UDT to fund the channel with.
* `public` - `Option<bool>`, Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter (default value false).
* `public` - `Option<bool>`, Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter, default value is true.
* `funding_udt_type_script` - `Option<Script>`, The type script of the UDT to fund the channel with, an optional parameter.
* `shutdown_script` - `Option<Script>`, The script used to receive the channel balance, an optional parameter, default value is the secp256k1_blake160_sighash_all script corresponding to the configured private key.
* `commitment_delay_epoch` - `Option<EpochNumberWithFraction>`, The delay time for the commitment transaction, must be an [EpochNumberWithFraction](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0017-tx-valid-since/e-i-l-encoding.png) in u64 format, an optional parameter, default value is 24 hours.
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) struct OpenChannelParams {
#[serde_as(as = "U128Hex")]
funding_amount: u128,

/// Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter (default value false).
/// Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter, default value is true.
public: Option<bool>,

/// The type script of the UDT to fund the channel with, an optional parameter.
Expand Down Expand Up @@ -402,7 +402,7 @@ where
OpenChannelCommand {
peer_id: params.peer_id.clone(),
funding_amount: params.funding_amount,
public: params.public.unwrap_or(false),
public: params.public.unwrap_or(true),
shutdown_script: params.shutdown_script.clone().map(|s| s.into()),
commitment_delay_epoch: params
.commitment_delay_epoch
Expand Down
1 change: 0 additions & 1 deletion tests/bruno/e2e/router-pay/03-node1-node2-open-channel.bru
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ body:json {
{
"peer_id": "{{NODE2_PEERID}}",
"funding_amount": "0x377aab54d000",
"public": true,
"tlc_fee_proportional_millionths": "0x4B0"
}
]
Expand Down
1 change: 0 additions & 1 deletion tests/bruno/e2e/router-pay/07-node2-node3-open-channel.bru
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ body:json {
{
"peer_id": "{{NODE3_PEERID}}",
"funding_amount": "0x377aab54d000",
"public": true,
"tlc_fee_proportional_millionths": "0x578"
}
]
Expand Down
1 change: 0 additions & 1 deletion tests/bruno/e2e/router-pay/26-node2-node1-open-channel.bru
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ body:json {
{
"peer_id": "{{NODE1_PEERID}}",
"funding_amount": "0x277aab54d000",
"public": true,
"tlc_fee_proportional_millionths": "0x4B0"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ body:json {
{
"peer_id": "{{NODE2_PEERID}}",
"funding_amount": "0x3B9ACA00",
"public": true,
"tlc_fee_proportional_millionths": "0x4B0",
"funding_udt_type_script": {
"code_hash": "{{UDT_CODE_HASH}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ body:json {
{
"peer_id": "{{NODE3_PEERID}}",
"funding_amount": "0x3B9ACA00",
"public": true,
"funding_udt_type_script": {
"code_hash": "{{UDT_CODE_HASH}}",
"hash_type": "data1",
Expand Down
Loading