mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +00:00
default to locked if mn collat call fails for safety reasons
This commit is contained in:
parent
7f0d4bc126
commit
eb7aa24a0a
2 changed files with 14 additions and 7 deletions
|
@ -1165,7 +1165,7 @@ class ElectrumXClient {
|
|||
level: LogLevel.Info,
|
||||
);
|
||||
|
||||
return response as bool? ?? false;
|
||||
return response as bool;
|
||||
} catch (e) {
|
||||
Logging.instance.log(e, level: LogLevel.Error);
|
||||
rethrow;
|
||||
|
|
|
@ -631,16 +631,23 @@ class FiroWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>
|
|||
BigInt.from(jsonUTXO["value"] as int);
|
||||
|
||||
if (blocked) {
|
||||
blocked = await electrumXClient.isMasterNodeCollateral(
|
||||
txid: jsonTX!["txid"] as String,
|
||||
index: jsonUTXO["tx_pos"] as int,
|
||||
);
|
||||
try {
|
||||
blocked = await electrumXClient.isMasterNodeCollateral(
|
||||
txid: jsonTX!["txid"] as String,
|
||||
index: jsonUTXO["tx_pos"] as int,
|
||||
);
|
||||
} catch (_) {
|
||||
// call failed, lock utxo just in case
|
||||
// it should logically already be blocked
|
||||
// but just in case
|
||||
blocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (blocked) {
|
||||
blockedReason = "Masternode collateral. "
|
||||
blockedReason = "Possible masternode collateral. "
|
||||
"Unlock and spend at your own risk.";
|
||||
label = "Masternode collateral";
|
||||
label = "Possible masternode collateral";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue