Do not publish NewTransactionEvent if GetValidOutputs did not match with the network's.

This commit is contained in:
Kukks
2021-09-15 07:27:43 +02:00
parent f7099cf6aa
commit e93562b1db

View File

@@ -145,8 +145,10 @@ namespace BTCPayServer.Payments.Bitcoin
if (evt.DerivationStrategy != null)
{
wallet.InvalidateCache(evt.DerivationStrategy);
foreach (var output in network.GetValidOutputs(evt))
var validOutputs = network.GetValidOutputs(evt).ToList();
if (!validOutputs.Any())
break;
foreach (var output in validOutputs)
{
var key = output.Item1.ScriptPubKey.Hash + "#" +
network.CryptoCode.ToUpperInvariant();