MoneroCheck fields are optional;

make error messages consistent with rpc
This commit is contained in:
woodser
2019-07-02 20:29:22 -04:00
parent bb82e5f3d2
commit a00c4a9ee5
3 changed files with 42 additions and 22 deletions
+5 -5
View File
@@ -421,9 +421,9 @@ namespace monero {
boost::property_tree::ptree MoneroCheckTx::toPropertyTree() const {
boost::property_tree::ptree node = MoneroCheck::toPropertyTree();;
node.put("inTxPool", inTxPool);
node.put("numConfirmations", numConfirmations);
node.put("receivedAmount", receivedAmount);
if (inTxPool != boost::none) node.put("inTxPool", *inTxPool);
if (numConfirmations != boost::none) node.put("numConfirmations", *numConfirmations);
if (receivedAmount != boost::none) node.put("receivedAmount", *receivedAmount);
return node;
}
@@ -431,8 +431,8 @@ namespace monero {
boost::property_tree::ptree MoneroCheckReserve::toPropertyTree() const {
boost::property_tree::ptree node = MoneroCheck::toPropertyTree();
node.put("totalAmount", totalAmount);
node.put("unconfirmedSpentAmount", unconfirmedSpentAmount);
if (totalAmount != boost::none) node.put("totalAmount", *totalAmount);
if (unconfirmedSpentAmount != boost::none) node.put("unconfirmedSpentAmount", *unconfirmedSpentAmount);
return node;
}
}