mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-29 04:49:51 +00:00
Generic fixes (#1342)
* handle balance exceptions in estimating All exchange * Fix trades not showing
This commit is contained in:
parent
ecb4f32cda
commit
af7fe05099
2 changed files with 19 additions and 13 deletions
|
@ -220,7 +220,9 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
||||||
Future<void> updateAddressesInBox() async {
|
Future<void> updateAddressesInBox() async {
|
||||||
try {
|
try {
|
||||||
addressesMap.clear();
|
addressesMap.clear();
|
||||||
addressesMap[address] = '';
|
_addresses.forEach((addressRecord) {
|
||||||
|
addressesMap[addressRecord.address] = addressRecord.name;
|
||||||
|
});
|
||||||
await saveAddressesInBox();
|
await saveAddressesInBox();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e.toString());
|
print(e.toString());
|
||||||
|
|
|
@ -127,19 +127,23 @@ class CWBitcoin extends Bitcoin {
|
||||||
|
|
||||||
final p2shAddr = sk.getPublic().toP2pkhInP2sh();
|
final p2shAddr = sk.getPublic().toP2pkhInP2sh();
|
||||||
final p2wpkhAddr = sk.getPublic().toP2wpkhAddress();
|
final p2wpkhAddr = sk.getPublic().toP2wpkhAddress();
|
||||||
final estimatedTx = await electrumWallet.estimateTxFeeAndInputsToUse(
|
try {
|
||||||
0,
|
final estimatedTx = await electrumWallet.estimateTxFeeAndInputsToUse(
|
||||||
true,
|
0,
|
||||||
// Deposit address + change address
|
true,
|
||||||
[p2shAddr, p2wpkhAddr],
|
// Deposit address + change address
|
||||||
[
|
[p2shAddr, p2wpkhAddr],
|
||||||
BitcoinOutput(address: p2shAddr, value: BigInt.zero),
|
[
|
||||||
BitcoinOutput(address: p2wpkhAddr, value: BigInt.zero)
|
BitcoinOutput(address: p2shAddr, value: BigInt.zero),
|
||||||
],
|
BitcoinOutput(address: p2wpkhAddr, value: BigInt.zero)
|
||||||
null,
|
],
|
||||||
priority as BitcoinTransactionPriority);
|
null,
|
||||||
|
priority as BitcoinTransactionPriority);
|
||||||
|
|
||||||
return estimatedTx.amount;
|
return estimatedTx.amount;
|
||||||
|
} catch (_) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue