mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
CW-745 don't show txkey when it's unavailable (#1692)
Some checks are pending
Cache Dependencies / test (push) Waiting to run
Some checks are pending
Cache Dependencies / test (push) Waiting to run
This commit is contained in:
parent
4adb81c4dc
commit
e2b3507134
1 changed files with 2 additions and 20 deletions
|
@ -319,27 +319,9 @@ class Transaction {
|
||||||
final txKey = monero.Wallet_getTxKey(wptr!, txid: monero.TransactionInfo_hash(txInfo));
|
final txKey = monero.Wallet_getTxKey(wptr!, txid: monero.TransactionInfo_hash(txInfo));
|
||||||
final status = monero.Wallet_status(wptr!);
|
final status = monero.Wallet_status(wptr!);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
return monero.Wallet_errorString(wptr!);
|
return "";
|
||||||
}
|
}
|
||||||
return breakTxKey(txKey);
|
return txKey;
|
||||||
}
|
|
||||||
|
|
||||||
static String breakTxKey(String input) {
|
|
||||||
final x = 64;
|
|
||||||
StringBuffer buffer = StringBuffer();
|
|
||||||
|
|
||||||
for (int i = 0; i < input.length; i += x) {
|
|
||||||
int endIndex = i + x;
|
|
||||||
if (endIndex > input.length) {
|
|
||||||
endIndex = input.length;
|
|
||||||
}
|
|
||||||
buffer.write(input.substring(i, endIndex));
|
|
||||||
if (endIndex != input.length) {
|
|
||||||
buffer.write('\n\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer.toString().trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Transaction.dummy({
|
Transaction.dummy({
|
||||||
|
|
Loading…
Reference in a new issue