There is a virtual_op field in operation_history_object, related code is here. Questions:
what's the supposed use case of this data? I noticed recently it's used in GUI to sort account history, which is introduced as a fix of issue 793.
however, in witness_node, this data is filled with the variable _current_virtual_op in database.hpp with this code, but _current_virtual_op has never been saved to or loaded from disk. So if witness_node is started without --replay-blockchain, _current_virtual_op is reset to 0, then every new operation_history_object saved to database contains a virtual_op value which would be already assigned to an old operation_history_object, thus the logic in above fix is not totally reliable.
Thoughts?
//Edit: logic in the GUI fix is correct, because it compares block_num first, then compares virtual_op.
There is a
virtual_op
field inoperation_history_object
, related code is here. Questions:_current_virtual_op
indatabase.hpp
with this code, but_current_virtual_op
has never been saved to or loaded from disk. So ifwitness_node
is started without--replay-blockchain
,_current_virtual_op
is reset to 0, then every newoperation_history_object
saved to database contains avirtual_op
value which would be already assigned to an oldoperation_history_object
, thus the logic in above fix is not totally reliable.Thoughts?
//Edit: logic in the GUI fix is correct, because it compares
block_num
first, then comparesvirtual_op
.