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

Function script_push_bytes

bitcoin/script.c:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void script_push_bytes(u8 **scriptp, const void *mem, size_t len)
38{
39 if (len < 76)
40 add_op(scriptp, OP_PUSHBYTES(len));
41 else if (len < 256) {
42 char c = len;
43 add_op(scriptp, OP_PUSHDATA1);
44 add(scriptp, &c, 1);
45 } else if (len < 65536) {
46 le16 v = cpu_to_le16(len);
47 add_op(scriptp, OP_PUSHDATA2);
48 add(scriptp, &v, 2);
49 } else {
50 le32 v = cpu_to_le32(len);
51 add_op(scriptp, OP_PUSHDATA4);
52 add(scriptp, &v, 4);
53 }
54
55 add(scriptp, memcheck(mem, len), len);
56}
57
58static void add_number(u8 **script, u32 num)
59{

Callers 15

add_numberFunction · 0.70
add_push_keyFunction · 0.70
add_push_sigFunction · 0.70
scriptpubkey_p2sh_hashFunction · 0.70
scriptpubkey_p2pkhFunction · 0.70
bitcoin_scriptsig_redeemFunction · 0.70
scriptpubkey_p2wshFunction · 0.70
scriptpubkey_p2wpkhFunction · 0.70
scriptpubkey_witness_rawFunction · 0.70

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