From af6ca702764b005aecac4e8275f2d34cf34c5a57 Mon Sep 17 00:00:00 2001 From: Terry Mancey Date: Wed, 8 Jan 2020 23:30:32 +0000 Subject: [PATCH] Fixes unable to get ad tokens if tokens are not ready --- .../src/bat/confirmations/internal/refill_tokens.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vendor/bat-native-confirmations/src/bat/confirmations/internal/refill_tokens.cc b/vendor/bat-native-confirmations/src/bat/confirmations/internal/refill_tokens.cc index 581aea92c092..610ed927bf8e 100644 --- a/vendor/bat-native-confirmations/src/bat/confirmations/internal/refill_tokens.cc +++ b/vendor/bat-native-confirmations/src/bat/confirmations/internal/refill_tokens.cc @@ -307,11 +307,6 @@ void RefillTokens::OnGetSignedTokens( void RefillTokens::OnRefill( const Result result, const bool should_retry) { - blinded_tokens_.clear(); - tokens_.clear(); - - confirmations_->SaveState(); - if (result != SUCCESS) { BLOG(ERROR) << "Failed to refill tokens"; @@ -323,6 +318,10 @@ void RefillTokens::OnRefill( return; } + blinded_tokens_.clear(); + tokens_.clear(); + confirmations_->SaveState(); + BLOG(INFO) << "Successfully refilled tokens"; }