/// <summary> /// Verify that a transaction is fully signed and have enough fees /// </summary> /// <param name="tx">he transaction to check</param> /// <param name="expectedFeeRate">The expected fee rate</param> /// <returns>Detected errors</returns> public TransactionPolicyError[] Check(Transaction tx, FeeRate expectedFeeRate) { return Check(tx, expectedFeeRate == null ? null : expectedFeeRate.GetFee(tx)); }
/// <summary> /// Estimate fees of an unsigned transaction /// </summary> /// <param name="tx"></param> /// <param name="feeRate">Fee rate</param> /// <returns></returns> public Money EstimateFees(Transaction tx, FeeRate feeRate) { if(tx == null) throw new ArgumentNullException("tx"); if(feeRate == null) throw new ArgumentNullException("feeRate"); var estimation = EstimateSize(tx); return feeRate.GetFee(estimation); }
/// <summary> /// Verify that a transaction is fully signed and have enough fees /// </summary> /// <param name="tx">The transaction to check</param> /// <param name="expectedFeeRate">The expected fee rate</param> /// <param name="errors">Detected errors</param> /// <returns>True if no error</returns> public bool Verify(Transaction tx, FeeRate expectedFeeRate, out TransactionPolicyError[] errors) { if(tx == null) throw new ArgumentNullException("tx"); return Verify(tx, expectedFeeRate == null ? null : expectedFeeRate.GetFee(tx), out errors); }