From 9d83ce6bf2900fd05b6ba26bc55b0fef5c039e0e Mon Sep 17 00:00:00 2001 From: jed Date: Tue, 20 Nov 2012 08:22:53 -0800 Subject: [PATCH] . --- src/cpp/ripple/PaymentTransactor.cpp | 8 +++++--- test/send-test.js | 11 ++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cpp/ripple/PaymentTransactor.cpp b/src/cpp/ripple/PaymentTransactor.cpp index b8421d10e4..e2e6bceed4 100644 --- a/src/cpp/ripple/PaymentTransactor.cpp +++ b/src/cpp/ripple/PaymentTransactor.cpp @@ -4,13 +4,15 @@ #define RIPPLE_PATHS_MAX 3 -// TODO: only have the higher fee if the account doesn't in fact exist +// only have the higher fee if the account doesn't in fact exist void PaymentTransactor::calculateFee() { if (mTxn.getFlags() & tfCreateAccount) { - - mFeeDue = theConfig.FEE_ACCOUNT_CREATE; + const uint160 uDstAccountID = mTxn.getFieldAccount160(sfDestination); + SLE::pointer sleDst = mEngine->entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(uDstAccountID)); + if(!sleDst) mFeeDue = theConfig.FEE_ACCOUNT_CREATE; + else Transactor::calculateFee(); }else Transactor::calculateFee(); } diff --git a/test/send-test.js b/test/send-test.js index 043855714c..21d261c7a7 100644 --- a/test/send-test.js +++ b/test/send-test.js @@ -15,13 +15,14 @@ var serverDelay = 1500; buster.testRunner.timeout = 5000; + /* -buster.testCase("Simple", { +buster.testCase("Fee Changes", { 'setUp' : testutils.build_setup({no_server: true}), // 'tearDown' : testutils.build_teardown(), - "simple." : - function (done) { buster.assert(1); + "varying the fee for Payment" : + function (done) { this.remote.transaction() .payment('root', 'alice', "10000") @@ -36,8 +37,8 @@ buster.testCase("Simple", { }).submit(); } - }); */ - + }); + */ buster.testCase("Sending", { 'setUp' : testutils.build_setup(), 'tearDown' : testutils.build_teardown(),