mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
Merge pull request #693 from cake-tech/CW-250-Bitcoin-errors-where-transactions-do-not-appear
[CW-250] fix disappearance of pending transaction
This commit is contained in:
commit
c84bf8a6b7
2 changed files with 3 additions and 7 deletions
|
@ -72,7 +72,7 @@ abstract class ElectrumTransactionHistoryBase
|
|||
txs.entries.forEach((entry) {
|
||||
final val = entry.value;
|
||||
|
||||
if (val is Map<String, Object>) {
|
||||
if (val is Map<String, dynamic>) {
|
||||
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
|
||||
_updateOrInsert(tx);
|
||||
}
|
||||
|
@ -85,9 +85,6 @@ abstract class ElectrumTransactionHistoryBase
|
|||
}
|
||||
|
||||
void _updateOrInsert(ElectrumTransactionInfo transaction) {
|
||||
if (transaction.id == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (transactions[transaction.id] == null) {
|
||||
transactions[transaction.id] = transaction;
|
||||
|
@ -98,6 +95,7 @@ abstract class ElectrumTransactionHistoryBase
|
|||
originalTx?.height = transaction.height;
|
||||
originalTx?.date ??= transaction.date;
|
||||
originalTx?.isPending = transaction.isPending;
|
||||
originalTx?.direction = transaction.direction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,9 +228,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
|
|||
m['id'] = id;
|
||||
m['height'] = height;
|
||||
m['amount'] = amount;
|
||||
// FIX-ME: Hardcoded value
|
||||
// m['direction'] = direction.index;
|
||||
m['direction'] = 0;
|
||||
m['direction'] = direction.index;
|
||||
m['date'] = date.millisecondsSinceEpoch;
|
||||
m['isPending'] = isPending;
|
||||
m['confirmations'] = confirmations;
|
||||
|
|
Loading…
Reference in a new issue