MCPcopy Create free account
hub / github.com/ElementsProject/lightning / script_push_bytes

Function script_push_bytes

bitcoin/script.c:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void script_push_bytes(u8 **scriptp, const void *mem, size_t len)
49{
50 if (len < 76)
51 add_op(scriptp, OP_PUSHBYTES(len));
52 else if (len < 256) {
53 char c = len;
54 add_op(scriptp, OP_PUSHDATA1);
55 add(scriptp, &c, 1);
56 } else if (len < 65536) {
57 le16 v = cpu_to_le16(len);
58 add_op(scriptp, OP_PUSHDATA2);
59 add(scriptp, &v, 2);
60 } else {
61 le32 v = cpu_to_le32(len);
62 add_op(scriptp, OP_PUSHDATA4);
63 add(scriptp, &v, 4);
64 }
65
66 add(scriptp, memcheck(mem, len), len);
67}
68
69static void add_number(u8 **script, u32 num)
70{

Callers 15

add_numberFunction · 0.85
add_push_keyFunction · 0.85
add_push_sigFunction · 0.85
scriptpubkey_p2sh_hashFunction · 0.85
scriptpubkey_p2pkhFunction · 0.85
bitcoin_scriptsig_redeemFunction · 0.85
scriptpubkey_p2wshFunction · 0.85
scriptpubkey_p2wpkhFunction · 0.85
scriptpubkey_witness_rawFunction · 0.85
scriptpubkey_raw_p2trFunction · 0.85

Calls 4

add_opFunction · 0.85
cpu_to_le16Function · 0.85
cpu_to_le32Function · 0.85
addFunction · 0.70

Tested by

no test coverage detected