core: faster find_blockchain_supplement
Since this queries block heights for blocks that may or may not exist, queries for non existing blocks would throw an exception, and that would slow down the loop a lot. 7 seconds to go through a 30 hash list. Fix this by adding an optional return block height to block_exists and using this instead. Actual errors will still throw an exception. This also cuts down on log exception spam.
This commit is contained in:
@@ -168,7 +168,7 @@ public:
|
||||
|
||||
virtual void unlock();
|
||||
|
||||
virtual bool block_exists(const crypto::hash& h) const;
|
||||
virtual bool block_exists(const crypto::hash& h, uint64_t *height = NULL) const;
|
||||
|
||||
virtual block get_block(const crypto::hash& h) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user