[bitshares/bitshares-core] Fix : Segmentation fault when running several witness nodes on the same machine (#1286)

#377
There is a case when a value of undo_db.size() is greater then head_block_num(), and as result we get a wrong value for last_non_undoable_block_num. To resolve it we should take into account a number of active_sessions in calculations of last_non_undoable_block_num (active sessions are related to a new block which is under generation).
You can view, comment on, or merge this pull request online at:

https://github.com/bitshares/bitshares-core/pull/1286

— Commit Summary —

* Fix : Segmentation fault when running several witness nodes on the same machine
* Fix: Segmentation fault when running several witness nodes on the

— File Changes —

M libraries/chain/db_getter.cpp (9)
M libraries/db/include/graphene/db/undo_database.hpp (1)

— Patch Links —

https://github.com/bitshares/bitshares-core/pull/1286.patch
https://github.com/bitshares/bitshares-core/pull/1286.diff