mirror of
https://github.com/status-im/status-go.git
synced 2025-02-21 03:08:29 +00:00
fix_: clear leftover route execution data on new route calculation (#6132)
This commit is contained in:
parent
e477269983
commit
5a69c686cf
@ -482,12 +482,16 @@ func gweiToWei(val *big.Float) *big.Int {
|
||||
func (api *API) GetSuggestedRoutes(ctx context.Context, input *requests.RouteInputParams) (*router.SuggestedRoutes, error) {
|
||||
logutils.ZapLogger().Debug("call to GetSuggestedRoutes")
|
||||
|
||||
api.s.routeExecutionManager.ClearLocalRouteData()
|
||||
|
||||
return api.s.router.SuggestedRoutes(ctx, input)
|
||||
}
|
||||
|
||||
func (api *API) GetSuggestedRoutesAsync(ctx context.Context, input *requests.RouteInputParams) {
|
||||
logutils.ZapLogger().Debug("call to GetSuggestedRoutesAsync")
|
||||
|
||||
api.s.routeExecutionManager.ClearLocalRouteData()
|
||||
|
||||
api.s.router.SuggestedRoutesAsync(input)
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ func NewManager(walletDB *sql.DB, eventFeed *event.Feed, router *router.Router,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Manager) clearLocalRouteData() {
|
||||
func (m *Manager) ClearLocalRouteData() {
|
||||
m.buildInputParams = nil
|
||||
m.transactionManager.ClearLocalRouterTransactionsData()
|
||||
}
|
||||
@ -72,7 +72,7 @@ func (m *Manager) BuildTransactionsFromRoute(ctx context.Context, buildInputPara
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
m.clearLocalRouteData()
|
||||
m.ClearLocalRouteData()
|
||||
err = statusErrors.CreateErrorResponseFromError(err)
|
||||
response.SendDetails.ErrorResponse = err.(*statusErrors.ErrorResponse)
|
||||
}
|
||||
@ -134,7 +134,7 @@ func (m *Manager) SendRouterTransactionsWithSignatures(ctx context.Context, send
|
||||
}
|
||||
|
||||
if clearLocalData {
|
||||
m.clearLocalRouteData()
|
||||
m.ClearLocalRouteData()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user