-
Notifications
You must be signed in to change notification settings - Fork 4
/
ajb.h
50 lines (34 loc) · 1.1 KB
/
ajb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef included_mff_ajb_h_
#define included_mff_ajb_h_
#include <memory>
#include <serialize.h>
#include <streams.h>
#include <tinyrpc.h>
#include <bcq/bitcoin.h>
#include <tinymempool.h>
extern tiny::rpc* rpc;
namespace mff {
struct ajb {
std::shared_ptr<bitcoin::mff> mff;
std::shared_ptr<tiny::mempool> mempool;
long current_time;
long next_block_time{0};
uint256 next_block;
FILE* in_fp;
CAutoFile in;
char* buffer;
size_t buffer_cap;
ajb(std::shared_ptr<bitcoin::mff> mff_in, std::shared_ptr<tiny::mempool> mempool_in, const std::string& path = "");
// AMAP stuff
int64_t amap_get_output_value(const uint256& txid, int n);
// RPC/AMAP combinator
int64_t get_output_value(const uint256& txid, int n);
int64_t get_tx_input_amount(tiny::tx& tx);
bool process_block_hash(const uint256& blockhash, bool reorging = false);
bool read_entry();
long tell() { return ftell(in_fp); }
void flush() { fflush(in_fp); }
void confirm(uint32_t height, const uint256& hash, tiny::block& b);
};
} // namespace mff
#endif // included_mff_ajb_h_