From c27e87f1682d787ae65cb6337e9b26bd8faafc9f Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 30 Nov 2017 22:10:36 -0800 Subject: [PATCH] lnwallet: update UpdateFee msg usage to latest API changes --- lnwallet/channel.go | 5 +++-- lnwallet/channel_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 067e7375..2c3cfc89 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -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), }, }) } diff --git a/lnwallet/channel_test.go b/lnwallet/channel_test.go index b8b603dc..a53a7c15 100644 --- a/lnwallet/channel_test.go +++ b/lnwallet/channel_test.go @@ -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