mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
block possible ordinal containing utxos
This commit is contained in:
parent
0933546806
commit
d7aa8134d3
1 changed files with 24 additions and 3 deletions
|
@ -1793,6 +1793,27 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
coin: coin,
|
coin: coin,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final storedTx = await db.getTransaction(
|
||||||
|
walletId,
|
||||||
|
jsonUTXO["tx_hash"] as String,
|
||||||
|
);
|
||||||
|
|
||||||
|
bool shouldBlock = false;
|
||||||
|
String? blockReason;
|
||||||
|
String? label;
|
||||||
|
|
||||||
|
if (storedTx?.amountString != null) {
|
||||||
|
final amount = Amount.fromSerializedJsonString(
|
||||||
|
storedTx!.amountString!,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (amount.raw <= BigInt.from(10000)) {
|
||||||
|
shouldBlock = true;
|
||||||
|
blockReason = "May contain ordinal";
|
||||||
|
label = "Possible ordinal";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final vout = jsonUTXO["tx_pos"] as int;
|
final vout = jsonUTXO["tx_pos"] as int;
|
||||||
|
|
||||||
final outputs = txn["vout"] as List;
|
final outputs = txn["vout"] as List;
|
||||||
|
@ -1812,9 +1833,9 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
txid: txn["txid"] as String,
|
txid: txn["txid"] as String,
|
||||||
vout: vout,
|
vout: vout,
|
||||||
value: jsonUTXO["value"] as int,
|
value: jsonUTXO["value"] as int,
|
||||||
name: "",
|
name: label ?? "",
|
||||||
isBlocked: false,
|
isBlocked: shouldBlock,
|
||||||
blockedReason: null,
|
blockedReason: blockReason,
|
||||||
isCoinbase: txn["is_coinbase"] as bool? ?? false,
|
isCoinbase: txn["is_coinbase"] as bool? ?? false,
|
||||||
blockHash: txn["blockhash"] as String?,
|
blockHash: txn["blockhash"] as String?,
|
||||||
blockHeight: jsonUTXO["height"] as int?,
|
blockHeight: jsonUTXO["height"] as int?,
|
||||||
|
|
Loading…
Reference in a new issue