Commit a9ef702
committed
assumeutxo: change getchainstates RPC to return a list of chainstates
Current getchainstates RPC returns "normal" and "snapshot" fields which are not
ideal because it requires new "normal" and "snapshot" terms to be defined, and
the definitions are not really consistent with internal code. (In the RPC
interface, the "snapshot" chainstate becomes the "normal" chainstate after it
is validated, while in internal code there is no "normal chainstate" and the
"snapshot chainstate" is still called that temporarily after it is validated).
The current getchainstatees RPC is also awkward to use if you to want
information about the most-work chainstate because you have to look at the
"snapshot" field if it exists, and otherwise fall back to the "normal" field.
Fix these issues by having getchainstates just return a flat list of
chainstates ordered by work, and adding new chainstate "validated" field
alongside the existing "snapshot_blockhash" so it is explicit if a chainstate
was originally loaded from a snapshot, and whether the snapshot has been
validated.1 parent 30b3477 commit a9ef702
File tree
2 files changed
+32
-37
lines changed- src/rpc
- test/functional
2 files changed
+32
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2807 | 2807 | | |
2808 | 2808 | | |
2809 | 2809 | | |
| 2810 | + | |
2810 | 2811 | | |
2811 | 2812 | | |
2812 | 2813 | | |
| |||
2818 | 2819 | | |
2819 | 2820 | | |
2820 | 2821 | | |
2821 | | - | |
2822 | | - | |
| 2822 | + | |
2823 | 2823 | | |
2824 | 2824 | | |
2825 | 2825 | | |
| |||
2834 | 2834 | | |
2835 | 2835 | | |
2836 | 2836 | | |
2837 | | - | |
| 2837 | + | |
2838 | 2838 | | |
2839 | 2839 | | |
2840 | 2840 | | |
| |||
2852 | 2852 | | |
2853 | 2853 | | |
2854 | 2854 | | |
| 2855 | + | |
2855 | 2856 | | |
2856 | 2857 | | |
2857 | 2858 | | |
2858 | | - | |
2859 | | - | |
2860 | | - | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
2867 | 2859 | | |
2868 | 2860 | | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
2869 | 2867 | | |
2870 | 2868 | | |
2871 | 2869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 165 | + | |
171 | 166 | | |
172 | 167 | | |
173 | 168 | | |
174 | | - | |
175 | | - | |
| 169 | + | |
176 | 170 | | |
177 | 171 | | |
178 | 172 | | |
| |||
189 | 183 | | |
190 | 184 | | |
191 | 185 | | |
192 | | - | |
193 | | - | |
| 186 | + | |
| 187 | + | |
194 | 188 | | |
195 | 189 | | |
196 | 190 | | |
| |||
208 | 202 | | |
209 | 203 | | |
210 | 204 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
215 | 212 | | |
216 | 213 | | |
217 | | - | |
| 214 | + | |
218 | 215 | | |
219 | 216 | | |
220 | 217 | | |
221 | | - | |
| 218 | + | |
222 | 219 | | |
223 | 220 | | |
224 | 221 | | |
| |||
234 | 231 | | |
235 | 232 | | |
236 | 233 | | |
237 | | - | |
238 | | - | |
| 234 | + | |
| 235 | + | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
| |||
0 commit comments