This commit is contained in:
M
2020-11-06 20:54:00 +02:00
parent 8a55d566c6
commit b17e7744c6
12 changed files with 273 additions and 197 deletions
+1
View File
@@ -52,5 +52,6 @@ class MoneroTransactionInfo extends TransactionInfo {
@override
String fiatAmount() => _fiatAmount ?? '';
@override
void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount);
}
+12 -3
View File
@@ -237,7 +237,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
void _setListeners() {
_listener?.stop();
_listener = monero_wallet.setListeners(_onNewBlock);
_listener = monero_wallet.setListeners(_onNewBlock, _onNewTransaction);
}
void _setInitialHeight() {
@@ -308,14 +308,23 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
}
void _onNewBlock(int height, int blocksLeft, double ptc) async {
_askForUpdateTransactionHistory();
if (walletInfo.isRecovery) {
_askForUpdateTransactionHistory();
}
_askForUpdateBalance();
if (blocksLeft < moneroBlockSize) {
if (blocksLeft < 100) {
syncStatus = SyncedSyncStatus();
await _afterSyncSave();
} else {
syncStatus = SyncingSyncStatus(blocksLeft, ptc);
}
}
void _onNewTransaction() {
_askForUpdateTransactionHistory();
_askForUpdateBalance();
_afterSyncSave();
}
}
@@ -10,6 +10,9 @@ class PendingMoneroTransaction with PendingTransaction {
final PendingTransactionDescription pendingTransactionDescription;
@override
String get id => pendingTransactionDescription.hash;
@override
String get amountFormatted => AmountConverter.amountIntToString(
CryptoCurrency.xmr, pendingTransactionDescription.amount);