hyperledger-iroha / iroha-dco

Iroha - A simple, decentralized ledger
http://iroha.tech
Apache License 2.0
988 stars 296 forks source link

MstState: fixed issues. #2208

Closed MBoldyrev closed 5 years ago

MBoldyrev commented 5 years ago

Description of the Change

The priority queue index_ in MstState is expected to be sorted in the order of batches expiration, but that does not hold in general case when the queue gets sorted by the first transaction timestamp. This change sorts the queue by the oldest transaction timestamp to fix the issue.

UPDATE

The index type was changed to

Benefits

Fixed MstState::eraseByTime and storage cleanup.

Possible Drawbacks

Additional boost includes present in the mst_state.hpp header. Removed MstState::operator==(const MstState &rhs).

Usage Examples or Tests [optional]

Alternate Designs [optional]

Rework MstState with pimpl to hide the includes.