1
0
Fork 0
forked from lthn/blockchain

Merge branch 'master' into frontend

This commit is contained in:
wildkif 2019-05-05 15:39:27 +03:00
commit 03261f4013
5 changed files with 5 additions and 47 deletions

View file

@ -51,7 +51,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif()
if(MSVC)
add_definitions("/bigobj /Zm1000 /Z7 /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4503 /wd4345 /wd4091 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
add_definitions("/D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /D__SSE4_1__")
add_compile_options(/bigobj /Zm1000 /Z7 /MP2 /W3 /GS- /wd4996 /wd4503 /wd4345 /wd4091 /FIinline_c.h)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760 /DEBUG dbghelp.lib")
if(STATIC)
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)

View file

@ -2,6 +2,6 @@
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.0"
#define PROJECT_VERSION_BUILD_NO 17
#define PROJECT_VERSION_BUILD_NO 19
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"

View file

@ -2120,7 +2120,7 @@ uint64_t wallet2::balance(uint64_t& unloked, uint64_t& awaiting_in, uint64_t& aw
for(auto& td : m_transfers)
{
if (td.is_spendable())
if (td.is_spendable() || td.is_reserved_for_escrow())
{
balance_total += td.amount();
if (is_transfer_unlocked(td))

View file

@ -369,6 +369,7 @@ namespace tools
uint64_t amount() const { return m_ptx_wallet_info->m_tx.vout[m_internal_output_index].amount; }
bool is_spent() const { return m_flags & WALLET_TRANSFER_DETAIL_FLAG_SPENT; }
bool is_spendable() const { return (m_flags & (~WALLET_TRANSFER_DETAIL_FLAG_MINED_TRANSFER)) == 0; } // spenable = has no flags or mined flag only
bool is_reserved_for_escrow() const { return ( (m_flags & WALLET_TRANSFER_DETAIL_FLAG_ESCROW_PROPOSAL_RESERVATION) != 0 ); }
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_CUSTOM(m_ptx_wallet_info, const transaction_wallet_info&, tools::wallet2::transform_ptr_to_value, tools::wallet2::transform_value_to_ptr)

View file

@ -599,50 +599,6 @@ bool transactions_flow_test(
w1.store();
LOG_PRINT_GREEN("Wallet stored OK", LOG_LEVEL_0);
//
//
// LOG_PRINT_L0( "waiting some new blocks...");
// misc_utils::sleep_no_w(DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN*20*1000);//wait two blocks before sync on another wallet on another daemon
// LOG_PRINT_L0( "Refreshing...");
// bool recvd_money = false;
// while(w2.refresh(blocks_fetched, recvd_money, ok, stop) && ( (blocks_fetched && recvd_money) || !blocks_fetched ) )
// {
// misc_utils::sleep_no_w(DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN*1000);//wait two blocks before sync on another wallet on another daemon
// }
//
// uint64_t money_2 = w2.balance();
// if(money_2 == transfered_money)
// {
// LOG_PRINT_GREEN("-----------------------FINISHING TRANSACTIONS FLOW TEST OK-----------------------", LOG_LEVEL_0);
// LOG_PRINT_GREEN("transferred " << print_money(transfered_money) << " via " << i << " transactions" , LOG_LEVEL_0);
// return true;
// }else
// {
// tools::wallet2::transfer_container tc;
// w2.get_transfers(tc);
// BOOST_FOREACH(tools::wallet2::transfer_details& td, tc)
// {
// auto it = txs.find(get_transaction_hash(td.m_ptx_wallet_info->m_tx));
// CHECK_AND_ASSERT_MES(it != txs.end(), false, "transaction not found in local cache");
// it->second.m_received_count += 1;
// }
//
// BOOST_FOREACH(auto& tx_pair, txs)
// {
// if(tx_pair.second.m_received_count != 1)
// {
// LOG_PRINT_RED_L0("Transaction lost: " << get_transaction_hash(tx_pair.second.tx));
// }
//
// }
//
// LOG_PRINT_RED_L0("-----------------------FINISHING TRANSACTIONS FLOW TEST FAILED-----------------------" );
// LOG_PRINT_RED_L0("income " << print_money(money_2) << " via " << i << " transactions, expected money = " << print_money(transfered_money) );
// LOCAL_ASSERT(false);
// return false;
// }
return true;
}