mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
confirms bugfix
This commit is contained in:
parent
ea212b3dd8
commit
c503e8f8d8
2 changed files with 4 additions and 5 deletions
|
@ -4,7 +4,6 @@ import 'package:isar/isar.dart';
|
||||||
import 'package:stackwallet/models/isar/models/address/address.dart';
|
import 'package:stackwallet/models/isar/models/address/address.dart';
|
||||||
import 'package:stackwallet/models/isar/models/blockchain_data/input.dart';
|
import 'package:stackwallet/models/isar/models/blockchain_data/input.dart';
|
||||||
import 'package:stackwallet/models/isar/models/blockchain_data/output.dart';
|
import 'package:stackwallet/models/isar/models/blockchain_data/output.dart';
|
||||||
import 'package:stackwallet/models/isar/models/transaction_note.dart';
|
|
||||||
|
|
||||||
part 'transaction.g.dart';
|
part 'transaction.g.dart';
|
||||||
|
|
||||||
|
@ -49,8 +48,8 @@ class Transaction {
|
||||||
final outputs = IsarLinks<Output>();
|
final outputs = IsarLinks<Output>();
|
||||||
|
|
||||||
int getConfirmations(int currentChainHeight) {
|
int getConfirmations(int currentChainHeight) {
|
||||||
if (height == null) return 0;
|
if (height == null || height! <= 0) return 0;
|
||||||
return max(0, currentChainHeight - height!);
|
return max(0, currentChainHeight - (height! - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isConfirmed(int currentChainHeight, int minimumConfirms) {
|
bool isConfirmed(int currentChainHeight, int minimumConfirms) {
|
||||||
|
|
|
@ -32,8 +32,8 @@ class UTXO {
|
||||||
|
|
||||||
int getConfirmations(int currentChainHeight) {
|
int getConfirmations(int currentChainHeight) {
|
||||||
if (blockTime == null || blockHash == null) return 0;
|
if (blockTime == null || blockHash == null) return 0;
|
||||||
if (blockHeight == null) return 0;
|
if (blockHeight == null || blockHeight! <= 0) return 0;
|
||||||
return max(0, currentChainHeight - blockHeight!);
|
return max(0, currentChainHeight - (blockHeight! - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isConfirmed(int currentChainHeight, int minimumConfirms) {
|
bool isConfirmed(int currentChainHeight, int minimumConfirms) {
|
||||||
|
|
Loading…
Reference in a new issue