Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning fee calculation is broken #75

Open
zathras-crypto opened this issue Jun 4, 2015 · 8 comments
Open

Warning fee calculation is broken #75

zathras-crypto opened this issue Jun 4, 2015 · 8 comments

Comments

@zathras-crypto
Copy link
Owner

int64_t minWarn = 3 * minRelayTxFee.GetFee(200) + CWallet::minTxFee.GetFee(2000); // based on 3x <200 byte outputs (change/reference/data) & total tx size of <2KB

Provides 2600 satoshi value for minWarn using default parameters (ie no relay or mining fee customization) on 0.0.10 (both testnet & mainnet). This is not sufficient however, as the cost to send a ~450 byte transaction was a touch over 6000 satoshi.

Results in no warning about low fees, but failure to send transaction.

Note to self, revisit how warning fee is calculated.

EDIT: for reminder - available inputs for mpZATHm5 were >2600 minWarn value but not sufficient to send a tx.

screenshot from 2015-06-04 14 25 44

@dexX7
Copy link

dexX7 commented Jun 4, 2015

Hm, interesting.

You may try to get some further information via minRelayTxFee.ToString(), CWallet::minTxFee.ToString() (maybe also payTxFee) to learn more about which fee/amount was actually used.

@zathras-crypto
Copy link
Owner Author

OK cool will try that (from the calcs it looks like it's spitting the numbers straight back at me hehe:
minRelayTxFee.GetFee(200) = 200
minTxFee.GetFee(2000) = 2000

Let me see what I get from that (tostring)...

@zathras-crypto
Copy link
Owner Author

Hmm, stranger and stranger...

minRelayTxFee: 0.00001000 BTC/kB  minTxFee: 0.00001000 BTC/kB
minRelayTxFee.GetFee(200): 200  minTxFee.GetFee(2000): 2000

Am I using the syntax wrong? I thought passing in the output size to minRelayTxFee.GetFee() and passing in the transaction size to minTxFee.GetFee() was correct, but doesn't seem so...

@dexX7
Copy link

dexX7 commented Jun 4, 2015

It looks like the minRelayTxFee and minTxFee are 1000 satoshi per 1000 byte, thus the echoed values.

I'm wondering what caused the rejection. My very best guess: payTxFee is 10000 satoshi, and the wallet selected that value instead of minTxFee, which roughly aligns with 6000 satoshi for 450 byte.

@dexX7
Copy link

dexX7 commented Jun 4, 2015

Are other transactions sent out with a simliar fee for similar transactions?

@zathras-crypto
Copy link
Owner Author

Ahh nice yeah that's probably it - just out at the docs at the mo but will
test it out when I get back...
On Jun 4, 2015 3:11 PM, "dexX7" [email protected] wrote:

It looks like the minRelayTxFee and minTxFee are 1000 satoshi per 1000
byte, thus the echoed values.

I'm wondering what caused the rejection. My very best guess: payTxFee is
10000 satoshi, and the wallet selected that value instead of minTxFee,
which roughly aligns with 6000 satoshi for 450 byte.


Reply to this email directly or view it on GitHub
#75 (comment)
.

@zathras-crypto
Copy link
Owner Author

I get these values:

payTxFee.GetFee(450): 0   payTxFee.GetFeePerK(): 0

But I also noticed:
screenshot from 2015-06-04 17 18 56

@dexX7
Copy link

dexX7 commented Jun 4, 2015

It looks like these are the default values:

  • payTxFee: 0
  • minTxFee: 1000
  • minRelayTxFee: 1000

I'm going to take a look at it later, but I think we basically have to find out what caused the rejection.

A quick look into selectCoins() reveals:

int64_t n_max = (COIN * (20 * (0.0001)));

So it seems as if we're trying to select a significantly higher amount during the coin selection, even if it's not necessarily required, and that amount does not match the warning threshold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants