Struct bitcoin::blockdata::transaction::Transaction
[−]
[src]
pub struct Transaction { pub version: u32, pub lock_time: u32, pub input: Vec<TxIn>, pub output: Vec<TxOut>, }
A Bitcoin transaction, which describes an authenticated movement of coins
Fields
version: u32
The protocol version, should always be 1.
lock_time: u32
Block number before which this transaction is valid, or 0 for valid immediately.
input: Vec<TxIn>
List of inputs
output: Vec<TxOut>
List of outputs
Methods
impl Transaction
[src]
fn ntxid(&self) -> Sha256dHash
Computes a "normalized TXID" which does not include any signatures. This gives a way to identify a transaction that is ``the same'' as another in the sense of having same inputs and outputs.
fn signature_hash(&self, input_index: usize, script_pubkey: &Script, sighash_u32: u32) -> Sha256dHash
Computes a signature hash for a given input index with a given sighash flag. To actually produce a scriptSig, this hash needs to be run through an ECDSA signer, the SigHashType appended to the resulting sig, and a script written around this, but this is the general (and hard) part.
Warning This does NOT attempt to support OP_CODESEPARATOR. In general
this would require evaluating script_pubkey
to determine which separators
get evaluated and which don't, which we don't have the information to
determine.
Panics
Panics if input_index
is greater than or equal to self.input.len()
Trait Implementations
impl Hash for Transaction
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Debug for Transaction
[src]
impl Eq for Transaction
[src]
impl PartialEq for Transaction
[src]
fn eq(&self, __arg_0: &Transaction) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Transaction) -> bool
This method tests for !=
.
impl Clone for Transaction
[src]
fn clone(&self) -> Transaction
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Deserialize for Transaction
fn deserialize<D>(deserializer: &mut D) -> Result<Transaction, D::Error> where D: Deserializer
Deserialize this value given this Deserializer
.
impl Serialize for Transaction
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer
Serializes this value into this serializer.
impl BitcoinHash for Transaction
[src]
fn bitcoin_hash(&self) -> Sha256dHash
Produces a Sha256dHash which can be used to refer to the object
impl<S: SimpleEncoder> ConsensusEncodable<S> for Transaction
[src]
fn consensus_encode(&self, s: &mut S) -> Result<(), S::Error>
Encode an object with a well-defined format
impl<D: SimpleDecoder> ConsensusDecodable<D> for Transaction
[src]
fn consensus_decode(d: &mut D) -> Result<Transaction, D::Error>
Decode an object with a well-defined format