コード例 #1
0
ファイル: Chain.cs プロジェクト: KursLabIgor/bitprim-cs
        /// <summary>
        /// Get metadata on potential payment transactions by stealth filter. Given a filter and a
        /// height in the chain, it queries the chain for transactions matching the given filter.
        /// </summary>
        /// <param name="filter"> Must be at least 8 bits in length. example "10101010" </param>
        /// <param name="fromHeight"> Starting height in the chain to search for transactions </param>

        /* public async Task<DisposableApiCallResult<INativeList<IStealthCompact>>> FetchStealthAsync(Binary filter, UInt64 fromHeight)
         * {
         *  return await TaskHelper.ToTask<DisposableApiCallResult<INativeList<IStealthCompact>>>(tcs =>
         *  {
         *
         *      FetchStealth(filter, fromHeight, (code, list) =>
         *      {
         *          tcs.TrySetResult(new DisposableApiCallResult<INativeList<IStealthCompact>>()
         *          {
         *              ErrorCode = code,
         *              Result = list
         *          });
         *
         *      });
         *
         *  });
         * }*/

        private void FetchStealth(Binary filter, UInt64 fromHeight, Action <ErrorCode, StealthCompactList> handler)
        {
            IntPtr contextPtr = CreateContext(handler, filter);

            ChainNative.chain_fetch_stealth(nativeInstance_, contextPtr, filter.NativeInstance, fromHeight, internalFetchStealthHandler_);
        }