mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-09 20:53:29 +01:00
Height/syncing fixes
This commit is contained in:
parent
269b910aaf
commit
911c813a7e
@ -980,7 +980,7 @@ Java_net_mynero_wallet_model_Wallet_isWatchOnly(JNIEnv *env, jobject instance) {
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_net_mynero_wallet_model_Wallet_getBlockChainHeight(JNIEnv *env, jobject instance) {
|
||||
Java_net_mynero_wallet_model_Wallet_getBlockChainHeightJ(JNIEnv *env, jobject instance) {
|
||||
Monero::Wallet *wallet = getHandle<Monero::Wallet>(env, instance);
|
||||
return wallet->blockChainHeight();
|
||||
}
|
||||
@ -993,7 +993,7 @@ Java_net_mynero_wallet_model_Wallet_getApproximateBlockChainHeight(JNIEnv *env,
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_net_mynero_wallet_model_Wallet_getDaemonBlockChainHeight(JNIEnv *env, jobject instance) {
|
||||
Java_net_mynero_wallet_model_Wallet_getDaemonBlockChainHeightJ(JNIEnv *env, jobject instance) {
|
||||
Monero::Wallet *wallet = getHandle<Monero::Wallet>(env, instance);
|
||||
return wallet->daemonBlockChainHeight();
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ class HomeFragment : Fragment(), TxInfoAdapterListener {
|
||||
} else {
|
||||
progressBar.visibility = View.INVISIBLE
|
||||
progressBarText.visibility = View.VISIBLE
|
||||
progressBarText.text = "Synchronized"
|
||||
progressBarText.text = "Synchronized at $height"
|
||||
}
|
||||
}
|
||||
val adapter = TransactionInfoAdapter(this)
|
||||
|
@ -234,9 +234,15 @@ class Wallet {
|
||||
|
||||
external fun getUnlockedBalance(accountIndex: Int): Long
|
||||
external fun isWatchOnly(): Boolean
|
||||
external fun getBlockChainHeight(): Long
|
||||
fun getBlockChainHeight(): Long {
|
||||
return getBlockChainHeightJ().minus(1)
|
||||
}
|
||||
private external fun getBlockChainHeightJ(): Long
|
||||
external fun getApproximateBlockChainHeight(): Long
|
||||
external fun getDaemonBlockChainHeight(): Long
|
||||
fun getDaemonBlockChainHeight(): Long {
|
||||
return getDaemonBlockChainHeightJ().minus(1)
|
||||
}
|
||||
private external fun getDaemonBlockChainHeightJ(): Long
|
||||
external fun getDaemonBlockChainTargetHeight(): Long
|
||||
|
||||
fun setSynchronized() {
|
||||
|
@ -75,7 +75,7 @@ class MoneroHandlerThread(name: String, val listener: Listener?, wallet: Wallet)
|
||||
override fun unconfirmedMoneyReceived(txId: String?, amount: Long) {}
|
||||
override fun newBlock(height: Long) {
|
||||
refresh(false)
|
||||
BlockchainService.instance?.daemonHeight = if (wallet.isSynchronized) height else 0
|
||||
BlockchainService.instance?.daemonHeight = if (wallet.isSynchronized) height else 0 // when 0 it fetches from C++
|
||||
}
|
||||
|
||||
override fun updated() {
|
||||
|
Loading…
Reference in New Issue
Block a user