NBitcoin/BIP174/PartiallySignedTransaction.cs
/// <summary>
/// Returns the virtual transaction size of the transaction. If the PSBT is finalized, then the exact virtual size.
/// </summary>
/// <param name="vsize">The calculated virtual size</param>
/// <returns>True if could get the virtual size could get estimated</returns>
Returns the virtual transaction size of the transaction. If the PSBT is finalized, then the exact virtual size.
Returns the virtual transaction size of the transaction . If the PSBT is finalized then the exact virtual size .
public bool TryGetVirtualSize(out int vsize)
		{
			if (IsAllFinalized())
			{
				vsize = ExtractTransaction().GetVirtualSize();
				return true;
			}
			var transactionBuilder = CreateTransactionBuilder();
			transactionBuilder.AddCoins(GetAllCoins());
			try
			{
				 vsize = transactionBuilder.EstimateSize(this.tx, true);
				 return true;
			}
			catch
			{
				vsize = -1;
				return false;
			}
		}
public bool TryGetVirtualSize ( out int vsize ) { if ( IsAllFinalized ( ) ) { vsize = ExtractTransaction ( ) . GetVirtualSize ( ) ; return true ; } var transactionBuilder = CreateTransactionBuilder ( ) ; transactionBuilder . AddCoins ( GetAllCoins ( ) ) ; try { vsize = transactionBuilder . EstimateSize ( this . tx , true ) ; return true ; } catch { vsize = - 1 ; return false ; } }
Returns the virtual transaction size of the transaction.
Returns the virtual transaction size of the transaction .
True if could get the virtual size could get estimated
True if could get the virtual size could get estimated
int
out
<not_specific>
vsize
<not_specific>
The calculated virtual size
The calculated virtual size