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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
crate::ix!();
/**
| Specialization of CCoinsViewCursor
| to iterate over a CCoinsViewDB
|
*/
pub struct CoinsViewDBCursor<'db> {
base: CoinsViewCursor,
pcursor: Box<DBIterator<'db>>,
key_tmp: (u8,OutPoint),
}
impl<'db> CoinsViewDBCursor<'db> {
/**
| Prefer using CCoinsViewDB::Cursor()
| since we want to perform some cache warmup
| on instantiation.
|
*/
pub fn new(
pcursor_in: *mut DBIterator<'db>,
hash_block_in: &u256) -> Self {
todo!();
/*
: coins_view_cursor(hashBlockIn),
: pcursor(pcursorIn),
*/
}
pub fn get_key(&self, key: &mut OutPoint) -> bool {
todo!();
/*
// Return cached key
if (keyTmp.first == DB_COIN) {
key = keyTmp.second;
return true;
}
return false;
*/
}
pub fn get_value(&self, coin: &mut Coin) -> bool {
todo!();
/*
return pcursor->GetValue(coin);
*/
}
pub fn get_value_size(&self) -> u32 {
todo!();
/*
return pcursor->GetValueSize();
*/
}
pub fn valid(&self) -> bool {
todo!();
/*
return keyTmp.first == DB_COIN;
*/
}
pub fn next(&mut self) {
todo!();
/*
pcursor->Next();
CoinEntry entry(&keyTmp.second);
if (!pcursor->Valid() || !pcursor->GetKey(entry)) {
keyTmp.first = 0; // Invalidate cached key after last record so that Valid() and GetKey() return false
} else {
keyTmp.first = entry.key;
}
*/
}
}