Updated on 2026-08-14
This commit is contained in:
parent
90d7a293ab
commit
819fbe0d44
2 changed files with 4 additions and 3 deletions
|
|
@ -90,7 +90,8 @@ class BitcoinNetworkManager(private val isTestNet: Boolean) : BitcoinProvider {
|
|||
data class BitcoinAddressResponse(
|
||||
val balance: Long,
|
||||
val hasUnconfirmed: Boolean,
|
||||
val unspentTransactions: List<UnspentTransaction>)
|
||||
val unspentTransactions: List<UnspentTransaction>
|
||||
)
|
||||
|
||||
data class BitcoinFee(
|
||||
val minimalPerKb: BigDecimal,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class BlockchainInfoProvider(
|
|||
|
||||
val addressData = addressDeferred.await()
|
||||
val unspents = unspentsDeferred.await()
|
||||
val unconfinedTransactions = addressData.transactions?.find { it.blockHeight == 0L } != null
|
||||
val unconfirmedTransactions = addressData.transactions?.find { it.blockHeight == 0L } != null
|
||||
|
||||
val bitcoinUnspents = unspents.unspentOutputs.map {
|
||||
UnspentTransaction(
|
||||
|
|
@ -36,7 +36,7 @@ class BlockchainInfoProvider(
|
|||
Result.Success(
|
||||
BitcoinAddressResponse(
|
||||
addressData.finalBalance
|
||||
?: 0L, unconfinedTransactions, bitcoinUnspents))
|
||||
?: 0L, unconfirmedTransactions, bitcoinUnspents))
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
Result.Failure(exception)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue