Skip to content

Commit

Permalink
Merge pull request #2272 from greymistcube/fix/updated-addresses
Browse files Browse the repository at this point in the history
🔧 Fix updated addresses for every render
  • Loading branch information
greymistcube authored Oct 18, 2023
2 parents 41a2895 + b7cae99 commit ba98283
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion NineChronicles.Headless/ActionEvaluationPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,15 @@ await _hub.BroadcastRenderBlockAsync(
IAccountState output = _blockChainStates.GetAccountState(ev.OutputState);
IAccountState input = _blockChainStates.GetAccountState(ev.PreviousState);
AccountDiff diff = AccountDiff.Create(input, output);
if (!TargetAddresses.Any(diff.StateDiffs.Keys.Append(ev.Signer).Contains))
var updatedAddresses = diff.StateDiffs.Keys
.Union(diff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1))
.Append(ev.Signer)
.ToHashSet();
if (!TargetAddresses.Any(updatedAddresses.Contains))
{
return;
}

var encodeElapsedMilliseconds = stopwatch.ElapsedMilliseconds;

var eval = new NCActionEvaluation(pa, ev.Signer, ev.BlockIndex, ev.OutputState, ev.Exception, ev.PreviousState, ev.RandomSeed, extra);
Expand Down

0 comments on commit ba98283

Please sign in to comment.