htlcswitch: use an atomic load for link bandwidth during local dispatch

This commit is contained in:
Olaoluwa Osuntokun 2017-01-07 20:15:17 -08:00
parent a89de14c69
commit 60914029da
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

View File

@ -256,7 +256,7 @@ out:
// * avoid full channel depletion at higher
// level (here) instead of within state
// machine?
if link.availableBandwidth < int64(amt) {
if atomic.LoadInt64(&link.availableBandwidth) < int64(amt) {
continue
}