bch zero conf fixes

This commit is contained in:
julian 2023-03-24 16:43:34 -06:00
parent 7e6642cd84
commit 678a926ff3
2 changed files with 23 additions and 13 deletions

View file

@ -968,17 +968,25 @@ class _TransactionDetailsViewState
? const EdgeInsets.all(16)
: const EdgeInsets.all(12),
child: Builder(builder: (context) {
final height = widget.coin != Coin.epicCash &&
_transaction.isConfirmed(
currentHeight,
coin.requiredConfirmations,
)
? "${_transaction.height == 0 ? "Unknown" : _transaction.height}"
: _transaction.getConfirmations(
currentHeight) >
0
? "${_transaction.height}"
: "Pending";
final String height;
if (widget.coin == Coin.bitcoincash ||
widget.coin == Coin.bitcoincashTestnet) {
height =
"${_transaction.height != null && _transaction.height! > 0 ? _transaction.height! : "Pending"}";
} else {
height = widget.coin != Coin.epicCash &&
_transaction.isConfirmed(
currentHeight,
coin.requiredConfirmations,
)
? "${_transaction.height == 0 ? "Unknown" : _transaction.height}"
: _transaction.getConfirmations(
currentHeight) >
0
? "${_transaction.height}"
: "Pending";
}
return Row(
mainAxisAlignment:

View file

@ -2120,8 +2120,10 @@ class BitcoinCashWallet extends CoinServiceAPI
.txidEqualTo(txHash["tx_hash"] as String)
.findFirst();
if (storedTx == null ||
!storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) {
if (storedTx == null || storedTx.address.value == null
// zero conf messes this up
// !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)
) {
final tx = await cachedElectrumXClient.getTransaction(
txHash: txHash["tx_hash"] as String,
verbose: true,