Merge pull request #229

7b01a07 added tx size to incoming_transfers RPC Call (Riccardo Spagni)
This commit is contained in:
Riccardo Spagni 2015-02-20 00:59:47 +02:00
commit e728992803
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
2 changed files with 4 additions and 0 deletions

View file

@ -431,11 +431,13 @@ namespace tools
{ {
transfers_found = true; transfers_found = true;
} }
auto txBlob = t_serializable_object_to_blob(td.m_tx);
wallet_rpc::transfer_details rpc_transfers; wallet_rpc::transfer_details rpc_transfers;
rpc_transfers.amount = td.amount(); rpc_transfers.amount = td.amount();
rpc_transfers.spent = td.m_spent; rpc_transfers.spent = td.m_spent;
rpc_transfers.global_index = td.m_global_output_index; rpc_transfers.global_index = td.m_global_output_index;
rpc_transfers.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(td.m_tx)); rpc_transfers.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(td.m_tx));
rpc_transfers.tx_size = txBlob.size();
res.transfers.push_back(rpc_transfers); res.transfers.push_back(rpc_transfers);
} }
} }

View file

@ -228,12 +228,14 @@ namespace wallet_rpc
bool spent; bool spent;
uint64_t global_index; uint64_t global_index;
std::string tx_hash; std::string tx_hash;
uint64_t tx_size;
BEGIN_KV_SERIALIZE_MAP() BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(amount) KV_SERIALIZE(amount)
KV_SERIALIZE(spent) KV_SERIALIZE(spent)
KV_SERIALIZE(global_index) KV_SERIALIZE(global_index)
KV_SERIALIZE(tx_hash) KV_SERIALIZE(tx_hash)
KV_SERIALIZE(tx_size)
END_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP()
}; };