Use trusted validators median fee

This fixes the problem with people running validators that don't use the temporary new fee floor. Note that this has already been deployed:
https://github.com/ripple/rippled/commits/release

Reviewers: @JoelKatz @tdfischer
Approvers: @rec @nbougalis 
If so, you might want to alternate "over" and "under" so on average you're
good.

It really depends on what this "median" is used for...?

On Wed, Oct 1, 2014 at 10:45 AM, Vinnie Falco <notifications@github.com>
wrote:

> In src/ripple/app/ledger/LedgerMaster.cpp:
>
> > -        int count2 = getApp().getValidations().getFeeAverage(ledger->getParentHash(), ref, fee2);
> > -
> > -        if ((count + count2) == 0)
> > -            getApp().getFeeTrack().setRemoteFee(ref);
> > +        std::uint64_t const base = getApp().getFeeTrack().getLoadBase();
> > +        auto fees = getApp().getValidations().fees (ledger->getHash(), base);
> > +        {
> > +            auto fees2 = getApp().getValidations().fees (ledger->getParentHash(), base);
> > +            fees.reserve (fees.size() + fees2.size());
> > +            std::copy (fees2.begin(), fees2.end(), std::back_inserter(fees));
> > +        }
> > +        std::uint64_t fee;
> > +        if (! fees.empty())
> > +        {
> > +            std::sort (fees.begin(), fees.end());
> > +            fee = fees[fees.size() / 2]; // median
>
> This means that validators could arrive at a value for the fee that no
> individual validator has chosen. Its important that the median calculation
> always produce a value that at least one validator has selected (I think...
> @joelkatz <https://github.com/joelkatz> ?)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ripple/rippled/pull/597/files#r18282887>.
>