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:
Laura Cressman
2017-09-06 20:29:07 -04:00
committed by Olaoluwa Osuntokun
parent 29687f49eb
commit 156772d04a
3 changed files with 30 additions and 53 deletions

View File

@@ -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