Class TransactionValidationException

All Implemented Interfaces:
Serializable

public final class TransactionValidationException extends BlockchainException
Thrown when a Transaction fails one or more TransactionValidator checks before entering the mempool or being included in a block.

The exception carries the full ValidationResult so that callers can inspect the specific failure reason and the list of error messages without parsing the exception message string.

Since:
1.0.0
See Also:
  • Constructor Details

    • TransactionValidationException

      public TransactionValidationException(String message, ValidationResult validationResult, Transaction transaction)
      Constructs a TransactionValidationException.
      Parameters:
      message - human-readable summary of the validation failure
      validationResult - the full result from the validator (non-null)
      transaction - the rejected transaction (maybe null)
  • Method Details

    • getValidationResult

      public ValidationResult getValidationResult()
      Returns the full ValidationResult that caused this exception.
      Returns:
      the validation result (non-null)
    • getTransaction

      public Transaction getTransaction()
      Returns the transaction that failed validation.
      Returns:
      the rejected transaction, or null if not available