예제 #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_);
        }