feat(c-miner): port miner pipeline to modular C implementation
This commit is contained in:
23
types.c
Normal file
23
types.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "types.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void block_template_free(BlockTemplate *tpl) {
|
||||
size_t i;
|
||||
|
||||
if (tpl == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < tpl->tx_count; ++i) {
|
||||
free(tpl->transactions[i].data);
|
||||
tpl->transactions[i].data = NULL;
|
||||
}
|
||||
|
||||
free(tpl->transactions);
|
||||
tpl->transactions = NULL;
|
||||
tpl->tx_count = 0;
|
||||
|
||||
free(tpl->default_witness_commitment);
|
||||
tpl->default_witness_commitment = NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user