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

3 jobs from master in 4 minutes 36 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #3869
build_cmake

01:07

 
  Test
passed #3870
run_tests

01:06

 
  Sanitizer
passed #3871
run_address_sanitizer

02:22