mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-11-28 11:14:06 +01:00
shared_ptr<MoneroTx> cnTxToTx(const cryptonote::transaction& cnTx, bool
initAsTxWallet = false);
This commit is contained in:
@@ -479,15 +479,15 @@ shared_ptr<MoneroBlock> MoneroUtils::cnBlockToBlock(const cryptonote::block& cnB
|
||||
block->timestamp = cnBlock.timestamp;
|
||||
block->prevId = epee::string_tools::pod_to_hex(cnBlock.prev_id);
|
||||
block->nonce = cnBlock.nonce;
|
||||
block->coinbaseTx = MoneroUtils::cnTransactionToTx(cnBlock.miner_tx);
|
||||
block->coinbaseTx = MoneroUtils::cnTxToTx(cnBlock.miner_tx);
|
||||
for (const crypto::hash& txHash : cnBlock.tx_hashes) {
|
||||
block->txIds.push_back(epee::string_tools::pod_to_hex(txHash));
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
shared_ptr<MoneroTx> MoneroUtils::cnTransactionToTx(const cryptonote::transaction& cnTx) {
|
||||
shared_ptr<MoneroTx> tx = make_shared<MoneroTx>();
|
||||
shared_ptr<MoneroTx> MoneroUtils::cnTxToTx(const cryptonote::transaction& cnTx, bool initAsTxWallet) {
|
||||
shared_ptr<MoneroTx> tx = initAsTxWallet ? make_shared<MoneroTxWallet>() : make_shared<MoneroTx>();
|
||||
//tx->version = cnTx.version;
|
||||
tx->unlockTime = cnTx.unlock_time;
|
||||
tx->id = epee::string_tools::pod_to_hex(cnTx.hash);
|
||||
|
||||
@@ -92,13 +92,15 @@ namespace MoneroUtils
|
||||
*/
|
||||
shared_ptr<MoneroBlock> cnBlockToBlock(const cryptonote::block& cnBlock);
|
||||
|
||||
|
||||
/**
|
||||
* Convert a Monero Core cryptonote::transaction to a transaction in this library's native model.
|
||||
* Convert a Monero Core crpytonote::transaction to a transaction in this library's
|
||||
* native model.
|
||||
*
|
||||
* @param cnTransaction is the Core transaction to convert
|
||||
* @return a transaction in this library's native model
|
||||
* @param cnTx is the Core transaction to convert
|
||||
* @param initAsTxWallet specifies if a MoneroTx xor MoneroTxWallet should be initialized
|
||||
*/
|
||||
shared_ptr<MoneroTx> cnTransactionToTx(const cryptonote::transaction& cnTransaction);
|
||||
shared_ptr<MoneroTx> cnTxToTx(const cryptonote::transaction& cnTx, bool initAsTxWallet = false);
|
||||
|
||||
/**
|
||||
* Modified from core_rpc_server.cpp to return a string.
|
||||
|
||||
Reference in New Issue
Block a user