mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
CW-289-Fix bitcoin pending send receive transactions not showing until confirmed (#878)
* Fix error in rendering pending transactions in different device * Show pending status * Fix broken subscription stream
This commit is contained in:
parent
ab20312e61
commit
3fc927f742
3 changed files with 9 additions and 7 deletions
|
@ -410,7 +410,7 @@ class ElectrumClient {
|
|||
switch (method) {
|
||||
case 'blockchain.scripthash.subscribe':
|
||||
final params = request['params'] as List<dynamic>;
|
||||
final scripthash = params.first as String;
|
||||
final scripthash = params.first as String?;
|
||||
final id = 'blockchain.scripthash.subscribe:$scripthash';
|
||||
|
||||
_tasks[id]?.subject?.add(params.last);
|
||||
|
@ -430,7 +430,7 @@ class ElectrumClient {
|
|||
|
||||
void _handleResponse(Map<String, dynamic> response) {
|
||||
final method = response['method'];
|
||||
final id = response['id'] as String;
|
||||
final id = response['id'] as String?;
|
||||
final result = response['result'];
|
||||
|
||||
if (method is String) {
|
||||
|
@ -438,9 +438,11 @@ class ElectrumClient {
|
|||
return;
|
||||
}
|
||||
|
||||
if (id != null){
|
||||
_finish(id, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: move me
|
||||
bool isJSONStringCorrect(String source) {
|
||||
|
|
|
@ -136,7 +136,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
|
|||
return ElectrumTransactionInfo(type,
|
||||
id: bundle.originalTransaction.getId(),
|
||||
height: height,
|
||||
isPending: false,
|
||||
isPending: bundle.confirmations == 0,
|
||||
fee: fee,
|
||||
direction: direction,
|
||||
amount: amount,
|
||||
|
|
|
@ -537,8 +537,8 @@ abstract class ElectrumWalletBase extends WalletBase<ElectrumBalance,
|
|||
final transactionHex = verboseTransaction['hex'] as String;
|
||||
final original = bitcoin.Transaction.fromHex(transactionHex);
|
||||
final ins = <bitcoin.Transaction>[];
|
||||
final time = verboseTransaction['time'] as int;
|
||||
final confirmations = verboseTransaction['confirmations'] as int ?? 0;
|
||||
final time = verboseTransaction['time'] as int?;
|
||||
final confirmations = verboseTransaction['confirmations'] as int? ?? 0;
|
||||
|
||||
for (final vin in original.ins) {
|
||||
final id = HEX.encode(vin.hash!.reversed.toList());
|
||||
|
|
Loading…
Reference in a new issue