feat(c-miner): port miner pipeline to modular C implementation
This commit is contained in:
40
block_builder.h
Normal file
40
block_builder.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef BLOCK_BUILDER_H
|
||||
#define BLOCK_BUILDER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
char *tx_encode_coinbase_height(int height);
|
||||
int is_segwit_tx(const char *raw_hex);
|
||||
int build_coinbase_transaction(
|
||||
const BlockTemplate *tpl,
|
||||
const char *miner_script_pubkey,
|
||||
const char *extranonce1,
|
||||
const char *extranonce2,
|
||||
const char *coinbase_message,
|
||||
char **coinbase_hex_out,
|
||||
char **coinbase_txid_out
|
||||
);
|
||||
char *calculate_merkle_root(const char *coinbase_txid_hex, const TemplateTransaction *txs, size_t tx_count);
|
||||
int build_block_header_bytes(
|
||||
int version,
|
||||
const char *prev_hash_hex,
|
||||
const char *merkle_root_hex,
|
||||
uint32_t timestamp,
|
||||
const char *bits_hex,
|
||||
uint32_t nonce,
|
||||
uint8_t out_header[80]
|
||||
);
|
||||
char *build_block_header_hex(
|
||||
int version,
|
||||
const char *prev_hash_hex,
|
||||
const char *merkle_root_hex,
|
||||
uint32_t timestamp,
|
||||
const char *bits_hex,
|
||||
uint32_t nonce
|
||||
);
|
||||
char *serialize_block(const char *header_hex, const char *coinbase_tx_hex, const TemplateTransaction *txs, size_t tx_count);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user