monero
monero copied to clipboard
Provide last error from http client to UI
This stores the last std::error_code
while doing HTTP client I/O to make it available to UIs. With Boost 1.65+ this provides more useful messages with the CLI wallet, and hopefully GUI wallet too. The primary purpose is for an (shortly) upcoming DANE/TLSA patch that uses DNSSEC for the "autodetect" SSL mode with wallets. I broke this into its own patch because its useful even if the DANE/TLSA patch is rejected or reverted.
Our release binaries use boost 1.64. Would it be useful to bump it? If yes, which version would you suggest?
Our release binaries use boost 1.64. Would it be useful to bump it? If yes, which version would you suggest?
Crap. I should've checked before doing this work. Its useful to get this fixed because the official release builds will not have useful messages displayed in the UI.
It should be possible to re-write the patch around boost::system::error_code
so that upgrading is unnecessary. In hindsight, it may have been a mistake to use std::error_code
previously given our reliance on Boost (and ASIO in particular). And Boost 1.69+ can have constexpr
error_category
objects. This may incur the wraith of some reviewers because it'll result in yet another PR by me to convert things.
OTOH, Boost provides a boost::system::error_code
-> std::error_code
conversion (that's kind of clunky IMO) in Boost 1.65+, and Boost provides no support for older releases.
@selsta do you know how Boost 1.64 was selected previously? Just because it was the latest release?
AFAIK there is no reason for Boost 1.64. We can upgrade to Boost 1.68 without any changes (#6693), if we want a even newer version some changes to the depends build system are necessary.
@0xFFFC0000 @jeffro256 @j-berman This has been around for years, and will help with a potential DANE/TSLA or trust-on-first patch. It simply stores the last error_code
in the http client, so that it can be displayed to the user UI.
Forgot to add, I made the changes moo suggested years ago, and rebased.
LGTM too.
Force pushed a fix to api/wallet.cpp
.
@selsta can this get in the merge queue?
@jeffro256 @0xFFFC0000 @selsta I made a mistake in not updating all of the check_connection
calls. I instead decided against inverting the call behavior, and instead added a boost::system::error_code*
function parameter. Let's see if this goes green (it should).
So please look/inspect again!