lnd+lnwallet: make capacity check stricter by adding fee
Also patches breacharbiter tests by using the correct commitment fee and balances.
This commit is contained in:
2 files changed
+8
-6
No files matched your search
@@ -589,11 +589,11 @@ func (cb *CommitmentBuilder) createUnsignedCommitmentTx(ourBalance,
|
||||
for _, txOut := range commitTx.TxOut {
|
||||
totalOut += btcutil.Amount(txOut.Value)
|
||||
}
|
||||
if totalOut > cb.chanState.Capacity {
|
||||
if totalOut+commitFee > cb.chanState.Capacity {
|
||||
return nil, fmt.Errorf("height=%v, for ChannelPoint(%v) "+
|
||||
"attempts to consume %v while channel capacity is %v",
|
||||
height, cb.chanState.FundingOutpoint,
|
||||
totalOut, cb.chanState.Capacity)
|
||||
totalOut+commitFee, cb.chanState.Capacity)
|
||||
}
|
||||
|
||||
return &unsignedCommitmentTx{
|
||||
|
||||
Reference in new issue
Block a user