mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-19 01:04:43 +00:00
bug-fix: account for other send outputs that are part of the same tx
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
This commit is contained in:
parent
2de388bd51
commit
48b3fd2472
5 changed files with 11 additions and 7 deletions
|
@ -337,7 +337,7 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
|
|||
return defaultFeeRate;
|
||||
}
|
||||
};
|
||||
final p = priority as DecredTransactionPriority;
|
||||
final p = priority;
|
||||
switch (p) {
|
||||
case DecredTransactionPriority.slow:
|
||||
if (feeRateSlow.isOld()) {
|
||||
|
@ -388,7 +388,6 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
|
|||
return this.fetchFiveTransactions(0);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, DecredTransactionInfo>> fetchFiveTransactions(
|
||||
int from) async {
|
||||
final res =
|
||||
|
@ -396,7 +395,7 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
|
|||
final decoded = json.decode(res);
|
||||
var txs = <String, DecredTransactionInfo>{};
|
||||
for (final d in decoded) {
|
||||
final txid = d["txid"] ?? "";
|
||||
final txid = uniqueTxID(d["txid"] ?? "", d["vout"] ?? 0);
|
||||
var direction = TransactionDirection.outgoing;
|
||||
if (d["category"] == "receive") {
|
||||
direction = TransactionDirection.incoming;
|
||||
|
@ -423,6 +422,11 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
|
|||
return txs;
|
||||
}
|
||||
|
||||
// uniqueTxID combines the tx id and vout to create a unique id.
|
||||
String uniqueTxID(String id, int vout) {
|
||||
return id + ":" + vout.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> save() async {}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|||
case WalletType.wownero:
|
||||
return 'https://explore.wownero.com/tx/${txId}';
|
||||
case WalletType.decred:
|
||||
return 'https://dcrdata.decred.org/tx/${txId}';
|
||||
return 'https://dcrdata.decred.org/tx/${txId.split(':')[0]}';
|
||||
case WalletType.none:
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CW_DECRED_DIR=${WORKDIR}/cake_wallet/cw_decred
|
||||
LIBWALLET_PATH="${WORKDIR}/decred/libwallet"
|
||||
LIBWALLET_URL="https://github.com/decred/libwallet.git"
|
||||
LIBWALLET_VERSION="v1.0.4"
|
||||
LIBWALLET_VERSION="v1.1.0"
|
||||
|
||||
if [ -e $LIBWALLET_PATH ]; then
|
||||
rm -fr $LIBWALLET_PATH
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ./config.sh
|
||||
LIBWALLET_PATH="${EXTERNAL_IOS_SOURCE_DIR}/libwallet"
|
||||
LIBWALLET_URL="https://github.com/decred/libwallet.git"
|
||||
LIBWALLET_VERSION="v1.0.4"
|
||||
LIBWALLET_VERSION="v1.1.0"
|
||||
|
||||
if [ -e $LIBWALLET_PATH ]; then
|
||||
rm -fr $LIBWALLET_PATH
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
LIBWALLET_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libwallet"
|
||||
LIBWALLET_URL="https://github.com/decred/libwallet.git"
|
||||
LIBWALLET_VERSION="v1.0.4"
|
||||
LIBWALLET_VERSION="v1.1.0"
|
||||
|
||||
echo "======================= DECRED LIBWALLET ========================="
|
||||
|
||||
|
|
Loading…
Reference in a new issue