WIP: Re-Work resource-trading implementation to fix race condition.

3 jobs from master in 4 minutes 39 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Build
passed #3872
build_cmake

01:06

 
  Test
passed #3873
run_tests

01:10

 
  Sanitizer
passed #3874
run_address_sanitizer

02:23