From 85d69c0cb29330e46c559bd2f070e5e93a0e4203 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 30 Jan 2023 08:28:14 -0600 Subject: [PATCH] check all outputs for potential notification tx --- lib/services/mixins/electrum_x_parsing.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/services/mixins/electrum_x_parsing.dart b/lib/services/mixins/electrum_x_parsing.dart index 23be3d80d..c0b572b20 100644 --- a/lib/services/mixins/electrum_x_parsing.dart +++ b/lib/services/mixins/electrum_x_parsing.dart @@ -189,14 +189,16 @@ mixin ElectrumXParsing { TransactionSubType txSubType = TransactionSubType.none; if (this is PaynymWalletInterface && outs.length > 1 && ins.isNotEmpty) { - List? scriptChunks = outs[1].scriptPubKeyAsm?.split(" "); - if (scriptChunks?.length == 2 && scriptChunks?[0] == "OP_RETURN") { - final blindedPaymentCode = scriptChunks![1]; - final bytes = blindedPaymentCode.fromHex; + for (int i = 0; i < outs.length; i++) { + List? scriptChunks = outs[i].scriptPubKeyAsm?.split(" "); + if (scriptChunks?.length == 2 && scriptChunks?[0] == "OP_RETURN") { + final blindedPaymentCode = scriptChunks![1]; + final bytes = blindedPaymentCode.fromHex; - // https://en.bitcoin.it/wiki/BIP_0047#Sending - if (bytes.length == 80 && bytes.first == 1) { - txSubType = TransactionSubType.bip47Notification; + // https://en.bitcoin.it/wiki/BIP_0047#Sending + if (bytes.length == 80 && bytes.first == 1) { + txSubType = TransactionSubType.bip47Notification; + } } } }