multi: update to latest fee estimation interface

This commit is contained in:
Wilmer Paulino committed 2018-08-09 17:29:52 -07:00
1 parent a63677a381
commit 9d2eeb6304
21 files changed
+150 -204

No files matched your search

+2 -7
View File
@@ -1658,18 +1658,13 @@ func (p *peer) fetchActiveChanCloser(chanID lnwire.ChannelID) (*channelCloser, e
// In order to begin fee negotiations, we'll first compute our
// target ideal fee-per-kw. We'll set this to a lax value, as
// we weren't the ones that initiated the channel closure.
feePerVSize, err := p.server.cc.feeEstimator.EstimateFeePerVSize(6)
feePerKw, err := p.server.cc.feeEstimator.EstimateFeePerKW(6)
if err != nil {
peerLog.Errorf("unable to query fee estimator: %v", err)
return nil, fmt.Errorf("unable to estimate fee")
}
// We'll then convert the sat per weight to sat per k/w as this
// is the native unit used within the protocol when dealing
// with fees.
targetFeePerKw := feePerVSize.FeePerKWeight()
_, startingHeight, err := p.server.cc.chainIO.GetBestBlock()
if err != nil {
peerLog.Errorf("unable to obtain best block: %v", err)
@@ -1685,7 +1680,7 @@ func (p *peer) fetchActiveChanCloser(chanID lnwire.ChannelID) (*channelCloser, e
quit: p.quit,
},
deliveryAddr,
targetFeePerKw,
feePerKw,
uint32(startingHeight),
nil,
)