CHECK_AND_ASSERT_MES(cumulative_size==txs_size+get_object_blobsize(b.miner_tx),false,"unexpected case: cumulative_size="<<cumulative_size<<" is not equal txs_cumulative_size="<<txs_size<<" + get_object_blobsize(b.miner_tx)="<<get_object_blobsize(b.miner_tx));
CHECK_AND_ASSERT_MES(!tx.extra[i],false,"Failed to parse transaction extra (not 0 after padding) in tx "<<get_transaction_hash(tx));
}
elseif(tx.extra[i]==TX_EXTRA_TAG_PUBKEY)
{
CHECK_AND_ASSERT_MES(sizeof(crypto::public_key)<=tx.extra.size()-1-i,false,"Failed to parse transaction extra (TX_EXTRA_TAG_PUBKEY have not enough bytes) in tx "<<get_transaction_hash(tx));
CHECK_AND_ASSERT_MES(!tx_extra_tag_pubkey_found,false,"Failed to parse transaction extra (duplicate TX_EXTRA_TAG_PUBKEY entry) in tx "<<get_transaction_hash(tx));
//CHECK_AND_ASSERT_MES(is_coinbase(tx), false, "Failed to parse transaction extra (TX_EXTRA_NONCE can be only in coinbase) in tx " << get_transaction_hash(tx));
CHECK_AND_ASSERT_MES(!tx_extra_extra_nonce_found,false,"Failed to parse transaction extra (duplicate TX_EXTRA_NONCE entry) in tx "<<get_transaction_hash(tx));
CHECK_AND_ASSERT_MES(tx.extra.size()-1-i>=1,false,"Failed to parse transaction extra (TX_EXTRA_NONCE have not enough bytes) in tx "<<get_transaction_hash(tx));
++i;
CHECK_AND_ASSERT_MES(tx.extra.size()-1-i>=tx.extra[i],false,"Failed to parse transaction extra (TX_EXTRA_NONCE have wrong bytes counter) in tx "<<get_transaction_hash(tx));
tx_extra_extra_nonce_found=true;
i+=tx.extra[i];//actually don't need to extract it now, just skip
}
elseif(!tx.extra[i])
{
padding_started=true;
continue;
}
++i;
tx_extra_fieldfield;
boolr=::do_serialize(ar,field);
CHECK_AND_NO_ASSERT_MES(r,false,"failed to deserialize extra field. extra = "<<string_tools::buff_to_hex_nodelimer(std::string(reinterpret_cast<constchar*>(tx_extra.data()),tx_extra.size())));
tx_extra_fields.push_back(field);
std::ios_base::iostatestate=iss.rdstate();
eof=(EOF==iss.peek());
iss.clear(state);
}
CHECK_AND_NO_ASSERT_MES(::serialization::check_stream_state(ar),false,"failed to deserialize extra field. extra = "<<string_tools::buff_to_hex_nodelimer(std::string(reinterpret_cast<constchar*>(tx_extra.data()),tx_extra.size())));
m_cmd_binder.set_handler("refresh",boost::bind(&simple_wallet::refresh,this,_1),"Resynchronize transactions and balance");
m_cmd_binder.set_handler("balance",boost::bind(&simple_wallet::show_balance,this,_1),"Show current wallet balance");
m_cmd_binder.set_handler("incoming_transfers",boost::bind(&simple_wallet::show_incoming_transfers,this,_1),"incoming_transfers [available|unavailable] - Show incoming transfers - all of them or filter them by availability");
m_cmd_binder.set_handler("transfer",boost::bind(&simple_wallet::transfer,this,_1),"transfer <mixin_count> <addr_1> <amount_1> [<addr_2> <amount_2> ... <addr_N> <amount_N>] - Transfer <amount_1>,... <amount_N> to <address_1>,... <address_N>, respectively. <mixin_count> is the number of transactions yours is indistinguishable from (from 0 to maximum available)");
m_cmd_binder.set_handler("transfer",boost::bind(&simple_wallet::transfer,this,_1),"transfer <mixin_count> <addr_1> <amount_1> [<addr_2> <amount_2> ... <addr_N> <amount_N>] [payment_id] - Transfer <amount_1>,... <amount_N> to <address_1>,... <address_N>, respectively. <mixin_count> is the number of transactions yours is indistinguishable from (from 0 to maximum available)");
m_cmd_binder.set_handler("set_log",boost::bind(&simple_wallet::set_log,this,_1),"set_log <level> - Change current log detalization level, <level> is a number 0-4");
m_cmd_binder.set_handler("address",boost::bind(&simple_wallet::print_address,this,_1),"Show current wallet public address");