Bitcoin Forum
April 23, 2024, 10:29:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [DEV INPUT NEEDED] Extremely large fee added  (Read 511 times)
CoinWizard123 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 02, 2015, 01:39:06 AM
 #1

I sent a transaction the other day for 1.3 billion coins, however it it took almost all of it as a network transaction fee, I think only a few coins made it to the destination

Im not sure that is normal cause I lost all my coins Sad

I think I found the offending code, but I am not sure

Code:

int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
                              enum GetMinFee_mode mode) const
{
    // Base fee is either nMinTxFee or nMinRelayTxFee
    int64 nBaseFee = (mode == GMF_RELAY) ? nMinRelayTxFee : nMinTxFee;

    unsigned int nBytes = ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);
    unsigned int nNewBlockSize = nBlockSize + nBytes;
    int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;

    if (fAllowFree)
    {
        // There is a free transaction area in blocks created by most miners,
        // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000
        //   to be considered to fall into this category. We don't want to encourage sending
        //   multiple transactions instead of one big transaction to avoid fees.
        // * If we are creating a transaction we allow transactions up to 1,000 bytes
        //   to be considered safe and assume they can likely make it into this section.
        if (nBytes < (mode == GMF_SEND ? 1000 : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000)))
            nMinFee = 0;
    }

    // This code can be removed after enough miners have upgraded to version 0.9.
    // Until then, be safe when sending and require a fee if any output
    // is less than CENT:
    if (nMinFee < nBaseFee && mode == GMF_SEND)
    {
        BOOST_FOREACH(const CTxOut& txout, vout)
            if (txout.nValue < CENT)
                nMinFee = nBaseFee;
    }

    // Raise the price as the block approaches full
    if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)
    {
        if (nNewBlockSize >= MAX_BLOCK_SIZE_GEN)
            return MAX_MONEY;
        nMinFee *= MAX_BLOCK_SIZE_GEN / (MAX_BLOCK_SIZE_GEN - nNewBlockSize);
    }

    if (!MoneyRange(nMinFee))
        nMinFee = MAX_MONEY;
    return nMinFee;
}


Does it seem normal under any circumstances to return MAX_MONEY as the fee? cause that's the onlt think that I think could have happened, cause now if I try send sa 100million coins it says the amount is too small, I assume because its trying to take a fee larger than the actual transaction.

Any devs out there have an idea if this coin is broken?
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713868146
Hero Member
*
Offline Offline

Posts: 1713868146

View Profile Personal Message (Offline)

Ignore
1713868146
Reply with quote  #2

1713868146
Report to moderator
1713868146
Hero Member
*
Offline Offline

Posts: 1713868146

View Profile Personal Message (Offline)

Ignore
1713868146
Reply with quote  #2

1713868146
Report to moderator
1713868146
Hero Member
*
Offline Offline

Posts: 1713868146

View Profile Personal Message (Offline)

Ignore
1713868146
Reply with quote  #2

1713868146
Report to moderator
gjhiggins
Legendary
*
Offline Offline

Activity: 2254
Merit: 1278



View Profile WWW
June 02, 2015, 02:01:19 AM
 #2

Does it seem normal under any circumstances to return MAX_MONEY as the fee?

Yup ...

https://github.com/search?q=nMinFee+%3D+MAX_MONEY

Quote
Any devs out there have an idea if this coin is broken?

You're more likely to get an answer if you post a link to the GetMinFee function in main.h code in your coin's github repos, e.g. https://github.com/nicksasa/Liquidcoin/blob/d1ce42b07e07b6a950b43b9ebbb0dd351be24e42/src/main.h#L533

Cheers

Graham
CoinWizard123 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 02, 2015, 02:06:13 AM
 #3

Does it seem normal under any circumstances to return MAX_MONEY as the fee?

Yup ...

https://github.com/search?q=nMinFee+%3D+MAX_MONEY

Quote
Any devs out there have an idea if this coin is broken?

You're more likely to get an answer if you post a link to the GetMinFee function in main.h code in your coin's github repos, e.g. https://github.com/nicksasa/Liquidcoin/blob/d1ce42b07e07b6a950b43b9ebbb0dd351be24e42/src/main.h#L533

Cheers

Graham


Right so it is normal to pay a fee larger than the amount you are sending, seems strange

Here is the coins github
https://github.com/bitcentavo/bitcentavo/blob/58dd07da125f632bb3464bdfb7b2f63dc90bda20/src/main.cpp


I just assumed you could send any amount, it never said anywhere that if I send a certain amount it would take it all.

Now I can send even 1 coin cause its tiring to add 100million coins as a fee Sad

Scammed again I guess, I give up on this bitcoin crap Sad
gjhiggins
Legendary
*
Offline Offline

Activity: 2254
Merit: 1278



View Profile WWW
June 02, 2015, 01:46:40 PM
 #4

Right so it is normal to pay a fee larger than the amount you are sending, seems strange

Here is the coins github
https://github.com/bitcentavo/bitcentavo/blob/58dd07da125f632bb3464bdfb7b2f63dc90bda20/src/main.cpp


I just assumed you could send any amount, it never said anywhere that if I send a certain amount it would take it all.

Now I can send even 1 coin cause its tiring to add 100million coins as a fee Sad

Scammed again I guess, I give up on this bitcoin crap Sad

Bitcentavo is a bit of clumsy copy of Bitcoin 0.8.6. The Bitcentavo GetMinFee code is:

https://github.com/bitcentavo/bitcentavo/blob/master/src/main.cpp#L599

And this is the (exactly) corresponding Bitcoin 0.8.6 code:

https://github.com/bitcoin/bitcoin/blob/03a7d673876dc8fbae876290b455c02b0cac80bd/src/main.cpp#L599

They are identical.

Not a scam but you do appear to fallen foul of the Bitcoin reference client's atrocious UI.

It won't be any consolation to you but the very latest Bitcoin 0.10.2 reference client exposes the true horror of the complexity of Bitcoin transaction fees.



If I didn't know better, I'd say that the user is expected to know the kb size of the transaction in order to be able to calculate the fee. But that is just so ludicrous a presumption that I'm sure I've missed something somewhere.

I do so appreciate the irony of the intensity of focus of the current debate about the implications of block size and wide-scale adoption, I'm surprised the participants can hear each other over the massed trumpeting of the herd of elephants in the room.

Cheers

Graham
 
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!