BitMaker.Miner.Avx.AvxMiner.Search C# (CSharp) Method

Search() public method

Implements the search function by passing it to native code.
public Search ( Work work, uint round1State, byte round1Block2, uint round2State, byte round2Block1 ) : uint?
work Work
round1State uint
round1Block2 byte
round2State uint
round2Block1 byte
return uint?
        public unsafe override uint? Search(Work work, uint* round1State, byte* round1Block2, uint* round2State, byte* round2Block1)
        {
            // invoked periodically to report hashes and check status
            var check = (AvxCheckDelegate)(i =>
            {
                // report hashes to context
                Context.ReportHashes(this, i);

                // abort if we are working on stale work, or if instructed to
                return work.Pool.CurrentBlockNumber == work.BlockNumber && !CancellationToken.IsCancellationRequested;
            });

            // dispatch work to native implementation
            return AvxMinerUtils.Search(round1State, round1Block2, round2State, round2Block1, check);
        }