mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-17 23:31:32 +02:00
blocks returning from jni as array but without txs
This commit is contained in:
@@ -146,7 +146,12 @@ boost::property_tree::ptree MoneroUtils::toPropertyTree(const MoneroSubaddress&
|
||||
return subaddressNode;
|
||||
}
|
||||
|
||||
// blockToPropertyTree
|
||||
boost::property_tree::ptree MoneroUtils::toPropertyTree(const MoneroBlock& block) {
|
||||
cout << "toPropertyTree(block)" << endl;
|
||||
boost::property_tree::ptree blockNode;
|
||||
if (block.height != boost::none) blockNode.put("height", *block.height); // TODO: finish this, add txs
|
||||
return blockNode;
|
||||
}
|
||||
|
||||
boost::property_tree::ptree MoneroUtils::txToPropertyTree(const MoneroTx& tx) {
|
||||
cout << "txToPropertyTree(tx)" << endl;
|
||||
|
||||
@@ -66,6 +66,8 @@ namespace MoneroUtils
|
||||
|
||||
boost::property_tree::ptree toPropertyTree(const MoneroSubaddress& subaddress);
|
||||
|
||||
boost::property_tree::ptree toPropertyTree(const MoneroBlock& block);
|
||||
|
||||
boost::property_tree::ptree txToPropertyTree(const MoneroTx& tx);
|
||||
|
||||
boost::property_tree::ptree txWalletToPropertyTree(const MoneroTxWallet& tx);
|
||||
|
||||
@@ -21,11 +21,19 @@ namespace monero {
|
||||
|
||||
MoneroTransfer wallet2ToIncomingTransfer(const crypto::hash &txid, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd) {
|
||||
cout << "wallet2ToIncomingTransfer(3)" << endl;
|
||||
|
||||
MoneroBlock block;
|
||||
block.height = pd.m_block_height;
|
||||
|
||||
MoneroTxWallet tx;
|
||||
tx.id = string_tools::pod_to_hex(pd.m_tx_hash);
|
||||
tx.block = make_shared<MoneroBlock>(block);
|
||||
|
||||
MoneroIncomingTransfer incomingTransfer;
|
||||
tx.incomingTransfers.push_back(incomingTransfer);
|
||||
incomingTransfer.tx = make_shared<MoneroTxWallet>(tx);
|
||||
|
||||
tx.incomingTransfers.push_back(incomingTransfer);
|
||||
block.txs.push_back(make_shared<MoneroTxWallet>(tx));
|
||||
return incomingTransfer;
|
||||
}
|
||||
|
||||
@@ -525,17 +533,17 @@ namespace monero {
|
||||
|
||||
// get confirmed outgoing transfers
|
||||
if (isOut) {
|
||||
throw runtime_error("isOut not implemented");
|
||||
//throw runtime_error("isOut not implemented");
|
||||
}
|
||||
|
||||
// get unconfirmed outgoing transfers
|
||||
if (isPending || isFailed) {
|
||||
throw runtime_error("isPending || isFailed not implemented");
|
||||
//throw runtime_error("isPending || isFailed not implemented");
|
||||
}
|
||||
|
||||
// get unconfirmed incoming transfers
|
||||
if (isPool) {
|
||||
throw runtime_error("isPool not implemented");
|
||||
//throw runtime_error("isPool not implemented");
|
||||
}
|
||||
|
||||
return transfers;
|
||||
|
||||
Reference in New Issue
Block a user