com.google.bitcoin.core
Class WrongNetworkException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.google.bitcoin.core.AddressFormatException
              extended by com.google.bitcoin.core.WrongNetworkException
All Implemented Interfaces:
Serializable

public class WrongNetworkException
extends AddressFormatException

This exception is thrown by the Address class when you try and decode an address with a version code that isn't used by that network. You shouldn't allow the user to proceed in this case as they are trying to send money across different chains, an operation that is guaranteed to destroy the money.

See Also:
Serialized Form

Field Summary
 int[] acceptableVersions
          The list of acceptable versions that were expected given the addresses network parameters.
 int verCode
          The version code that was provided in the address.
 
Constructor Summary
WrongNetworkException(int verCode, int[] acceptableVersions)
           
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

verCode

public int verCode
The version code that was provided in the address.


acceptableVersions

public int[] acceptableVersions
The list of acceptable versions that were expected given the addresses network parameters.

Constructor Detail

WrongNetworkException

public WrongNetworkException(int verCode,
                             int[] acceptableVersions)


Copyright © 2014. All rights reserved.