/// <summary> /// Fetch 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> > FetchSpendAsync(OutputPoint outputPoint) { return(await TaskHelper.ToTask <ApiCallResult <IPoint> >(tcs => { FetchSpend(outputPoint, (code, point) => { tcs.TrySetResult(new ApiCallResult <IPoint> { ErrorCode = code, Result = point }); }); })); }
private void FetchSpend(OutputPoint outputPoint, Action <ErrorCode, Point> handler) { IntPtr contextPtr = CreateContext(handler, outputPoint); ChainNative.chain_fetch_spend(nativeInstance_, contextPtr, outputPoint.NativeInstance, internalFetchSpendHandler_); }