mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 03:29:36 +00:00
CW-826 Fix missing tx keys in monero (#1828)
Some checks are pending
Cache Dependencies / test (push) Waiting to run
Some checks are pending
Cache Dependencies / test (push) Waiting to run
* CW-826 Fix missing tx keys in monero * force store wallet * don't return error string
This commit is contained in:
parent
09bc186fea
commit
738731d3e5
3 changed files with 7 additions and 13 deletions
|
@ -17,7 +17,7 @@ String getTxKey(String txId) {
|
|||
final status = monero.Wallet_status(wptr!);
|
||||
if (status != 0) {
|
||||
final error = monero.Wallet_errorString(wptr!);
|
||||
return txId+"_"+error;
|
||||
return "";
|
||||
}
|
||||
return txKey;
|
||||
}
|
||||
|
@ -364,16 +364,7 @@ class Transaction {
|
|||
confirmations = monero.TransactionInfo_confirmations(txInfo),
|
||||
fee = monero.TransactionInfo_fee(txInfo),
|
||||
description = monero.TransactionInfo_description(txInfo),
|
||||
key = getTxKey(txInfo);
|
||||
|
||||
static String getTxKey(monero.TransactionInfo txInfo) {
|
||||
final txKey = monero.Wallet_getTxKey(wptr!, txid: monero.TransactionInfo_hash(txInfo));
|
||||
final status = monero.Wallet_status(wptr!);
|
||||
if (status != 0) {
|
||||
return "";
|
||||
}
|
||||
return txKey;
|
||||
}
|
||||
key = getTxKey(monero.TransactionInfo_hash(txInfo));
|
||||
|
||||
Transaction.dummy({
|
||||
required this.displayLabel,
|
||||
|
|
|
@ -150,14 +150,15 @@ final storeMutex = Mutex();
|
|||
|
||||
int lastStorePointer = 0;
|
||||
int lastStoreHeight = 0;
|
||||
void storeSync() async {
|
||||
void storeSync({bool force = false}) async {
|
||||
final addr = wptr!.address;
|
||||
final synchronized = await Isolate.run(() {
|
||||
return monero.Wallet_synchronized(Pointer.fromAddress(addr));
|
||||
});
|
||||
if (lastStorePointer == wptr!.address &&
|
||||
lastStoreHeight + 5000 > monero.Wallet_blockChainHeight(wptr!) &&
|
||||
!synchronized) {
|
||||
!synchronized &&
|
||||
!force) {
|
||||
return;
|
||||
}
|
||||
lastStorePointer = wptr!.address;
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:cw_core/crypto_currency.dart';
|
|||
import 'package:cw_core/amount_converter.dart';
|
||||
|
||||
import 'package:cw_core/pending_transaction.dart';
|
||||
import 'package:cw_monero/api/wallet.dart';
|
||||
|
||||
class DoubleSpendException implements Exception {
|
||||
DoubleSpendException();
|
||||
|
@ -53,6 +54,7 @@ class PendingMoneroTransaction with PendingTransaction {
|
|||
|
||||
rethrow;
|
||||
}
|
||||
storeSync(force: true);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue