paychmgr: erlier checks in completeAmount
This commit is contained in:
parent
36a1934845
commit
da5ae1efe1
@ -179,6 +179,11 @@ func (m *mergedFundsReq) completeAmount(avail types.BigInt, channelInfo *Channel
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't try to fill inactive requests
|
||||||
|
if !r.isActive() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if r.amt.GreaterThan(types.BigSub(avail, used)) {
|
if r.amt.GreaterThan(types.BigSub(avail, used)) {
|
||||||
// requests are sorted by amount ascending, so if we hit this, there aren't any more requests we can fill
|
// requests are sorted by amount ascending, so if we hit this, there aren't any more requests we can fill
|
||||||
|
|
||||||
@ -198,11 +203,6 @@ func (m *mergedFundsReq) completeAmount(avail types.BigInt, channelInfo *Channel
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't try to fill inactive requests
|
|
||||||
if !r.isActive() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
used = types.BigAdd(used, r.amt)
|
used = types.BigAdd(used, r.amt)
|
||||||
r.onComplete(&paychFundsRes{channel: *channelInfo.Channel})
|
r.onComplete(&paychFundsRes{channel: *channelInfo.Channel})
|
||||||
next = i + 1
|
next = i + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user