/** * A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their * value is determined by a formula that all implementations of Bitcoin share. In 2011 the value of a coinbase * transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its * position in a block but by the data in the inputs. */ public boolean isCoinBase() { return inputs.size() == 1 && inputs.get(0).isCoinBase(); }
/** * A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their * value is determined by a formula that all implementations of Bitcoin share. In 2011 the value of a coinbase * transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its * position in a block but by the data in the inputs. */ public boolean isCoinBase() { return inputs.size() == 1 && inputs.get(0).isCoinBase(); }
/** * A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their * value is determined by a formula that all implementations of Bitcoin share. In 2011 the value of a coinbase * transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its * position in a block but by the data in the inputs. */ public boolean isCoinBase() { return inputs.size() == 1 && inputs.get(0).isCoinBase(); }
/** * A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their * value is determined by a formula that all implementations of Bitcoin share. In 2011 the value of a coinbase * transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its * position in a block but by the data in the inputs. */ public boolean isCoinBase() { return inputs.size() == 1 && inputs.get(0).isCoinBase(); }
/** * Returns a human readable debug string. */ @Override public String toString() { StringBuilder s = new StringBuilder("TxIn"); try { if (isCoinBase()) { s.append(": COINBASE"); } else { s.append(" for [").append(outpoint).append("]: ").append(getScriptSig()); if (hasSequence()) s.append(" (sequence: ").append(Long.toHexString(sequence)).append(")"); } return s.toString(); } catch (ScriptException e) { throw new RuntimeException(e); } } }
/** * Returns a human readable debug string. */ @Override public String toString() { StringBuilder s = new StringBuilder("TxIn"); try { if (isCoinBase()) { s.append(": COINBASE"); } else { s.append(" for [").append(outpoint).append("]: ").append(getScriptSig()); String flags = Joiner.on(", ").skipNulls().join( hasSequence() ? "sequence: " + Long.toHexString(sequence) : null, isOptInFullRBF() ? "opts into full RBF" : null); if (!flags.isEmpty()) s.append(" (").append(flags).append(')'); } return s.toString(); } catch (ScriptException e) { throw new RuntimeException(e); } } }
/** * Returns a human readable debug string. */ @Override public String toString() { StringBuilder s = new StringBuilder("TxIn"); try { if (isCoinBase()) { s.append(": COINBASE"); } else { s.append(" for [").append(outpoint).append("]: ").append(getScriptSig()); String flags = Joiner.on(", ").skipNulls().join( hasSequence() ? "sequence: " + Long.toHexString(sequence) : null, isOptInFullRBF() ? "opts into full RBF" : null); if (!flags.isEmpty()) s.append(" (").append(flags).append(')'); } return s.toString(); } catch (ScriptException e) { throw new RuntimeException(e); } } }
/** * Returns a human readable debug string. */ @Override public String toString() { StringBuilder s = new StringBuilder("TxIn"); try { if (isCoinBase()) { s.append(": COINBASE"); } else { s.append(" for [").append(outpoint).append("]: ").append(getScriptSig()); String flags = Joiner.on(", ").skipNulls().join( hasSequence() ? "sequence: " + Long.toHexString(sequence) : null, isOptInFullRBF() ? "opts into full RBF" : null); if (!flags.isEmpty()) s.append(" (").append(flags).append(')'); } return s.toString(); } catch (ScriptException e) { throw new RuntimeException(e); } } }
/** * Convenience method that returns the from address of this input by parsing the scriptSig. The concept of a * "from address" is not well defined in Bitcoin and you should not assume that senders of a transaction can * actually receive coins on the same address they used to sign (e.g. this is not true for shared wallets). */ @Deprecated public Address getFromAddress() throws ScriptException { if (isCoinBase()) { throw new ScriptException( ScriptError.SCRIPT_ERR_UNKNOWN_ERROR, "This is a coinbase transaction which generates new coins. It does not have a from address."); } return getScriptSig().getFromAddress(params); }
/** * Convenience method that returns the from address of this input by parsing the scriptSig. The concept of a * "from address" is not well defined in Bitcoin and you should not assume that senders of a transaction can * actually receive coins on the same address they used to sign (e.g. this is not true for shared wallets). */ @Deprecated public Address getFromAddress() throws ScriptException { if (isCoinBase()) { throw new ScriptException( "This is a coinbase transaction which generates new coins. It does not have a from address."); } return getScriptSig().getFromAddress(params); }
/** * Convenience method that returns the from address of this input by parsing the scriptSig. The concept of a * "from address" is not well defined in Bitcoin and you should not assume that senders of a transaction can * actually receive coins on the same address they used to sign (e.g. this is not true for shared wallets). */ @Deprecated public Address getFromAddress() throws ScriptException { if (isCoinBase()) { throw new ScriptException( "This is a coinbase transaction which generates new coins. It does not have a from address."); } return getScriptSig().getFromAddress(params); }
/** * Convenience method that returns the from address of this input by parsing the scriptSig. The concept of a * "from address" is not well defined in Bitcoin and you should not assume that senders of a transaction can * actually receive coins on the same address they used to sign (e.g. this is not true for shared wallets). */ @Deprecated public Address getFromAddress() throws ScriptException { if (isCoinBase()) { throw new ScriptException( "This is a coinbase transaction which generates new coins. It does not have a from address."); } return getScriptSig().getFromAddress(params); }
String toStringCpp() { String str; str = "CTxIn("; str = str + getOutpoint().toStringCpp(); if (isCoinBase()) str = str + ", coinbase " + scriptSig.toString(); else str = str + ", scriptSig="+ (getScriptSig().getChunks().size() != 0 ? getScriptSig().toString().substring(0,24) : ""); if (this.sequence != 4294967295L) str = str + ", nSequence=" + sequence; str = str + ")"; return str; }
} else { for (TransactionInput input : inputs) if (input.isCoinBase()) throw new VerificationException.UnexpectedCoinbaseInput();
} else { for (TransactionInput input : inputs) if (input.isCoinBase()) throw new VerificationException.UnexpectedCoinbaseInput();
} else { for (TransactionInput input : inputs) if (input.isCoinBase()) throw new VerificationException.UnexpectedCoinbaseInput();
} else { for (TransactionInput input : inputs) if (input.isCoinBase()) throw new VerificationException.UnexpectedCoinbaseInput();