mirror of
https://github.com/monero-project/monero.git
synced 2025-12-08 16:11:28 +09:00
Compare commits
6 Commits
bdce2fe089
...
7fe199facc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fe199facc | ||
|
|
a764f5a42a | ||
|
|
0229f6fdde | ||
|
|
07dcc49bd7 | ||
|
|
ca484323c3 | ||
|
|
a5b2ad04c5 |
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -45,6 +45,7 @@ jobs:
|
||||
- uses: ./.github/actions/set-make-job-count
|
||||
- name: install dependencies
|
||||
run: |
|
||||
brew uninstall cmake
|
||||
brew update
|
||||
brew install --quiet cmake boost hidapi openssl zmq miniupnpc expat libunwind-headers protobuf ccache
|
||||
- name: build
|
||||
|
||||
@ -92,7 +92,13 @@ namespace net_utils
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool parse_port(const std::string& port_str, uint64_t& out_port)
|
||||
{
|
||||
out_port = 0;
|
||||
return boost::conversion::try_lexical_convert(port_str, out_port) && out_port <= 65535;
|
||||
}
|
||||
|
||||
bool parse_uri(const std::string uri, http::uri_content& content)
|
||||
{
|
||||
|
||||
@ -153,7 +159,8 @@ namespace net_utils
|
||||
}
|
||||
if(result[6].matched)
|
||||
{
|
||||
content.port = boost::lexical_cast<uint64_t>(result[6]);
|
||||
if (!parse_port(result[6].str(), content.port))
|
||||
return false;
|
||||
}
|
||||
if(result[7].matched)
|
||||
{
|
||||
@ -189,7 +196,8 @@ namespace net_utils
|
||||
}
|
||||
if(result[6].matched)
|
||||
{
|
||||
content.port = boost::lexical_cast<uint64_t>(result[6]);
|
||||
if (!parse_port(result[6].str(), content.port))
|
||||
return false;
|
||||
}
|
||||
if(result[7].matched)
|
||||
{
|
||||
|
||||
@ -2399,14 +2399,15 @@ bool BlockchainLMDB::for_all_alt_blocks(std::function<bool(const crypto::hash&,
|
||||
const crypto::hash &blkid = *(const crypto::hash*)k.mv_data;
|
||||
if (v.mv_size < sizeof(alt_block_data_t))
|
||||
throw0(DB_ERROR("alt_blocks record is too small"));
|
||||
const alt_block_data_t *data = (const alt_block_data_t*)v.mv_data;
|
||||
alt_block_data_t data;
|
||||
memcpy(&data, v.mv_data, sizeof(data));
|
||||
cryptonote::blobdata_ref bd;
|
||||
if (include_blob)
|
||||
{
|
||||
bd = {reinterpret_cast<const char*>(v.mv_data) + sizeof(alt_block_data_t), v.mv_size - sizeof(alt_block_data_t)};
|
||||
}
|
||||
|
||||
if (!f(blkid, *data, &bd)) {
|
||||
if (!f(blkid, data, &bd)) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
@ -4519,11 +4520,10 @@ bool BlockchainLMDB::get_alt_block(const crypto::hash &blkid, alt_block_data_t *
|
||||
if (v.mv_size < sizeof(alt_block_data_t))
|
||||
throw0(DB_ERROR("Record size is less than expected"));
|
||||
|
||||
const alt_block_data_t *ptr = (const alt_block_data_t*)v.mv_data;
|
||||
if (data)
|
||||
*data = *ptr;
|
||||
memcpy(data, v.mv_data, sizeof(alt_block_data_t));
|
||||
if (blob)
|
||||
blob->assign((const char*)(ptr + 1), v.mv_size - sizeof(alt_block_data_t));
|
||||
blob->assign(((const char*)(v.mv_data)) + sizeof(alt_block_data_t), v.mv_size - sizeof(alt_block_data_t));
|
||||
|
||||
TXN_POSTFIX_RDONLY();
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user