-
Notifications
You must be signed in to change notification settings - Fork 11
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 amount and fee issues #69
Fix channel amount and fee issues #69
Conversation
e1147ad
to
5b09c5a
Compare
dfd194f
to
4970fcd
Compare
5c916cf
to
5de7bb2
Compare
5de7bb2
to
9b35102
Compare
d88bb40
to
7ad3984
Compare
8bb4b54
to
b39b2de
Compare
@@ -180,6 +181,7 @@ pub enum NetworkActorEvent { | |||
Option<Script>, | |||
u64, | |||
u64, | |||
u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To refactor later
b39b2de
to
3ca56d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed
// The commitment fee rate is used to calculate the fee for the commitment transactions. | ||
// The side who starting a shutdown command need to pay at least this fee for building shutdown transaction, | ||
// the other side may choose to pay less fee rate if the current fee is enough. | ||
pub commitment_fee_rate: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name commitment_fee_rate
and the comment is not consistent. Why is commitment_fee_rate
named commitment_fee_rate
although it is used only in the shutdown transaction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commitment_fee_rate
will also be used in commitment transaction (I will add it later, I haven't determined which party pay the fee or both parties pay the fee), we treat shutdown transaction is a special commitment transaction.
4addac3
to
00a0657
Compare
00a0657
to
f278ccb
Compare
fa5c985
to
6327598
Compare
6327598
to
eb43c8b
Compare
@@ -152,11 +129,17 @@ impl TxBuilder for FundingTxBuilder { | |||
None => packed::Transaction::default().as_advanced_builder(), | |||
}; | |||
|
|||
// set a placeholder_witness for calculating transaction fee according to transaction size | |||
let placeholder_witness = packed::WitnessArgs::new_builder() | |||
.lock(Some(molecule::bytes::Bytes::from(vec![0u8; 170])).pack()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this hard-coded 170 come about?
91fff7d
to
e3ce52f
Compare
This PR contains several changes:
ckb
amount andfee
related fields fromu128
tou64
commitment_fee_rate
in open channel rpcfee_rate
instead of fee in the shutdown command, and verify shutdown fee is valid when handing shutdown commandlocal_reserve_ckb_amount
andremote_reserve_ckb_amount
to make sure we can always build valid commitment tx or shutdown tx.funding_fee_rate
option to specify and calculate the fee in funding transaction.