Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public SyncingSubscription(

private class SubscriptionSyncingResult
{
[JsonIgnore]
public bool? IsSyncing { get; set; }
public long? StartingBlock { get; set; }
public long? CurrentBlock { get; set; }
public long? HighestBlock { get; set; }
Expand All @@ -63,24 +61,15 @@ private void OnConditionsChange(object? sender, BlockEventArgs e)
if (_logger.IsTrace) _logger.Trace($"Syncing subscription {Id} changed syncing status from {_lastIsSyncing} to {isSyncing}");

_lastIsSyncing = isSyncing;
JsonRpcResult result;

if (isSyncing == false)
{
result = CreateSubscriptionMessage(isSyncing);
}
else
{
result = CreateSubscriptionMessage(new SubscriptionSyncingResult()
{
IsSyncing = syncingResult.IsSyncing,
StartingBlock = syncingResult.StartingBlock,
CurrentBlock = syncingResult.CurrentBlock,
HighestBlock = syncingResult.HighestBlock
});
}

using (result)
using (JsonRpcResult result = !isSyncing
? CreateSubscriptionMessage(false)
: CreateSubscriptionMessage(new SubscriptionSyncingResult()
{
StartingBlock = syncingResult.StartingBlock,
CurrentBlock = syncingResult.CurrentBlock,
HighestBlock = syncingResult.HighestBlock
}))
{
await JsonRpcDuplexClient.SendJsonRpcResult(result);
}
Expand Down