/** * A transaction is mature if it is either a building coinbase tx that is as deep or deeper than the required * coinbase depth, or a non-coinbase tx. */ public boolean isMature() { if (!isCoinBase()) return true; if (getConfidence().getConfidenceType() != ConfidenceType.BUILDING) return false; return getConfidence().getDepthInBlocks() >= params.getSpendableCoinbaseDepth(); }
/** * A transaction is mature if it is either a building coinbase tx that is as deep or deeper than the required coinbase depth, or a non-coinbase tx. */ public boolean isMature() { if (!isCoinBase()) return true; if (getConfidence().getConfidenceType() != ConfidenceType.BUILDING) return false; return getConfidence().getDepthInBlocks() >= params.getSpendableCoinbaseDepth(); }
/** * A transaction is mature if it is either a building coinbase tx that is as deep or deeper than the required coinbase depth, or a non-coinbase tx. */ public boolean isMature() { if (!isCoinBase()) return true; if (getConfidence().getConfidenceType() != ConfidenceType.BUILDING) return false; return getConfidence().getDepthInBlocks() >= params.getSpendableCoinbaseDepth(); }
/** * A transaction is mature if it is either a building coinbase tx that is as deep or deeper than the required coinbase depth, or a non-coinbase tx. */ public boolean isMature() { if (!isCoinBase()) return true; if (getConfidence().getConfidenceType() != ConfidenceType.BUILDING) return false; return getConfidence().getDepthInBlocks() >= params.getSpendableCoinbaseDepth(); }
int depth = chainHeight - output.getHeight() + 1; // the current depth of the output (1 = same as head). if (!excludeImmatureCoinbases || !coinbase || depth >= params.getSpendableCoinbaseDepth()) { candidates.add(new FreeStandingTransactionOutput(params, output, chainHeight));
int depth = chainHeight - output.getHeight() + 1; // the current depth of the output (1 = same as head). if (!excludeImmatureCoinbases || !coinbase || depth >= params.getSpendableCoinbaseDepth()) { candidates.add(new FreeStandingTransactionOutput(params, output, chainHeight));
int depth = chainHeight - output.getHeight() + 1; // the current depth of the output (1 = same as head). if (!excludeImmatureCoinbases || !coinbase || depth >= params.getSpendableCoinbaseDepth()) { candidates.add(new FreeStandingTransactionOutput(params, output, chainHeight));
int depth = chainHeight - output.getHeight() + 1; // the current depth of the output (1 = same as head). if (!excludeImmatureCoinbases || !coinbase || depth >= params.getSpendableCoinbaseDepth()) { candidates.add(new FreeStandingTransactionOutput(params, output, chainHeight));
public BlockAndValidity(NewBlock block, boolean connects, boolean throwsException, Sha256Hash hashChainTipAfterBlock, int heightAfterBlock, String blockName) { this(block.block, connects, throwsException, hashChainTipAfterBlock, heightAfterBlock, blockName); coinbaseBlockMap.put(block.getCoinbaseOutput().outpoint.getHash(), block.getHash()); Integer blockHeight = blockToHeightMap.get(block.block.getPrevBlockHash()); if (blockHeight != null) { blockHeight++; for (Transaction t : block.block.getTransactions()) for (TransactionInput in : t.getInputs()) { Sha256Hash blockSpendingHash = coinbaseBlockMap.get(in.getOutpoint().getHash()); checkState(blockSpendingHash == null || blockToHeightMap.get(blockSpendingHash) == null || blockToHeightMap.get(blockSpendingHash) == blockHeight - params.getSpendableCoinbaseDepth()); } } }
if (height - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) { throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
if (height - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) { throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
if (height - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) { throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
if (height - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) { throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
if (prevOut == null) throw new VerificationException("Attempted spend of a non-existent or already spent output!"); if (prevOut.isCoinbase() && newBlock.getHeight() - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) throw new VerificationException("Tried to spend coinbase at depth " + (newBlock.getHeight() - prevOut.getHeight())); valueIn = valueIn.add(prevOut.getValue());
TransactionOutPoint spendableOutput = new TransactionOutPoint(PARAMS, 0, rollingBlock.getTransactions().get(0).getHash()); byte[] spendableOutputScriptPubKey = rollingBlock.getTransactions().get(0).getOutputs().get(0).getScriptBytes(); for (int i = 1; i < PARAMS.getSpendableCoinbaseDepth(); i++) { rollingBlock = rollingBlock.createNextBlockWithCoinbase(Block.BLOCK_VERSION_GENESIS, outKey.getPubKey(), height++); chain.add(rollingBlock);
TransactionOutPoint spendableOutput = new TransactionOutPoint(PARAMS, 0, transaction.getHash()); byte[] spendableOutputScriptPubKey = transaction.getOutputs().get(0).getScriptBytes(); for (int i = 1; i < PARAMS.getSpendableCoinbaseDepth(); i++) { rollingBlock = rollingBlock.createNextBlockWithCoinbase(Block.BLOCK_VERSION_GENESIS, outKey.getPubKey(), height++); chain.add(rollingBlock);
chain.add(rollingBlock); TransactionOutput spendableOutput = rollingBlock.getTransactions().get(0).getOutput(0); for (int i = 1; i < PARAMS.getSpendableCoinbaseDepth(); i++) { rollingBlock = rollingBlock.createNextBlockWithCoinbase(Block.BLOCK_VERSION_GENESIS, outKey.getPubKey(), height++); chain.add(rollingBlock);
for (int i = 0; i < PARAMS.getSpendableCoinbaseDepth() - 2; i++) { firstTip = firstTip.createNextBlock(someOtherGuy); chain.add(firstTip); for (int i = 0; i < PARAMS.getSpendableCoinbaseDepth() - 2; i++) { secondTip = secondTip.createNextBlock(someOtherGuy); chain.add(secondTip);
TransactionOutPoint spendableOutput = new TransactionOutPoint(PARAMS, 0, transaction.getHash()); byte[] spendableOutputScriptPubKey = transaction.getOutputs().get(0).getScriptBytes(); for (int i = 1; i < PARAMS.getSpendableCoinbaseDepth(); i++) { rollingBlock = rollingBlock.createNextBlockWithCoinbase(Block.BLOCK_VERSION_GENESIS, outKey.getPubKey(), height++); chain.add(rollingBlock);
for (int i = 0; i < PARAMS.getSpendableCoinbaseDepth() - 2; i++) {