vtnerd / monero-lws

Monero Light Wallet Server (scans monero viewkeys and implements mymonero API). Fast LMDB backend.
BSD 3-Clause "New" or "Revised" License
77 stars 28 forks source link

Compile error #151

Open paulshapiro opened 3 days ago

paulshapiro commented 3 days ago

Hey there,

Thought I'd mention that develop has a compile error that seems to be unintentional - where const memory of epee::byte_slice::data() is being asked to be used to initialize a mutable (non-const) object

#15 3.653 /monero-lws/src/rpc/scanner/connection.cpp: In member function 'boost::asio::mutable_buffer lws::rpc::scanner::connection::read_buffer(std::size_t)':
#15 3.653 /monero-lws/src/rpc/scanner/connection.cpp:58:54: warning: invalid conversion from 'const void*' to 'void*' [-fpermissive]
#15 3.653    58 |     return boost::asio::mutable_buffer(read_buf_.data(), size);
#15 3.653       |                                        ~~~~~~~~~~~~~~^~
#15 3.653       |                                                      |
#15 3.653       |                                                      const void*
#15 3.653 In file included from /monero-lws/src/rpc/scanner/connection.h:30,
#15 3.653                  from /monero-lws/src/rpc/scanner/connection.cpp:28:
#15 3.653 /usr/include/boost/asio/buffer.hpp:102:24: note:   initializing argument 1 of 'boost::asio::mutable_buffer::mutable_buffer(void*, std::size_t)'
#15 3.653   102 |   mutable_buffer(void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
#15 3.653       |                  ~~~~~~^~~~

https://github.com/vtnerd/monero-lws/blob/18b57435966fb829024a6dce8d3883e6115a1f5e/src/rpc/scanner/connection.cpp#L58

vtnerd commented 3 days ago

This currently occurs if building develop LWS with release-v0.18 Monero. Switching to master Monero branch will compile. A PR for the release-v0.18 branch has been approved and is waiting a merge.

Typically LWS master and develop branches target the master branch of Monero - although some attempts are made to get those branches working against Monero release-* branches.

The release branches of LWS always target some release branch of Monero.