mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-19 17:42:41 +02:00
routing: fix bug in channel capacity display by ensuring properly typed arithmetic
This commit fixes a slight bug in the storage of the capacity of a channel. Previously, we were subtracting a the hard coded fee amount without first casting the integer to a btcutil.Amount which results in a display/rounding error when the amount is converted to BTC.
This commit is contained in:
@ -593,7 +593,7 @@ func (r *ChannelRouter) processNetworkAnnouncement(msg lnwire.Message) bool {
|
|||||||
FeeProportionalMillionths: btcutil.Amount(msg.FeeProportionalMillionths),
|
FeeProportionalMillionths: btcutil.Amount(msg.FeeProportionalMillionths),
|
||||||
// TODO(roasbeef): this is a hack, needs to be removed
|
// TODO(roasbeef): this is a hack, needs to be removed
|
||||||
// after commitment fees are dynamic.
|
// after commitment fees are dynamic.
|
||||||
Capacity: btcutil.Amount(utxo.Value) - 5000,
|
Capacity: btcutil.Amount(utxo.Value) - btcutil.Amount(5000),
|
||||||
}
|
}
|
||||||
|
|
||||||
err = r.cfg.Graph.UpdateEdgeInfo(chanUpdate)
|
err = r.cfg.Graph.UpdateEdgeInfo(chanUpdate)
|
||||||
|
Reference in New Issue
Block a user