Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
block chain management and the Wallet class. |
org.bitcoinj.jni | |
org.bitcoinj.script |
Classes for working with and executing Bitcoin script programs, as embedded in inputs and outputs.
|
Modifier and Type | Method and Description |
---|---|
TransactionInput |
Transaction.addSignedInput(TransactionOutPoint prevOut,
Script scriptPubKey,
ECKey sigKey)
Same as
Transaction.addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)
but defaults to Transaction.SigHash.ALL and "false" for the anyoneCanPay flag. |
TransactionInput |
Transaction.addSignedInput(TransactionOutPoint prevOut,
Script scriptPubKey,
ECKey sigKey,
Transaction.SigHash sigHash,
boolean anyoneCanPay)
Adds a new and fully signed input for the given parameters.
|
Address |
TransactionOutput.getAddressFromP2PKHScript(NetworkParameters networkParameters)
If the output script pays to an address as in
P2PKH, return the address of the receiver, i.e., a base58 encoded hash of the public key in the script.
|
Address |
TransactionOutput.getAddressFromP2SH(NetworkParameters networkParameters)
If the output script pays to a redeem script, return the address of the redeem script as described by,
i.e., a base58 encoding of [one-byte version][20-byte hash][4-byte checksum], where the 20-byte hash refers to
the redeem script.
|
ECKey |
TransactionOutPoint.getConnectedKey(KeyBag keyBag)
Returns the ECKey identified in the connected output, for either pay-to-address scripts or pay-to-key scripts.
|
RedeemData |
TransactionOutPoint.getConnectedRedeemData(KeyBag keyBag)
Returns the RedeemData identified in the connected output, for either pay-to-address scripts, pay-to-key
or P2SH scripts.
|
RedeemData |
TransactionInput.getConnectedRedeemData(KeyBag keyBag)
Alias for getOutpoint().getConnectedRedeemData(keyBag)
|
Address |
TransactionInput.getFromAddress()
Deprecated.
|
Script |
TransactionOutput.getScriptPubKey() |
Script |
TransactionInput.getScriptSig()
Returns the script that is fed to the referenced output (scriptPubKey) script in order to satisfy it: usually
contains signatures and maybe keys, but can contain arbitrary data if the output script accepts it.
|
int |
Transaction.getSigOpCount()
Gets the count of regular SigOps in this transactions
|
Coin |
Transaction.getValue(TransactionBag wallet)
Returns the difference of
Transaction.getValueSentFromMe(TransactionBag) and Transaction.getValueSentToMe(TransactionBag) . |
Coin |
Transaction.getValueSentFromMe(TransactionBag wallet)
Calculates the sum of the inputs that are spending coins with keys in the wallet.
|
boolean |
Wallet.isPendingTransactionRelevant(Transaction tx)
This method is used by a
Peer to find out if a transaction that has been announced is interesting,
that is, whether we should bother downloading its dependencies and exploring the transaction to decide how
risky it is. |
boolean |
Wallet.isTransactionRelevant(Transaction tx)
Returns true if the given transaction sends coins to any of our keys, or has inputs spending any of our outputs,
and also returns true if tx has inputs that are spending outputs which are
not ours but which are spent by pending transactions.
|
boolean |
BlockChainListener.isTransactionRelevant(Transaction tx)
Returns true if the given transaction is interesting to the listener.
|
boolean |
AbstractBlockChainListener.isTransactionRelevant(Transaction tx) |
Modifier and Type | Method and Description |
---|---|
boolean |
NativeBlockChainListener.isTransactionRelevant(Transaction tx) |
Modifier and Type | Method and Description |
---|---|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey)
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey, enabling all
validation rules.
|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey,
Set<Script.VerifyFlag> verifyFlags)
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey.
|
static void |
Script.executeScript(Transaction txContainingThis,
long index,
Script script,
LinkedList<byte[]> stack,
boolean enforceNullDummy)
Exposes the script interpreter.
|
Address |
Script.getFromAddress(NetworkParameters params)
Deprecated.
|
static long |
Script.getP2SHSigOpCount(byte[] scriptSig)
Gets the count of P2SH Sig Ops in the Script scriptSig
|
byte[] |
Script.getPubKey()
Returns the public key in this script.
|
byte[] |
Script.getPubKeyHash()
If a program matches the standard template DUP HASH160
|
static int |
Script.getSigOpCount(byte[] program)
Gets the count of regular SigOps in the script program (counting multisig ops as 20)
|
Address |
Script.getToAddress(NetworkParameters params)
Gets the destination address from this script, if it's in the required form (see getPubKey).
|
Address |
Script.getToAddress(NetworkParameters params,
boolean forcePayToPubKey)
Gets the destination address from this script, if it's in the required form (see getPubKey).
|
Constructor and Description |
---|
Script(byte[] programBytes)
Construct a Script that copies and wraps the programBytes array.
|
Script(byte[] programBytes,
long creationTimeSeconds) |
Copyright © 2014. All rights reserved.