mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 09:23:09 +02:00
channeldb: use binary.Read/Write with bools in channel.go
Use binary.Read/Write in functions to serialize and deserialize channel close summary and HTLC boolean data, as well as in methods to put and fetch channel funding info. Remove lnd implementations of readBool and writeBool as they are no longer needed. Also fix a few minor typos.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
29687f49eb
commit
156772d04a
@@ -892,13 +892,13 @@ func (r *ChannelRouter) FindRoutes(target *btcec.PublicKey,
|
||||
}
|
||||
|
||||
// Finally, we'll sort the set of validate routes to optimize for
|
||||
// lowest total fees, using the required time-lock within the route as
|
||||
// a tie-breaker.
|
||||
// lowest total fees, using the required time-lock within the
|
||||
// route as a tie-breaker.
|
||||
sort.Slice(validRoutes, func(i, j int) bool {
|
||||
// To make this decision we first check if the total fees
|
||||
// required for both routes are equal. If so, then we'll let the total time
|
||||
// lock be the tie breaker. Otherwise, we'll put the route with the lowest
|
||||
// total fees first.
|
||||
// required for both routes are equal. If so, then we'll let
|
||||
// the total time lock be the tie breaker. Otherwise, we'll
|
||||
// put the route with the lowest total fees first.
|
||||
if validRoutes[i].TotalFees == validRoutes[j].TotalFees {
|
||||
timeLockI := validRoutes[i].TotalTimeLock
|
||||
timeLockJ := validRoutes[j].TotalTimeLock
|
||||
|
Reference in New Issue
Block a user