0571918d3d
This commit adds synchronization around the processing of multiple ChannelEdgePolicy updates for the same channel ID at the same time. This fixes a bug that could cause the database access HasChannelEdge to be out of date when the goroutine came to the point where it was calling UpdateEdgePolicy. This happened because a second goroutine would have called UpdateEdgePolicy in the meantime. This bug was quite benign, as if this happened at runtime, we would eventually get the ChannelEdgePolicy we had lost again, either from a peer sending it to us, or if we would fail a payment since we were using outdated information. However, it would cause some of the tests to flake, since losing routing information made payments we expected to go through fail if this happened. This is fixed by introducing a new mutex type, that when locking and unlocking takes an additional (id uint64) parameter, keeping an internal map tracking what ID's are currently locked and the count of goroutines waiting for the mutex. This ensure we can still process updates concurrently, only avoiding updates with the same channel ID from being run concurrently. |
||
---|---|---|
.. | ||
chainview | ||
testdata | ||
errors.go | ||
graph.go | ||
heap_test.go | ||
heap.go | ||
log.go | ||
missioncontrol.go | ||
notifications_test.go | ||
notifications.go | ||
pathfind_test.go | ||
pathfind.go | ||
README.md | ||
router_test.go | ||
router.go | ||
validation_barrier.go |
routing
The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/routing