Commit 0cdddeb
committed
kernel: Move block tree db open to BlockManager constructor
Make the block db open RAII style by calling it in the BlockManager
constructor.
Before this change the block tree db was needlessly re-opened during
startup when loading a completed snapshot. Improve this by letting the
block manager open it on construction. This also simplifies the test
code a bit.
The change was initially motivated to make it easier for users of the
kernel library to instantiate a BlockManager that may be used to read
data from disk without loading the block index into a cache.1 parent 7fbb1bc commit 0cdddeb
File tree
5 files changed
+23
-28
lines changed- src
- node
- test/util
5 files changed
+23
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1218 | 1222 | | |
1219 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1220 | 1227 | | |
1221 | 1228 | | |
1222 | 1229 | | |
1223 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
1224 | 1233 | | |
1225 | 1234 | | |
1226 | 1235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
1183 | 1184 | | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | | - | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1187 | 1200 | | |
1188 | 1201 | | |
1189 | 1202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
273 | 271 | | |
274 | 272 | | |
275 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 38 | | |
62 | 39 | | |
63 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | 260 | | |
263 | 261 | | |
264 | 262 | | |
| |||
0 commit comments