routing: assert that paths have same length in isSamePath
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -75,6 +75,10 @@ func computeFee(amt btcutil.Amount, edge *ChannelHop) btcutil.Amount {
|
||||
// isSamePath returns true if path1 and path2 travel through the exact same
|
||||
// edges, and false otherwise.
|
||||
func isSamePath(path1, path2 []*ChannelHop) bool {
|
||||
if len(path1) != len(path2) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := 0; i < len(path1); i++ {
|
||||
if path1[i].ChannelID != path2[i].ChannelID {
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user