mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
freeze possible firo masternode outputs
This commit is contained in:
parent
29e67ec0bf
commit
cf565944e2
1 changed files with 27 additions and 27 deletions
|
@ -549,39 +549,39 @@ class FiroWallet extends Bip39HDWallet
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<({String? blockedReason, bool blocked, String? utxoLabel})>
|
Future<
|
||||||
checkBlockUTXO(
|
({
|
||||||
|
String? blockedReason,
|
||||||
|
bool blocked,
|
||||||
|
String? utxoLabel,
|
||||||
|
})> checkBlockUTXO(
|
||||||
Map<String, dynamic> jsonUTXO,
|
Map<String, dynamic> jsonUTXO,
|
||||||
String? scriptPubKeyHex,
|
String? scriptPubKeyHex,
|
||||||
Map<String, dynamic>? jsonTX,
|
Map<String, dynamic>? jsonTX,
|
||||||
String? utxoOwnerAddress,
|
String? utxoOwnerAddress,
|
||||||
) async {
|
) async {
|
||||||
final bool blocked = false;
|
bool blocked = false;
|
||||||
String? blockedReason;
|
String? blockedReason;
|
||||||
//
|
String? label;
|
||||||
// if (jsonTX != null) {
|
|
||||||
// // check for bip47 notification
|
if (jsonUTXO["value"] is int) {
|
||||||
// final outputs = jsonTX["vout"] as List;
|
// TODO: [prio=med] use special electrumx call to verify the 1000 Firo output is masternode
|
||||||
// for (final output in outputs) {
|
blocked = Amount.fromDecimal(
|
||||||
// List<String>? scriptChunks =
|
Decimal.fromInt(
|
||||||
// (output['scriptPubKey']?['asm'] as String?)?.split(" ");
|
1000, // 1000 firo output is a possible master node
|
||||||
// if (scriptChunks?.length == 2 && scriptChunks?[0] == "OP_RETURN") {
|
),
|
||||||
// final blindedPaymentCode = scriptChunks![1];
|
fractionDigits: cryptoCurrency.fractionDigits,
|
||||||
// final bytes = blindedPaymentCode.toUint8ListFromHex;
|
).raw ==
|
||||||
//
|
BigInt.from(jsonUTXO["value"] as int);
|
||||||
// // https://en.bitcoin.it/wiki/BIP_0047#Sending
|
|
||||||
// if (bytes.length == 80 && bytes.first == 1) {
|
if (blocked) {
|
||||||
// blocked = true;
|
blockedReason = "Possible masternode output. "
|
||||||
// blockedReason = "Paynym notification output. Incautious "
|
"Unlock and spend at your own risk.";
|
||||||
// "handling of outputs from notification transactions "
|
label = "Possible masternode";
|
||||||
// "may cause unintended loss of privacy.";
|
}
|
||||||
// break;
|
}
|
||||||
// }
|
|
||||||
// }
|
return (blockedReason: blockedReason, blocked: blocked, utxoLabel: label);
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
return (blockedReason: blockedReason, blocked: blocked, utxoLabel: null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue