コード例 #1
0
ファイル: Chain.cs プロジェクト: k-nuth/cs-api
 /// <summary>
 /// Get the transaction input which spends the indicated output, asynchronously.
 /// </summary>
 /// <param name="outputPoint"> Tx hash and index pair where the output was spent. </param>
 public async Task <ApiCallResult <IPoint> > GetSpendAsync(OutputPoint outputPoint)
 {
     return(await TaskHelper.ToTask <ApiCallResult <IPoint> >(tcs => {
         GetSpend(outputPoint, (code, point) => {
             tcs.TrySetResult(new ApiCallResult <IPoint> {
                 ErrorCode = code, Result = point
             });
         });
     }));
 }
コード例 #2
0
ファイル: Chain.cs プロジェクト: k-nuth/cs-api
        private void GetSpend(OutputPoint outputPoint, Action <ErrorCode, Point> handler)
        {
            IntPtr contextPtr = CreateContext(handler, outputPoint);

            ChainNative.kth_chain_async_spend(nativeInstance_, contextPtr, outputPoint.NativeInstance, internalGetSpendHandler_);
        }