libbtc
bitcoinclibrary
|
#include <btc/script.h>
#include <assert.h>
#include <string.h>
#include "buffer.h"
#include "serialize.h"
Go to the source code of this file.
|
static |
Definition at line 257 of file script.c.
Referenced by btc_script_build_multisig().
|
static |
Definition at line 266 of file script.c.
References cstr_append_buf().
Referenced by btc_script_append_pushdata(), btc_script_build_p2pkh(), and btc_script_build_p2sh().
|
static |
Definition at line 272 of file script.c.
References btc_script_append_op(), cstr_append_buf(), OP_PUSHDATA1, OP_PUSHDATA2, and OP_PUSHDATA4.
Referenced by btc_script_build_multisig(), btc_script_build_p2pkh(), and btc_script_build_p2sh().
btc_bool btc_script_build_multisig | ( | cstring * | script_in, |
unsigned int | required_signatures, | ||
vector * | pubkeys_chars | ||
) |
Definition at line 298 of file script.c.
References BTC_ECKEY_COMPRESSED_LENGTH, BTC_ECKEY_UNCOMPRESSED_LENGTH, btc_encode_op_n(), btc_script_append_pushdata(), btc_pubkey_::compressed, cstr_append_buf(), cstr_resize(), vector::data, vector::len, OP_CHECKMULTISIG, and btc_pubkey_::pubkey.
Definition at line 323 of file script.c.
References btc_script_append_op(), btc_script_append_pushdata(), cstr_resize(), OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, and OP_HASH160.
Referenced by btc_tx_add_p2pkh_hash160_out().
Definition at line 338 of file script.c.
References btc_script_append_op(), btc_script_append_pushdata(), cstr_resize(), OP_EQUAL, and OP_HASH160.
Referenced by btc_tx_add_p2sh_hash160_out().
enum btc_tx_out_type btc_script_classify | ( | vector * | ops | ) |
Definition at line 243 of file script.c.
References btc_script_is_multisig(), btc_script_is_pubkey(), btc_script_is_pubkeyhash(), btc_script_is_scripthash(), BTC_TX_MULTISIG, BTC_TX_NONSTANDARD, BTC_TX_PUBKEY, BTC_TX_PUBKEYHASH, and BTC_TX_SCRIPTHASH.
btc_bool btc_script_copy_without_op_codeseperator | ( | const cstring * | script_in, |
cstring * | script_out | ||
) |
Definition at line 36 of file script.c.
References cstr_append_buf(), deser_bytes(), deser_skip(), deser_u16(), deser_u32(), const_buffer::len, cstring::len, OP_CODESEPARATOR, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, const_buffer::p, and cstring::str.
Referenced by btc_tx_sighash().
Definition at line 108 of file script.c.
References btc_script_op_free(), btc_script_op_new(), btc_script_op_::data, btc_script_op_::datalen, deser_bytes(), deser_skip(), deser_u16(), deser_u32(), const_buffer::len, cstring::len, btc_script_op_::op, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, const_buffer::p, cstring::str, and vector_add().
Definition at line 227 of file script.c.
References btc_script_is_op(), btc_script_is_op_pubkey(), btc_script_is_op_smallint(), vector::len, OP_CHECKMULTISIG, and vector_idx.
Referenced by btc_script_classify().
|
static |
Definition at line 170 of file script.c.
References btc_script_op_::op.
Referenced by btc_script_is_multisig(), btc_script_is_pubkey(), btc_script_is_pubkeyhash(), and btc_script_is_scripthash().
|
static |
Definition at line 175 of file script.c.
References btc_script_is_pushdata(), btc_script_op_::datalen, and btc_script_op_::op.
Referenced by btc_script_is_multisig(), and btc_script_is_pubkey().
|
static |
Definition at line 184 of file script.c.
References btc_script_is_pushdata(), btc_script_op_::datalen, and btc_script_op_::op.
Referenced by btc_script_is_pubkeyhash(), and btc_script_is_scripthash().
|
static |
Definition at line 221 of file script.c.
References btc_script_op_::op, OP_0, OP_1, and OP_16.
Referenced by btc_script_is_multisig().
Definition at line 194 of file script.c.
References btc_script_is_op(), btc_script_is_op_pubkey(), vector::len, OP_CHECKSIG, and vector_idx.
Referenced by btc_script_classify().
Definition at line 202 of file script.c.
References btc_script_is_op(), btc_script_is_op_pubkeyhash(), vector::len, OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160, and vector_idx.
Referenced by btc_script_classify().
|
inlinestatic |
Definition at line 165 of file script.c.
References OP_PUSHDATA4.
Referenced by btc_script_is_op_pubkey(), and btc_script_is_op_pubkeyhash().
Definition at line 213 of file script.c.
References btc_script_is_op(), btc_script_is_op_pubkeyhash(), vector::len, OP_EQUAL, OP_HASH160, and vector_idx.
Referenced by btc_script_classify().
void btc_script_op_free | ( | btc_script_op * | script_op | ) |
Definition at line 90 of file script.c.
References btc_script_op_::data, btc_script_op_::datalen, btc_script_op_::op, and OP_0.
Referenced by btc_script_get_ops(), and btc_script_op_free_cb().
void btc_script_op_free_cb | ( | void * | data | ) |
btc_script_op* btc_script_op_new | ( | ) |
Definition at line 81 of file script.c.
Referenced by btc_script_get_ops().