locked correctBlockNodeIds
Fix locking
Remove envlock, add env thread.
Merge remote-tracking branch 'upstream/master' into next