diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinAdapter.kt index 9706ddb922..99707f791d 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinAdapter.kt @@ -25,7 +25,7 @@ class BitcoinAdapter( syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager, wallet: Wallet, -) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, confirmationsThreshold), BitcoinKit.Listener, ISendBitcoinAdapter { +) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet), BitcoinKit.Listener, ISendBitcoinAdapter { constructor( wallet: Wallet, @@ -99,7 +99,7 @@ class BitcoinAdapter( kit.usedAddresses(change).map { UsedAddress(it.index, it.address, "https://blockchair.com/bitcoin/address/${it.address}") } companion object { - private const val confirmationsThreshold = 3 + private const val confirmationsThreshold = 1 private fun createKit( wallet: Wallet, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinBaseAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinBaseAdapter.kt index 57beb31356..de02eaa2ef 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinBaseAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinBaseAdapter.kt @@ -54,11 +54,11 @@ abstract class BitcoinBaseAdapter( open val syncMode: BitcoinCore.SyncMode, private val backgroundManager: BackgroundManager, val wallet: Wallet, - private val confirmationsThreshold: Int, protected val decimal: Int = 8 ) : IAdapter, ITransactionsAdapter, IBalanceAdapter, IReceiveAdapter { private val scope = CoroutineScope(Dispatchers.Default) + private var transactionConfirmationsThreshold = 3 abstract val satoshisInBitcoin: BigDecimal @@ -396,7 +396,7 @@ abstract class BitcoinBaseAdapter( transactionHash = transaction.transactionHash, transactionIndex = transaction.transactionIndex, blockHeight = transaction.blockHeight, - confirmationsThreshold = confirmationsThreshold, + confirmationsThreshold = transactionConfirmationsThreshold, timestamp = transaction.timestamp, fee = satoshiToBTC(transaction.fee), failed = transaction.status == TransactionStatus.INVALID, @@ -417,7 +417,7 @@ abstract class BitcoinBaseAdapter( transactionHash = transaction.transactionHash, transactionIndex = transaction.transactionIndex, blockHeight = transaction.blockHeight, - confirmationsThreshold = confirmationsThreshold, + confirmationsThreshold = transactionConfirmationsThreshold, timestamp = transaction.timestamp, fee = satoshiToBTC(transaction.fee), failed = transaction.status == TransactionStatus.INVALID, @@ -440,7 +440,7 @@ abstract class BitcoinBaseAdapter( transactionHash = transaction.transactionHash, transactionIndex = transaction.transactionIndex, blockHeight = transaction.blockHeight, - confirmationsThreshold = confirmationsThreshold, + confirmationsThreshold = transactionConfirmationsThreshold, timestamp = transaction.timestamp, fee = satoshiToBTC(transaction.fee), failed = transaction.status == TransactionStatus.INVALID, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinCashAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinCashAdapter.kt index 4df798749d..0335a63488 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinCashAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/BitcoinCashAdapter.kt @@ -26,7 +26,7 @@ class BitcoinCashAdapter( syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager, wallet: Wallet, -) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, confirmationsThreshold), BitcoinCashKit.Listener, ISendBitcoinAdapter { +) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet), BitcoinCashKit.Listener, ISendBitcoinAdapter { constructor( wallet: Wallet, @@ -94,7 +94,7 @@ class BitcoinCashAdapter( kit.usedAddresses(change).map { UsedAddress(it.index, it.address, "https://blockchair.com/bitcoin-cash/address/${it.address}") } companion object { - private const val confirmationsThreshold = 3 + private const val confirmationsThreshold = 1 private fun createKit( wallet: Wallet, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/DashAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/DashAdapter.kt index 8e35e247e0..a49d8b8b85 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/DashAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/DashAdapter.kt @@ -23,7 +23,7 @@ class DashAdapter( syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager, wallet: Wallet, -) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, confirmationsThreshold), DashKit.Listener, ISendBitcoinAdapter { +) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet), DashKit.Listener, ISendBitcoinAdapter { constructor(wallet: Wallet, syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager) : this(createKit(wallet, syncMode), syncMode, backgroundManager, wallet) @@ -87,7 +87,7 @@ class DashAdapter( kit.usedAddresses(change).map { UsedAddress(it.index, it.address, "https://blockchair.com/dash/address/${it.address}") } companion object { - private const val confirmationsThreshold = 3 + private const val confirmationsThreshold = 1 private fun createKit(wallet: Wallet, syncMode: BitcoinCore.SyncMode): DashKit { val account = wallet.account diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/ECashAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/ECashAdapter.kt index 55ffe0d279..f447441441 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/ECashAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/ECashAdapter.kt @@ -22,7 +22,7 @@ class ECashAdapter( syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager, wallet: Wallet, -) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, confirmationsThreshold, 2), ECashKit.Listener, ISendBitcoinAdapter { +) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, 2), ECashKit.Listener, ISendBitcoinAdapter { constructor( wallet: Wallet, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/LitecoinAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/LitecoinAdapter.kt index f153e9fb52..f745c964c5 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/LitecoinAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/LitecoinAdapter.kt @@ -25,7 +25,7 @@ class LitecoinAdapter( syncMode: BitcoinCore.SyncMode, backgroundManager: BackgroundManager, wallet: Wallet, -) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet, confirmationsThreshold), LitecoinKit.Listener, ISendBitcoinAdapter { +) : BitcoinBaseAdapter(kit, syncMode, backgroundManager, wallet), LitecoinKit.Listener, ISendBitcoinAdapter { constructor( wallet: Wallet, @@ -95,7 +95,7 @@ class LitecoinAdapter( companion object { - private const val confirmationsThreshold = 3 + private const val confirmationsThreshold = 1 private fun createKit( wallet: Wallet,