mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 22:46:56 +01:00
Throw an exception rather than assert on trying to get from address of generation transaction
This commit is contained in:
parent
91a5949930
commit
58971b6728
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue