namecoin electrumx fixes

This commit is contained in:
Marco 2022-10-07 11:50:26 -06:00
parent 47c904eac4
commit e1e4100a6d

View file

@ -2444,8 +2444,8 @@ class NamecoinWallet extends CoinServiceAPI {
for (final out in tx["vout"] as List) {
if (prevOut == out["n"]) {
String? address = out["scriptPubKey"]["address"] as String?;
if (address == null && out["scriptPubKey"]["addresses"] != null) {
address = out["scriptPubKey"]["addresses"][0] as String?;
if (address == null && out["scriptPubKey"]["address"] != null) {
address = out["scriptPubKey"]["address"] as String?;
}
if (address != null) {
@ -2459,8 +2459,8 @@ class NamecoinWallet extends CoinServiceAPI {
for (final output in txObject["vout"] as List) {
String? address = output["scriptPubKey"]["address"] as String?;
if (address == null && output["scriptPubKey"]["addresses"] != null) {
address = output["scriptPubKey"]["addresses"][0] as String?;
if (address == null && output["scriptPubKey"]["address"] != null) {
address = output["scriptPubKey"]["address"] as String?;
}
if (address != null) {
recipientsArray.add(address);
@ -2528,8 +2528,8 @@ class NamecoinWallet extends CoinServiceAPI {
// add up received tx value
for (final output in txObject["vout"] as List) {
String? address = output["scriptPubKey"]["address"] as String?;
if (address == null && output["scriptPubKey"]["addresses"] != null) {
address = output["scriptPubKey"]["addresses"][0] as String?;
if (address == null && output["scriptPubKey"]["address"] != null) {
address = output["scriptPubKey"]["address"] as String?;
}
if (address != null) {
final value = (Decimal.parse(output["value"].toString()) *
@ -3049,7 +3049,7 @@ class NamecoinWallet extends CoinServiceAPI {
for (final output in tx["vout"] as List) {
final n = output["n"];
if (n != null && n == utxosToUse[i].vout) {
final address = output["scriptPubKey"]["addresses"][0] as String;
final address = output["scriptPubKey"]["address"] as String;
if (!addressTxid.containsKey(address)) {
addressTxid[address] = <String>[];
}