OlinCoin
Test
src
includes
txs
wallet_pool.h
1
#pragma once
2
3
#include "constants.h"
4
#include "uthash.h"
5
#include "utxo_pool.h"
6
#include "init_db.h"
7
8
typedef
struct
{
9
mbedtls_ecdsa_context *key_pair;
10
unsigned
long
amt;
11
int
spent;
// True when included in a tx but not validated in a block
12
}
WalletEntry
;
13
14
typedef
struct
{
15
UTXOPoolKey
id;
16
WalletEntry
*entry;
17
UT_hash_handle hh;
18
}
WalletPool
;
19
20
typedef
struct
{
21
unsigned
char
public_key_hash[PUB_KEY_HASH_LEN];
22
mbedtls_ecdsa_context *key_pair;
23
UT_hash_handle hh;
24
}
KeyPool
;
25
26
char
*key_pool_path;
27
leveldb_t *key_pool_db;
// Level DB Database
28
char
*wallet_pool_path;
29
leveldb_t *wallet_pool_db;
// Level DB Database
30
31
38
int
wallet_init_leveldb(
char
*db_env);
39
44
void
destroy_wallet();
45
56
int
wallet_pool_build_add_leveldb(
Transaction
*tx,
unsigned
int
vout, mbedtls_ecdsa_context *key_pair);
57
65
int
wallet_pool_add_wallet_entry_leveldb(
unsigned
char
*db_key,
WalletEntry
*entry);
66
75
int
wallet_pool_find_leveldb(
WalletEntry
**found_entry,
unsigned
char
*tx_hash,
unsigned
int
vout);
76
84
int
wallet_pool_remove_leveldb(
unsigned
char
*tx_hash,
unsigned
int
vout);
85
92
int
wallet_pool_count(
unsigned
int
*num_entries);
93
100
int
key_pool_add_leveldb(mbedtls_ecp_keypair *key_pair);
101
109
int
key_pool_find_leveldb(mbedtls_ecdsa_context **keypair,
unsigned
char
*public_key_hash);
110
117
int
key_pool_remove_leveldb(
unsigned
char
*public_key_hash);
118
125
int
key_pool_count(
unsigned
int
*num_entries);
126
136
mbedtls_ecdsa_context *check_if_output_unlockable_leveldb(
Transaction
*tx,
unsigned
int
vout);
KeyPool
Definition:
wallet_pool.h:20
Transaction
Definition:
base_tx.h:19
UTXOPoolKey
Definition:
utxo_pool.h:9
WalletEntry
Definition:
wallet_pool.h:8
WalletPool
Definition:
wallet_pool.h:14
Generated by
1.9.3