lnwallet: update UpdateFee msg usage to latest API changes

This commit is contained in:
Olaoluwa Osuntokun 2017-11-30 22:10:36 -08:00
parent 4bec706b11
commit c27e87f168
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
2 changed files with 5 additions and 4 deletions

@ -1671,7 +1671,8 @@ func (lc *LightningChannel) restoreStateLogs(
// entry within the updateLog, so we'll just apply it and move
// on.
if feeUpdate, ok := logUpdate.UpdateMsg.(*lnwire.UpdateFee); ok {
lc.pendingAckFeeUpdate = &feeUpdate.FeePerKw
newFeeRate := btcutil.Amount(feeUpdate.FeePerKw)
lc.pendingAckFeeUpdate = &newFeeRate
continue
}
@ -2827,7 +2828,7 @@ func (lc *LightningChannel) createCommitDiff(
logUpdates = append(logUpdates, channeldb.LogUpdate{
UpdateMsg: &lnwire.UpdateFee{
ChanID: chanID,
FeePerKw: *lc.pendingFeeUpdate,
FeePerKw: uint32(*lc.pendingFeeUpdate),
},
})
}

@ -3498,9 +3498,9 @@ func TestChannelRetransmissionFeeUpdate(t *testing.T) {
}
// The fee should match exactly the new fee update we applied above.
if retransFeeMsg.FeePerKw != newFeeRate {
if retransFeeMsg.FeePerKw != uint32(newFeeRate) {
t.Fatalf("fee update doesn't match: expected %v, got %v",
newFeeRate, retransFeeMsg)
uint32(newFeeRate), retransFeeMsg)
}
// The second, should be a CommitSig message, and be identical to the