Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-11 20:05:44 +03:00
parent bccc192c87
commit 7a4292f489
2 changed files with 11 additions and 13 deletions

View file

@ -22,15 +22,13 @@ import java.util.List;
import java.util.Random;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.observers.DefaultObserver;
import io.reactivex.schedulers.Schedulers;
public class ServerApiHelperElectrum {
private static String TAG = ServerApiHelper.class.getSimpleName();
// private static String TAG = ServerApiHelper.class.getSimpleName();
private static String TAG = ServerApiHelperElectrum.class.getSimpleName();
/**
* TCP
@ -67,13 +65,13 @@ public class ServerApiHelperElectrum {
.filter(throwable -> throwable instanceof NullPointerException)
.zipWith(Observable.range(1, 2), (n, i) -> i))
.retryWhen(errors -> errors
.filter(throwable -> throwable instanceof Exception)
.zipWith(Observable.range(1, 2), (n, i) -> i))
.retryWhen(errors -> errors
.filter(throwable -> throwable instanceof ConnectException)
.zipWith(Observable.range(1, 2), (n, i) -> i))
// .retryWhen(errors -> errors
// .filter(throwable -> throwable instanceof Exception)
// .zipWith(Observable.range(1, 2), (n, i) -> i))
//
// .retryWhen(errors -> errors
// .filter(throwable -> throwable instanceof ConnectException)
// .zipWith(Observable.range(1, 2), (n, i) -> i))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());

View file

@ -265,7 +265,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
val height = jsUnspent.getInt("height")
val hash = jsUnspent.getString("tx_hash")
if (height != -1) {
requestElectrum(card!!, ElectrumRequest.getTransaction(walletAddress, hash))
// requestElectrum(card!!, ElectrumRequest.getTransaction(walletAddress, hash))
}
}
} catch (e: JSONException) {
@ -869,7 +869,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
card!!.setIsBalanceEqual(true)
requestElectrum(card!!, ElectrumRequest.checkBalance(card!!.wallet))
requestElectrum(card!!, ElectrumRequest.listUnspent(card!!.wallet))
// requestElectrum(card!!, ElectrumRequest.listUnspent(card!!.wallet))
requestRateInfo("bitcoin")
}