ladimolnar / BitcoinDatabaseGenerator

A high performance data transfer tool that can be used to transfer data from Bitcoin Core blockchain files to a SQL Server database
Apache License 2.0
123 stars 53 forks source link

Error: Cannot await in the body of a finally clause #20

Open rydersan opened 2 years ago

rydersan commented 2 years ago

Hey!

There is the new and unexpected error. Copied error below...

Error 2 Cannot await in the body of a finally clause C:\Users{user}\Visual Studio 2013\Projects\Bitcoin Database Generator\BitcoinDatabaseGenerator\DatabaseGenerator.cs Line: 427

..... finally { // Whatever we have in the pipeline we'll push to the DB. We do this in a finally block. // Otherwise an exception that occurs in blockchain file 100 may prevent data that was // collected in blockchain file 99 to be saved to DB.

            // Wait for the last remaining background tasks if any that are still executing 
            // sourceDataPipeline.FillBlockchainPipeline or the SQL bulk copy to finish.
            await taskDispatcher.WaitForAllWorkToComplete();

            // Instruct sourceDataPipeline to transfer all remaining data to the available data queue.
            // IMPORTANT: do not call this while there could still be threads executing sourceDataPipeline.FillBlockchainPipeline.
            sourceDataPipeline.Flush();

            // Now trigger the SQL bulk copy for the data that remains.
            await this.TransferAvailableData(taskDispatcher, sourceDataPipeline);

            // Wait for the last remaining background tasks if any that are still executing 
            // the SQL bulk copy to finish.
            await taskDispatcher.WaitForAllWorkToComplete();
        }

Does anyone knows the solvation of this error.

ladimolnar commented 2 years ago

I assume you are using an older version of the C# compiler. C# allows for await in a finally since C# 6.

rydersan commented 2 years ago

Hey! Thank you for your reply. Oh, nevermind. I have fixed this issue by my self. I just forgot to update this issue fix here.

PS - I'm using VS 2013 with Microsoft SQL Server 2014 Enterprise.

PSS - Since this issue has been fixed I got another (Doh) it says = 'ERROR: The Blockchain folder must contain Files named with the pattern "blk?????.dat", starting from "blk00000.dat" and with no gaps in the numeric section.' . My comment about this 'New error' is - Path to this folder is correct and it contains "fresh" Bitcoin core .dat Files without "gaps" etc.

Now, can't figure out what is this, but this error exception looks like has been thrown by BitcoinDatabaseGenerator.dll file. 'Cuz exception can be founded there.

Thank you!

I assume you are using an older version of the C# compiler. C# allows for await in a finally since C# 6.