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:
Olaoluwa Osuntokun committed 2016-09-12 19:08:01 -07:00
1 parent ff70b3afa9
commit 49ce1040d4
5 files changed
+69 -30

No files matched your search

+9 -3
View File
@@ -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{