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:
parent
dd42fa2f70
commit
8fd4d7ea6b
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user