Updated on 2026-08-14
This commit is contained in:
parent
b3b5ee7f9a
commit
9e067e324d
9 changed files with 66 additions and 23 deletions
|
|
@ -22,18 +22,19 @@ public class BtcData extends CoinData {
|
|||
//for blockchain.info
|
||||
private boolean hasUnconfirmed = false;
|
||||
|
||||
public String getUnspentInputsDescription() {
|
||||
public Unspents getUnspentInputsDescription() {
|
||||
try {
|
||||
int gatheredUnspents = 0;
|
||||
if (unspentTransactions == null) return "";
|
||||
if (unspentTransactions == null) return null;
|
||||
for (int i = 0; i < unspentTransactions.size(); i++) {
|
||||
if (unspentTransactions.get(i).script != null && unspentTransactions.get(i).script.length() > 1)
|
||||
gatheredUnspents++;
|
||||
}
|
||||
return unspentTransactions.size() + " unspents (" + gatheredUnspents + " received)";
|
||||
|
||||
return new Unspents(unspentTransactions.size(), gatheredUnspents);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -437,7 +437,15 @@ public class BtcEngine extends CoinEngine {
|
|||
|
||||
@Override
|
||||
public String getUnspentInputsDescription() {
|
||||
return coinData.getUnspentInputsDescription();
|
||||
Unspents unspents = coinData.getUnspentInputsDescription();
|
||||
if (unspents == null) {
|
||||
return "";
|
||||
} else {
|
||||
return String.format(
|
||||
ctx.getContext().getString(R.string.details_unspents_number),
|
||||
unspents.getUnspetns(),
|
||||
unspents.getGatheredUnspents());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
3
app/src/main/java/com/tangem/wallet/btc/Unspents.kt
Normal file
3
app/src/main/java/com/tangem/wallet/btc/Unspents.kt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
package com.tangem.wallet.btc
|
||||
|
||||
data class Unspents(val unspetns: Int, val gatheredUnspents: Int)
|
||||
Loading…
Add table
Add a link
Reference in a new issue