C# 클래스 BitSharper.Transaction

상속: Message
파일 보기 프로젝트 열기: TangibleCryptography/BitSharper 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddBlockAppearance void
ConnectForReorganize TransactionInput
DisconnectInputs bool
GetValueSentToMe ulong
HashTransactionForSignature byte[]
Transaction System

공개 메소드들

메소드 설명
AddInput ( TransactionInput input ) : void

Adds an input directly, with no checking that it's valid.

AddInput ( TransactionOutput from ) : void

Adds an input to this transaction that imports value from the given output. Note that this input is NOT complete and after every input is added with addInput() and every output is added with addOutput(), signInputs() must be called to finalize the transaction and finish the inputs off. Otherwise it won't be accepted by the network.

AddOutput ( TransactionOutput to ) : void

Adds the given output to this transaction. The output must be completely initialized.

BitcoinSerializeToStream ( Stream stream ) : void
Equals ( object other ) : bool
GetHashCode ( ) : int
GetValueSentFromMe ( Wallet wallet ) : ulong

Calculates the sum of the inputs that are spending coins with keys in the wallet. This requires the transactions sending coins to those keys to be in the wallet. This method will not attempt to download the blocks containing the input transactions if the key is in the wallet but the transactions are not.

GetValueSentToMe ( Wallet wallet ) : ulong

Calculates the sum of the outputs that are sending coins to a key in the wallet.

IsEveryOutputSpent ( ) : bool
SignInputs ( SigHash hashType, Wallet wallet ) : void

Once a transaction has some inputs and outputs added, the signatures in the inputs can be calculated. The signature is over the transaction itself, to prove the redeemer actually created that transaction, so we have to do this step last.

This method is similar to SignatureHash in script.cpp

ToString ( ) : string
Transaction ( NetworkParameters @params, byte payloadBytes ) : System

Creates a transaction from the given serialized bytes, eg, from a block or a tx network message.

Transaction ( NetworkParameters @params, byte payload, int offset ) : System

Creates a transaction by reading payload starting from offset bytes in. Length of a transaction is fixed.

보호된 메소드들

메소드 설명
Parse ( ) : void

비공개 메소드들

메소드 설명
AddBlockAppearance ( StoredBlock block ) : void

Adds the given block to the internal serializable set of blocks in which this transaction appears. This is used by the wallet to ensure transactions that appear on side chains are recorded properly even though the block stores do not save the transaction data at all.

ConnectForReorganize ( Transaction>.IDictionary transactions ) : TransactionInput

Connects all inputs using the provided transactions. If any input cannot be connected returns that input or null on success.

DisconnectInputs ( ) : bool
GetValueSentToMe ( Wallet wallet, bool includeSpent ) : ulong

Calculates the sum of the outputs that are sending coins to a key in the wallet. The flag controls whether to include spent outputs or not.

HashTransactionForSignature ( SigHash type, bool anyoneCanPay ) : byte[]
Transaction ( NetworkParameters @params ) : System

메소드 상세

AddInput() 공개 메소드

Adds an input directly, with no checking that it's valid.
public AddInput ( TransactionInput input ) : void
input TransactionInput
리턴 void

AddInput() 공개 메소드

Adds an input to this transaction that imports value from the given output. Note that this input is NOT complete and after every input is added with addInput() and every output is added with addOutput(), signInputs() must be called to finalize the transaction and finish the inputs off. Otherwise it won't be accepted by the network.
public AddInput ( TransactionOutput from ) : void
from TransactionOutput
리턴 void

AddOutput() 공개 메소드

Adds the given output to this transaction. The output must be completely initialized.
public AddOutput ( TransactionOutput to ) : void
to TransactionOutput
리턴 void

BitcoinSerializeToStream() 공개 메소드

public BitcoinSerializeToStream ( Stream stream ) : void
stream Stream
리턴 void

Equals() 공개 메소드

public Equals ( object other ) : bool
other object
리턴 bool

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

GetValueSentFromMe() 공개 메소드

Calculates the sum of the inputs that are spending coins with keys in the wallet. This requires the transactions sending coins to those keys to be in the wallet. This method will not attempt to download the blocks containing the input transactions if the key is in the wallet but the transactions are not.
public GetValueSentFromMe ( Wallet wallet ) : ulong
wallet Wallet
리턴 ulong

GetValueSentToMe() 공개 메소드

Calculates the sum of the outputs that are sending coins to a key in the wallet.
public GetValueSentToMe ( Wallet wallet ) : ulong
wallet Wallet
리턴 ulong

IsEveryOutputSpent() 공개 메소드

public IsEveryOutputSpent ( ) : bool
리턴 bool

Parse() 보호된 메소드

protected Parse ( ) : void
리턴 void

SignInputs() 공개 메소드

Once a transaction has some inputs and outputs added, the signatures in the inputs can be calculated. The signature is over the transaction itself, to prove the redeemer actually created that transaction, so we have to do this step last.
This method is similar to SignatureHash in script.cpp
public SignInputs ( SigHash hashType, Wallet wallet ) : void
hashType SigHash This should always be set to SigHash.ALL currently. Other types are unused.
wallet Wallet A wallet is required to fetch the keys needed for signing.
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

Transaction() 공개 메소드

Creates a transaction from the given serialized bytes, eg, from a block or a tx network message.
public Transaction ( NetworkParameters @params, byte payloadBytes ) : System
@params NetworkParameters
payloadBytes byte
리턴 System

Transaction() 공개 메소드

Creates a transaction by reading payload starting from offset bytes in. Length of a transaction is fixed.
public Transaction ( NetworkParameters @params, byte payload, int offset ) : System
@params NetworkParameters
payload byte
offset int
리턴 System