3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 10:15:52 +00:00

Throw an exception rather than assert on trying to get from address of generation transaction

This commit is contained in:
Miron Cuperman 2012-03-23 16:58:06 -07:00
parent 91a5949930
commit 58971b6728

View File

@ -168,7 +168,9 @@ public class TransactionInput extends ChildMessage implements Serializable {
* @throws ScriptException if the scriptSig could not be understood (eg, if this is a coinbase transaction).
*/
public Address getFromAddress() throws ScriptException {
assert !isCoinBase();
if (isCoinBase()) {
throw new ScriptException("coinbase transaction");
}
return getScriptSig().getFromAddress();
}