Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
and block chain management. |
org.bitcoinj.script |
Classes for working with and executing Bitcoin script programs, as embedded in inputs and outputs.
|
org.bitcoinj.wallet |
Classes that support the
Wallet , which knows how to find and save transactions relevant to
a set of keys or scripts, calculate balances, and spend money: the wallet has many features and can be extended
in various ways, please refer to the website for documentation on how to use it. |
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 |
TransactionInput.getConnectedRedeemData(KeyBag keyBag)
Alias for getOutpoint().getConnectedRedeemData(keyBag)
|
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.
|
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.getValueSentToMe(TransactionBag) and Transaction.getValueSentFromMe(TransactionBag) . |
Coin |
Transaction.getValueSentFromMe(TransactionBag wallet)
Calculates the sum of the inputs that are spending coins with keys in the wallet.
|
Modifier and Type | Method and Description |
---|---|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey)
Deprecated.
Use
Script.correctlySpends(org.bitcoinj.core.Transaction, long, org.bitcoinj.script.Script, java.util.Set)
instead so that verification flags do not change as new verification options
are added. |
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)
|
static void |
Script.executeScript(Transaction txContainingThis,
long index,
Script script,
LinkedList<byte[]> stack,
Set<Script.VerifyFlag> verifyFlags)
Exposes the script interpreter.
|
byte[] |
Script.getCLTVPaymentChannelRecipientPubKey()
Retrieves the recipient public key from a LOCKTIMEVERIFY transaction
|
byte[] |
Script.getCLTVPaymentChannelSenderPubKey()
Retrieves the sender public key from a LOCKTIMEVERIFY transaction
|
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 <pubkey hash> EQUALVERIFY CHECKSIG
then this function retrieves the third element.
|
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) |
Modifier and Type | Method and Description |
---|---|
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.
|
Copyright © 2016. All rights reserved.