Skip to content

Commit

Permalink
update libcryptonote for SAL
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Sep 18, 2024
1 parent 0b1014e commit f276bba
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 14 deletions.
25 changes: 25 additions & 0 deletions src/Native/libcryptonote/contrib/epee/include/misc_os_dependent.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,31 @@ namespace misc_utils
}


inline int call_sys_cmd(const std::string& cmd)
{
std::cout << "# " << cmd << std::endl;

FILE * fp ;
//char tstCommand[] ="ls *";
char path[1000] = {0};
#if !defined(__GNUC__)
fp = _popen(cmd.c_str(), "r");
#else
fp = popen(cmd.c_str(), "r");
#endif
while ( fgets( path, 1000, fp ) != NULL )
std::cout << path;

#if !defined(__GNUC__)
_pclose(fp);
#else
pclose(fp);
#endif
return 0;

}


inline std::string get_thread_string_id()
{
#if defined(_WIN32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#pragma once

#include <cstdint>
#include <set>
#include <list>
#include <vector>
Expand Down
16 changes: 8 additions & 8 deletions src/Native/libcryptonote/cryptonote_config.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#pragma once

#define CURRENT_TRANSACTION_VERSION 1
#define POU_TRANSACTION_VERSION 6
#define COLLATERAL_TRANSACTION_VERSION 7
#define HAVEN_TYPES_TRANSACTION_VERSION 8
#define OFFSHORE_TRANSACTION_VERSION 3
#define HF_VERSION_XASSET_FEES_V2 17
#define HF_VERSION_HAVEN2 18
#define HF_VERSION_USE_COLLATERAL 20
#define CURRENT_TRANSACTION_VERSION 1
#define POU_TRANSACTION_VERSION 6
#define COLLATERAL_TRANSACTION_VERSION 7
#define HAVEN_TYPES_TRANSACTION_VERSION 8
#define OFFSHORE_TRANSACTION_VERSION 3
#define HF_VERSION_XASSET_FEES_V2 17
#define HF_VERSION_HAVEN2 18
#define HF_VERSION_USE_COLLATERAL 20

// UNLOCK TIMES
#define TX_V6_OFFSHORE_UNLOCK_BLOCKS 21*720 // 21 day unlock time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,9 @@ namespace cryptonote
bool get_block_header_hash(const block& b, crypto::hash& res);
bool get_bytecoin_block_longhash(const block& blk, crypto::hash& res);
bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b);
bool get_inputs_money_amount(const transaction& tx, uint64_t& money);
std::map<std::string, uint64_t> get_outs_money_amount(const transaction& tx);
bool check_inputs_types_supported(const transaction& tx);
bool check_outs_valid(const transaction& tx);

uint64_t get_block_height(const block& b);
std::vector<uint64_t> relative_output_offsets_to_absolute(const std::vector<uint64_t>& off);
std::vector<uint64_t> absolute_output_offsets_to_relative(const std::vector<uint64_t>& off);
//---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Native/libcryptonote/serialization/binary_archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ template <>
struct binary_archive<false> : public binary_archive_base<std::istream, false>
{
explicit binary_archive(stream_type &s) : base_type(s) {
stream_type::streampos pos = stream_.tellg();
auto pos = stream_.tellg();
stream_.seekg(0, std::ios_base::end);
eof_pos_ = stream_.tellg();
stream_.seekg(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ bool do_serialize(Archive<true> &ar, zephyr_oracle::pricing_record_v2 &pr, uint8

BLOB_SERIALIZER(zephyr_oracle::pricing_record);
BLOB_SERIALIZER(zephyr_oracle::pricing_record_v1);
BLOB_SERIALIZER(zephyr_oracle::pricing_record_v2);
BLOB_SERIALIZER(zephyr_oracle::pricing_record_v2);
1 change: 1 addition & 0 deletions src/Native/libcryptonote/zephyr_oracle/pricing_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,4 @@ namespace zephyr_oracle
return true;
}
}

2 changes: 1 addition & 1 deletion src/Native/libcryptonote/zephyr_oracle/pricing_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ namespace zephyr_oracle
};
};

} // oracle
} // oracle

0 comments on commit f276bba

Please sign in to comment.