diff --git a/src/FieldNames.cpp b/src/FieldNames.cpp index 67695731d..9b76ffe08 100644 --- a/src/FieldNames.cpp +++ b/src/FieldNames.cpp @@ -41,7 +41,8 @@ static int initFields() sfSigningPubKey.setMeta(SFM_CHANGE); sfAuthorizedKey.setMeta(SFM_CHANGE); sfSigningAccounts.setMeta(SFM_CHANGE); - sfWalletLocator.setMeta(SFM_CHANGE); + sfWalletLocator.setMeta(SFM_ALWAYS); + sfWalletSize.setMeta(SFM_ALWAYS); sfNickname.setMeta(SFM_CHANGE); sfAmount.setMeta(SFM_ALWAYS); sfDomain.setMeta(SFM_CHANGE); diff --git a/src/LedgerFormats.cpp b/src/LedgerFormats.cpp index 4456ebbf0..4e8ebfd4d 100644 --- a/src/LedgerFormats.cpp +++ b/src/LedgerFormats.cpp @@ -24,11 +24,10 @@ static bool LEFInit() << SOElement(sfAuthorizedKey, SOE_OPTIONAL) << SOElement(sfEmailHash, SOE_OPTIONAL) << SOElement(sfWalletLocator, SOE_OPTIONAL) + << SOElement(sfWalletSize, SOE_OPTIONAL) << SOElement(sfMessageKey, SOE_OPTIONAL) << SOElement(sfTransferRate, SOE_OPTIONAL) << SOElement(sfDomain, SOE_OPTIONAL) - << SOElement(sfPublishHash, SOE_OPTIONAL) - << SOElement(sfPublishSize, SOE_OPTIONAL) ; DECLARE_LEF(Contract, ltCONTRACT) diff --git a/src/RPCHandler.cpp b/src/RPCHandler.cpp index b4a22162b..a609e3567 100644 --- a/src/RPCHandler.cpp +++ b/src/RPCHandler.cpp @@ -362,13 +362,11 @@ Json::Value RPCHandler::doAccountDomainSet(const Json::Value ¶ms) uint128(), false, 0, + 0, RippleAddress(), true, strCopy(params[2u].asString()), false, - 0, - false, - uint256(), 0); trans = mNetOps->submitTransaction(trans); @@ -426,13 +424,11 @@ Json::Value RPCHandler::doAccountEmailSet(const Json::Value ¶ms) strEmail.empty() ? uint128() : uEmailHash, false, uint256(), + 0, RippleAddress(), false, vucDomain, false, - 0, - false, - uint256(), 0); trans = mNetOps->submitTransaction(trans); @@ -543,13 +539,11 @@ Json::Value RPCHandler::doAccountMessageSet(const Json::Value& params) { uint128(), false, uint256(), + 0, naMessagePubKey, false, vucDomain, false, - 0, - false, - uint256(), 0); trans = mNetOps->submitTransaction(trans); @@ -561,63 +555,6 @@ Json::Value RPCHandler::doAccountMessageSet(const Json::Value& params) { return obj; } -// account_publish_set -Json::Value RPCHandler::doAccountPublishSet(const Json::Value ¶ms) -{ - RippleAddress naSrcAccountID; - RippleAddress naSeed; - - if (!naSeed.setSeedGeneric(params[0u].asString())) - { - return rpcError(rpcBAD_SEED); - } - else if (!naSrcAccountID.setAccountID(params[1u].asString())) - { - return rpcError(rpcSRC_ACT_MALFORMED); - } - - RippleAddress naVerifyGenerator; - RippleAddress naAccountPublic; - RippleAddress naAccountPrivate; - AccountState::pointer asSrc; - STAmount saSrcBalance; - Json::Value obj = authorize(uint256(0), naSeed, naSrcAccountID, naAccountPublic, naAccountPrivate, - saSrcBalance, theConfig.FEE_DEFAULT, asSrc, naVerifyGenerator); - - if (!obj.empty()) - return obj; - - uint256 uPublishHash(params[2u].asString()); - uint32 uPublishSize = lexical_cast_s(params[3u].asString()); - std::vector vucDomain; - - Transaction::pointer trans = Transaction::sharedAccountSet( - naAccountPublic, naAccountPrivate, - naSrcAccountID, - asSrc->getSeq(), - theConfig.FEE_DEFAULT, - 0, // YYY No source tag - false, - uint128(), - false, - 0, - RippleAddress(), - false, - vucDomain, - false, - 0, - true, - uPublishHash, - uPublishSize); - - trans = mNetOps->submitTransaction(trans); - - obj["transaction"] = trans->getSTransaction()->getJson(0); - obj["status"] = trans->getStatus(); - - return Json::Value(Json::objectValue); -} - // account_rate_set Json::Value RPCHandler::doAccountRateSet(const Json::Value ¶ms) { @@ -657,14 +594,12 @@ Json::Value RPCHandler::doAccountRateSet(const Json::Value ¶ms) uint128(), false, 0, + 0, RippleAddress(), false, vucDomain, true, - uRate, - false, - uint256(), - 0); + uRate); trans = mNetOps->submitTransaction(trans); @@ -702,6 +637,7 @@ Json::Value RPCHandler::doAccountWalletSet(const Json::Value& params) { std::string strWalletLocator = params.size() == 3 ? params[2u].asString() : ""; uint256 uWalletLocator; + uint32 uWalletSize = 0; // XXX Broken should be an argument. if (!strWalletLocator.empty()) uWalletLocator.SetHex(strWalletLocator); @@ -716,13 +652,11 @@ Json::Value RPCHandler::doAccountWalletSet(const Json::Value& params) { uint128(), true, uWalletLocator, + uWalletSize, RippleAddress(), false, vucDomain, false, - 0, - false, - uint256(), 0); trans = mNetOps->submitTransaction(trans); @@ -2426,7 +2360,6 @@ Json::Value RPCHandler::doCommand(const std::string& command, Json::Value& param { "account_email_set", &RPCHandler::doAccountEmailSet, 2, 3, false, optCurrent }, { "account_info", &RPCHandler::doAccountInfo, 1, 2, false, optCurrent }, { "account_message_set", &RPCHandler::doAccountMessageSet, 3, 3, false, optCurrent }, - { "account_publish_set", &RPCHandler::doAccountPublishSet, 4, 4, false, optCurrent }, { "account_rate_set", &RPCHandler::doAccountRateSet, 3, 3, false, optCurrent }, { "account_tx", &RPCHandler::doAccountTransactions, 2, 3, false, optNetwork }, { "account_wallet_set", &RPCHandler::doAccountWalletSet, 2, 3, false, optCurrent }, diff --git a/src/SerializeProto.h b/src/SerializeProto.h index f74413ad6..4cb17d5dc 100644 --- a/src/SerializeProto.h +++ b/src/SerializeProto.h @@ -42,7 +42,7 @@ FIELD(SigningTime, UINT32, 9) FIELD(Expiration, UINT32, 10) FIELD(TransferRate, UINT32, 11) - FIELD(PublishSize, UINT32, 12) + FIELD(WalletSize, UINT32, 12) // 32-bit integers (uncommon) FIELD(HighQualityIn, UINT32, 16) @@ -74,7 +74,6 @@ FIELD(PreviousTxnID, HASH256, 5) FIELD(LedgerIndex, HASH256, 6) FIELD(WalletLocator, HASH256, 7) - FIELD(PublishHash, HASH256, 8) // 256-bit (uncommon) FIELD(BookDirectory, HASH256, 16) diff --git a/src/Transaction.cpp b/src/Transaction.cpp index c4dbd435c..ab8714392 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -116,21 +116,21 @@ Transaction::pointer Transaction::setAccountSet( const uint128& uEmailHash, bool bWalletLocator, const uint256& uWalletLocator, + const uint32 uWalletSize, const RippleAddress& naMessagePublic, bool bDomain, const std::vector& vucDomain, bool bTransferRate, - const uint32 uTransferRate, - bool bPublish, - const uint256& uPublishHash, - const uint32 uPublishSize - ) + const uint32 uTransferRate) { if (!bEmailHash) mTransaction->setFieldH128(sfEmailHash, uEmailHash); if (!bWalletLocator) + { mTransaction->setFieldH256(sfWalletLocator, uWalletLocator); + mTransaction->setFieldU32(sfWalletSize, uWalletSize); + } if (naMessagePublic.isValid()) mTransaction->setFieldVL(sfMessageKey, naMessagePublic.getAccountPublic()); @@ -141,12 +141,6 @@ Transaction::pointer Transaction::setAccountSet( if (bTransferRate) mTransaction->setFieldU32(sfTransferRate, uTransferRate); - if (bPublish) - { - mTransaction->setFieldH256(sfPublishHash, uPublishHash); - mTransaction->setFieldU32(sfPublishSize, uPublishSize); - } - sign(naPrivateKey); return shared_from_this(); @@ -162,20 +156,19 @@ Transaction::pointer Transaction::sharedAccountSet( const uint128& uEmailHash, bool bWalletLocator, const uint256& uWalletLocator, + const uint32 uWalletSize, const RippleAddress& naMessagePublic, bool bDomain, const std::vector& vucDomain, bool bTransferRate, - const uint32 uTransferRate, - bool bPublish, - const uint256& uPublishHash, - const uint32 uPublishSize) + const uint32 uTransferRate) { pointer tResult = boost::make_shared(ttACCOUNT_SET, naPublicKey, naSourceAccount, uSeq, saFee, uSourceTag); - return tResult->setAccountSet(naPrivateKey, bEmailHash, uEmailHash, bWalletLocator, uWalletLocator, + return tResult->setAccountSet(naPrivateKey, bEmailHash, uEmailHash, + bWalletLocator, uWalletLocator, uWalletSize, naMessagePublic, - bDomain, vucDomain, bTransferRate, uTransferRate, bPublish, uPublishHash, uPublishSize); + bDomain, vucDomain, bTransferRate, uTransferRate); } // diff --git a/src/Transaction.h b/src/Transaction.h index ea049b527..0978e9d2c 100644 --- a/src/Transaction.h +++ b/src/Transaction.h @@ -64,14 +64,12 @@ private: const uint128& uEmailHash, bool bWalletLocator, const uint256& uWalletLocator, + const uint32 uWalletSize, const RippleAddress& naMessagePublic, bool bDomain, const std::vector& vucDomain, bool bTransferRate, - const uint32 uTransferRate, - bool bPublish, - const uint256& uPublishHash, - const uint32 uPublishSize); + const uint32 uTransferRate); Transaction::pointer setClaim( const RippleAddress& naPrivateKey, @@ -161,14 +159,12 @@ public: const uint128& uEmailHash, bool bWalletLocator, const uint256& uWalletLocator, + const uint32 uWalletSize, const RippleAddress& naMessagePublic, bool bDomain, const std::vector& vucDomain, bool bTransferRate, - const uint32 uTransferRate, - bool bPublish, - const uint256& uPublishHash, - const uint32 uPublishSize); + const uint32 uTransferRate); // Claim a wallet. static Transaction::pointer sharedClaim( @@ -284,7 +280,7 @@ public: SerializedTransaction::pointer getSTransaction() { return mTransaction; } const uint256& getID() const { return mTransactionID; } - const RippleAddress& getFromAccount() const { return mAccountFrom; } + const RippleAddress& getFromAccount() const { return mAccountFrom; } STAmount getAmount() const { return mTransaction->getFieldU64(sfAmount); } STAmount getFee() const { return mTransaction->getTransactionFee(); } uint32 getFromAccountSeq() const { return mTransaction->getSequence(); } diff --git a/src/TransactionAction.cpp b/src/TransactionAction.cpp index 538028150..a793957f2 100644 --- a/src/TransactionAction.cpp +++ b/src/TransactionAction.cpp @@ -186,40 +186,6 @@ TER TransactionEngine::doAccountSet(const SerializedTransaction& txn) } } - // - // PublishHash && PublishSize - // - - bool bPublishHash = txn.isFieldPresent(sfPublishHash); - bool bPublishSize = txn.isFieldPresent(sfPublishSize); - - if (bPublishHash ^ bPublishSize) - { - Log(lsINFO) << "doAccountSet: bad publish"; - - return temBAD_PUBLISH; - } - else if (bPublishHash && bPublishSize) - { - uint256 uHash = txn.getFieldH256(sfPublishHash); - uint32 uSize = txn.getFieldU32(sfPublishSize); - - if (!uHash) - { - Log(lsINFO) << "doAccountSet: unset publish"; - - mTxnAccount->makeFieldAbsent(sfPublishHash); - mTxnAccount->makeFieldAbsent(sfPublishSize); - } - else - { - Log(lsINFO) << "doAccountSet: set publish"; - - mTxnAccount->setFieldH256(sfPublishHash, uHash); - mTxnAccount->setFieldU32(sfPublishSize, uSize); - } - } - Log(lsINFO) << "doAccountSet<"; return tesSUCCESS; diff --git a/src/TransactionFormats.cpp b/src/TransactionFormats.cpp index 32c7caa71..a6ad09e42 100644 --- a/src/TransactionFormats.cpp +++ b/src/TransactionFormats.cpp @@ -22,11 +22,10 @@ static bool TFInit() DECLARE_TF(AccountSet, ttACCOUNT_SET) << SOElement(sfEmailHash, SOE_OPTIONAL) << SOElement(sfWalletLocator, SOE_OPTIONAL) + << SOElement(sfWalletSize, SOE_OPTIONAL) << SOElement(sfMessageKey, SOE_OPTIONAL) << SOElement(sfDomain, SOE_OPTIONAL) << SOElement(sfTransferRate, SOE_OPTIONAL) - << SOElement(sfPublishHash, SOE_OPTIONAL) - << SOElement(sfPublishSize, SOE_OPTIONAL) ; DECLARE_TF(Claim, ttCLAIM)