From f3c9138e4b86010db7ddc54d874fbe851e1e4b0a Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 14 May 2012 22:13:03 -0700 Subject: [PATCH] Have RPC command claim use new constructor and output transaction --- src/RPCServer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 3934a6af96..92d33ed5bf 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -608,8 +608,9 @@ Json::Value RPCServer::doWalletClaim(Json::Value& params) // // Which has no confidential information. + // XXX Need better parsing. + uint32 uSourceTag = (params.size() == 2) ? 0 : boost::lexical_cast(params[2u].asString()); // XXX Annotation is ignored. - uint32 uSourceTag = (params.size() == 2) ? 0 : params[2u].asUInt(); std::string strAnnotation = (params.size() == 3) ? "" : params[3u].asString(); NewcoinAddress naMasterSeed; @@ -641,13 +642,12 @@ Json::Value RPCServer::doWalletClaim(Json::Value& params) std::vector vucGeneratorCipher = naRegularReservedPrivate.accountPrivateEncrypt(naRegularReservedPublic, naMasterGenerator.getFamilyGenerator()); - Transaction::pointer trns = boost::make_shared( + Transaction::pointer trns = Transaction::sharedClaim( naAccountPublic, naAccountPrivate, - naAccountPublic, naUnset, - 0, // Free - 0, // Seq - uSourceTag, // Source tag - 0); // Ledger not specified. + naAccountPublic, + uSourceTag, + naRegularReservedPublic, // GeneratorID + vucGeneratorCipher); Json::Value obj(Json::objectValue); @@ -662,6 +662,8 @@ Json::Value RPCServer::doWalletClaim(Json::Value& params) obj["generator"] = strHex(vucGeneratorCipher); obj["annotation"] = strAnnotation; + obj["transaction"] = trns->getSTransaction()->getJson(0); + return obj; } }