mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
routing: integrate forced MC import to the low/high plugin
This commit is contained in:
parent
9ace542056
commit
dc9bc9e976
3 changed files with 45 additions and 49 deletions
|
|
@ -52,7 +52,7 @@ func (r *mockRouter) QueryMissionControl(ctx context.Context) (
|
|||
// ImpotMissionControl is a mocked reimplementation of the pair import.
|
||||
// Reference: lnd/router/missioncontrol_state.go:importSnapshot().
|
||||
func (r *mockRouter) ImportMissionControl(ctx context.Context,
|
||||
entries []lndclient.MissionControlEntry) error {
|
||||
entries []lndclient.MissionControlEntry, force bool) error {
|
||||
|
||||
for _, entry := range entries {
|
||||
found := false
|
||||
|
|
@ -79,12 +79,14 @@ func (r *mockRouter) ImportMissionControl(ctx context.Context,
|
|||
|
||||
// Import success result second.
|
||||
current.SuccessTime = entry.SuccessTime
|
||||
if entry.SuccessAmt > current.SuccessAmt {
|
||||
if force ||
|
||||
entry.SuccessAmt > current.SuccessAmt {
|
||||
|
||||
current.SuccessAmt = entry.SuccessAmt
|
||||
}
|
||||
|
||||
if !current.FailTime.IsZero() &&
|
||||
entry.SuccessAmt >= current.FailAmt {
|
||||
if !force && (!current.FailTime.IsZero() &&
|
||||
entry.SuccessAmt >= current.FailAmt) {
|
||||
|
||||
current.FailAmt = entry.SuccessAmt + 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue