some fixes

This commit is contained in:
Antonio Juarez 2014-03-20 11:46:11 +00:00
parent 296ae46ed8
commit 8efa1313f3
67 changed files with 1523 additions and 757 deletions

View file

@ -102,7 +102,8 @@ bool transactions_flow_test(std::string& working_folder,
return false;
}
size_t blocks_fetched = 0;
if(!w1.refresh(blocks_fetched))
tools::wallet2::fail_details fd;
if(!w1.refresh(blocks_fetched, fd))
{
LOG_ERROR( "failed to refresh source wallet from " << daemon_addr_a );
return false;
@ -134,11 +135,11 @@ bool transactions_flow_test(std::string& working_folder,
CHECK_AND_ASSERT_MES(daemon_rsp.status == CORE_RPC_STATUS_OK, false, "failed to getrandom_outs.bin");
//wait for money, until balance will have enough money
w1.refresh(blocks_fetched);
w1.refresh(blocks_fetched, fd);
while(w1.unlocked_balance() < amount_to_transfer)
{
misc_utils::sleep_no_w(1000);
w1.refresh(blocks_fetched);
w1.refresh(blocks_fetched, fd);
}
//lets make a lot of small outs to ourselves
@ -165,7 +166,7 @@ bool transactions_flow_test(std::string& working_folder,
}else
{
misc_utils::sleep_no_w(1000);
w1.refresh();
w1.refresh(fd);
}
}
//do actual transfer
@ -187,7 +188,7 @@ bool transactions_flow_test(std::string& working_folder,
{
misc_utils::sleep_no_w(1000);
LOG_PRINT_L0("not enough money, waiting for cashback or mining");
w1.refresh(blocks_fetched);
w1.refresh(blocks_fetched, fd);
}
transaction tx;
@ -202,7 +203,7 @@ bool transactions_flow_test(std::string& working_folder,
if(!do_send_money(w1, w2, mix_in_factor, amount_to_tx, tx))
{
LOG_PRINT_L0("failed to transfer money, tx: " << get_transaction_hash(tx) << ", refresh and try again" );
w1.refresh(blocks_fetched);
w1.refresh(blocks_fetched, fd);
if(!do_send_money(w1, w2, mix_in_factor, amount_to_tx, tx))
{
LOG_PRINT_L0( "failed to transfer money, second chance. tx: " << get_transaction_hash(tx) << ", exit" );
@ -227,7 +228,7 @@ bool transactions_flow_test(std::string& working_folder,
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) && ( (blocks_fetched && recvd_money) || !blocks_fetched ) )
while(w2.refresh(blocks_fetched, recvd_money, fd) && ( (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
}