jgarzik / univalue

High performance RAII C++ JSON library and universal value object class
MIT License
55 stars 77 forks source link

error: no viable conversion from 'std::atomic<int>' to 'const UniValue' #76

Open luke-jr opened 3 years ago

luke-jr commented 3 years ago

Regression introduced by PR #61

With GCC 9.3.0, building Bitcoin Core 0.17+:

rpc/blockchain.cpp:2077:35: error: no viable conversion from 'std::atomic<int>' to 'const UniValue'
        result.pushKV("progress", g_scan_progress);
                                  ^~~~~~~~~~~~~~~
luke-jr commented 3 years ago

@promag

promag commented 3 years ago

You think it should be reverted or that code should change to g_scan_progress.load()?

luke-jr commented 3 years ago

If the API is going to change, it should wait for 2.0 I guess

luke-jr commented 3 years ago

(It does seem cleaner to simply allow it implicitly, though)