cbitcoin
 All Data Structures Files Functions Variables Typedefs
src/structures/CBObject/CBMessage/CBTransactionInput/CBTransactionInput.h File Reference

Represents an input into a bitcoin transaction. Inherits CBMessage. More...

#include "CBMessage.h"
#include "CBScript.h"
#include "CBTransactionOutput.h"

Go to the source code of this file.

Data Structures

struct  CBPrevOut
 Structure for previous outputs that are being spent by an input. More...
struct  CBTransactionInput
 Structure for CBTransactionInput objects. More...

Functions

CBTransactionInputCBNewTransactionInput (CBScript *script, uint32_t sequence, CBByteArray *prevOutHash, uint32_t prevOutIndex, void(*onErrorReceived)(CBError error, char *,...))
 Creates a new CBTransactionInput object.
CBTransactionInputCBNewTransactionInputFromData (CBByteArray *data, void(*onErrorReceived)(CBError error, char *,...))
 Creates a new CBTransactionInput object from the byte data.
CBTransactionInputCBNewUnsignedTransactionInput (uint32_t sequence, CBByteArray *prevOutHash, uint32_t prevOutIndex, void(*onErrorReceived)(CBError error, char *,...))
 Creates a new unsigned CBTransactionInput object and links it to a given output.
CBTransactionInputCBGetTransactionInput (void *self)
 Gets a CBTransactionInput from another object. Use this to avoid casts.
bool CBInitTransactionInput (CBTransactionInput *self, CBScript *script, uint32_t sequence, CBByteArray *prevOutHash, uint32_t prevOutIndex, void(*onErrorReceived)(CBError error, char *,...))
 Initialises a CBTransactionInput object.
bool CBInitTransactionInputFromData (CBTransactionInput *self, CBByteArray *data, void(*onErrorReceived)(CBError error, char *,...))
 Initialises a new CBTransactionInput object from the byte data.
bool CBInitUnsignedTransactionInput (CBTransactionInput *self, uint32_t sequence, CBByteArray *prevOutHash, uint32_t prevOutIndex, void(*onErrorReceived)(CBError error, char *,...))
 Initialises an unsigned CBTransactionInput object.
void CBFreeTransactionInput (void *self)
 Frees a CBTransactionInput object.
uint32_t CBTransactionInputDeserialise (CBTransactionInput *self)
 Deserialises a CBTransactionInput so that it can be used as an object.
uint32_t CBTransactionInputSerialise (CBTransactionInput *self)
 Serialises a CBTransactionInput to the byte data.

Detailed Description

Represents an input into a bitcoin transaction. Inherits CBMessage.


Function Documentation

void CBFreeTransactionInput ( void *  self)

Frees a CBTransactionInput object.

Parameters:
selfThe CBTransactionInput object to free.

Gets a CBTransactionInput from another object. Use this to avoid casts.

Parameters:
selfThe object to obtain the CBTransactionInput from.
Returns:
The CBTransactionInput object.
bool CBInitTransactionInput ( CBTransactionInput self,
CBScript script,
uint32_t  sequence,
CBByteArray prevOutHash,
uint32_t  prevOutIndex,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Initialises a CBTransactionInput object.

Parameters:
selfThe CBTransactionInput object to initialise
Returns:
true on success, false on failure.
bool CBInitTransactionInputFromData ( CBTransactionInput self,
CBByteArray data,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Initialises a new CBTransactionInput object from the byte data.

Parameters:
selfThe CBTransactionInput object to initialise
dataThe byte data.
Returns:
true on success, false on failure.
bool CBInitUnsignedTransactionInput ( CBTransactionInput self,
uint32_t  sequence,
CBByteArray prevOutHash,
uint32_t  prevOutIndex,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Initialises an unsigned CBTransactionInput object.

Parameters:
selfThe CBTransactionInput object to initialise
Returns:
true on success, false on failure.
CBTransactionInput* CBNewTransactionInput ( CBScript script,
uint32_t  sequence,
CBByteArray prevOutHash,
uint32_t  prevOutIndex,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Creates a new CBTransactionInput object.

Returns:
A new CBTransactionInput object.
CBTransactionInput* CBNewTransactionInputFromData ( CBByteArray data,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Creates a new CBTransactionInput object from the byte data.

Parameters:
dataThe byte data.
Returns:
A new CBTransactionInput object.
CBTransactionInput* CBNewUnsignedTransactionInput ( uint32_t  sequence,
CBByteArray prevOutHash,
uint32_t  prevOutIndex,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Creates a new unsigned CBTransactionInput object and links it to a given output.

Returns:
A new CBTransactionInput object.

Deserialises a CBTransactionInput so that it can be used as an object.

Parameters:
selfThe CBTransactionInput object
Returns:
The length read on success, 0 on failure.

Serialises a CBTransactionInput to the byte data.

Parameters:
selfThe CBTransactionInput object
Returns:
The length written on success, 0 on failure.