lnwallet: adopt simple fee structure for commitment transactions
This commit modifies the prior funding workflow to account for fees when creating the funding output. As a stop gap, the current fee for the commitment transaction is now hard-coded at 5k satoshis. Once the fee models are in place this should instead be some high multiple of the current “average” fee rate within the network, continuing, the proper fee should be adjusted from the commitment transaction has outputs are added/removed.
This commit is contained in:
5 files changed
+69
-30
No files matched your search
@@ -141,10 +141,16 @@ func NewChannelReservation(capacity, fundingAmt btcutil.Amount, minFeeRate btcut
|
||||
|
||||
if fundingAmt == 0 {
|
||||
ourBalance = 0
|
||||
theirBalance = capacity
|
||||
theirBalance = capacity - commitFee
|
||||
} else {
|
||||
ourBalance = fundingAmt
|
||||
theirBalance = capacity - fundingAmt
|
||||
// TODO(roasbeef): need to rework fee structure in general and
|
||||
// also when we "unlock" dual funder within the daemon
|
||||
if capacity == fundingAmt+commitFee { // Single funder
|
||||
ourBalance = capacity - commitFee
|
||||
} else {
|
||||
ourBalance = fundingAmt - commitFee
|
||||
}
|
||||
theirBalance = capacity - fundingAmt - commitFee
|
||||
}
|
||||
|
||||
return &ChannelReservation{
|
||||
|
||||
Reference in new issue
Block a user