This comes without the GUI changes, so it should be easier to review and backport. GUI: #7096
[wallet, rpc tests] Fix settxfee, paytxfee #7103
pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:FixSettxfee changing 3 files +31 −13-
MarcoFalke commented at 12:51 PM on November 26, 2015: member
-
in qa/rpc-tests/wallet.py:None in b90632cc5d outdated
247 | 248 | #check if JSON parser can handle scientific notation in strings 249 | txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "1e-4") 250 | txObj = self.nodes[0].gettransaction(txId) 251 | - assert_equal(txObj['amount'], Decimal('-0.00010000')) 252 | + assert_equal(txObj['amount'], Decimal('-0.0001'))
laanwj commented at 12:55 PM on November 26, 2015:Does removing the extra zeroes here make any difference?
MarcoFalke commented at 1:05 PM on November 26, 2015:>>> Decimal("0.100") == Decimal(".1") TrueBut the diff is larger. So removed this.
laanwj added the label Bug on Nov 26, 2015laanwj added the label Wallet on Nov 26, 2015laanwj added the label Priority High on Nov 26, 2015in qa/rpc-tests/test_framework/util.py:None in b90632cc5d outdated
66 | @@ -67,6 +67,9 @@ def check_json_precision(): 67 | if satoshis != 2000000000000003: 68 | raise RuntimeError("JSON encode/decode loses precision") 69 | 70 | +def count_bytes(hex_string): 71 | + return len(bytearray.fromhex(hex_string))
jonasschnelli commented at 1:01 PM on November 26, 2015:hmm.. is forming a byte arrayreally necessary? Would
len(hex_string)/2not be sufficient?
laanwj commented at 1:02 PM on November 26, 2015:I considered that nit, but right now it checks it is a valid hex string, which is kind of useful for a test
MarcoFalke force-pushed on Nov 26, 2015jonasschnelli commented at 1:59 PM on November 26, 2015: contributorTested ACK.
Works (tx size 373 bytes, txfeerate is 0.01, fee =
0.00373):Jonass-MacBook-Pro:_bitcoin jonasschnelli$ ./src/bitcoin-cli --regtest getbalance 47.98861600 Jonass-MacBook-Pro:_bitcoin jonasschnelli$ ./src/bitcoin-cli --regtest settxfee 0.01 true Jonass-MacBook-Pro:_bitcoin jonasschnelli$ ./src/bitcoin-cli --regtest getnewaddress n1YGgjMuRDCEL9PDoMXKeEMzE4Z5gYNHKC Jonass-MacBook-Pro:_bitcoin jonasschnelli$ ./src/bitcoin-cli --regtest sendtoaddress n1YGgjMuRDCEL9PDoMXKeEMzE4Z5gYNHKC 1.0 ccfb9f516f7935fe53d8c8dfbda2ba9f573a516da465124d4a3f02e9afb1c009 Jonass-MacBook-Pro:_bitcoin jonasschnelli$ ./src/bitcoin-cli --regtest gettransaction ccfb9f516f7935fe53d8c8dfbda2ba9f573a516da465124d4a3f02e9afb1c009 { "amount": 0.00000000, "fee": -0.00373000, "confirmations": 0, "txid": "ccfb9f516f7935fe53d8c8dfbda2ba9f573a516da465124d4a3f02e9afb1c009", "walletconflicts": [ ], "time": 1448546094, "timereceived": 1448546094, "details": [ { "account": "", "address": "n1YGgjMuRDCEL9PDoMXKeEMzE4Z5gYNHKC", "category": "send", "amount": -1.00000000, "label": "", "vout": 1, "fee": -0.00373000 }, { "account": "", "address": "n1YGgjMuRDCEL9PDoMXKeEMzE4Z5gYNHKC", "category": "receive", "amount": 1.00000000, "label": "", "vout": 1 } ], "hex": "0100000002194adfb873b92507d4004b34910ea2e48f673be6c2d46b2408123e59b581f043000000006a47304402203bc41e34daa2ec5f795c38ef31c6d6fe926682609ebaca41ad50867b810d49b902203028f9334df4415da1f0c12ce76211c70583e853e3bb3158508b973b1b659ab4012102d9ce185100c65ba09aaf0d634fb86632ad73a54ff510f833e00348f4bb9edc47feffffff194adfb873b92507d4004b34910ea2e48f673be6c2d46b2408123e59b581f043010000006b483045022100e7fd9fc3a9e0d3ca6e8724e3daf330a1afe5de801e58c5f2193aaed25723d24d0220503460a151301d304f00b6d16364c9cb128e0005eda24950d6436a5b23a86baf01210339167b46e7774585f439d4780919e2dee5af9023cdef4778e245aa40c7650a04feffffff02e09def05000000001976a914d8d20ef3bdd8a263461b5463673cb901716bd88288ac00e1f505000000001976a914dba2489ddc1bfc465632141b8c5e1f3e1fd4a16888ac5b000000" }Tested also together with the UI (known bug/interference still behaves likes expected).
sipa commented at 2:03 PM on November 26, 2015: memberutACK
laanwj commented at 2:06 PM on November 26, 2015: memberutACK
laanwj added this to the milestone 0.12.0 on Nov 27, 20154b89f01d72Default fPayAtLeastCustomFee to false
This allows for much finer control of the transaction fees per kilobyte as it prevent small transactions using a fee that is more appropriate for one that is of a kilobyte. This also allows controlling the fee per kilobyte over rpc such that: bitcoin-cli settxfee `bitcoin-cli estimatefee 2` would make sense, while currently it grossly fails often by a factor of x3
[wallet] Add rpc tests to verify fee calculations fa506c0c9bMarcoFalke force-pushed on Nov 28, 2015MarcoFalke commented at 9:56 PM on November 28, 2015: memberTrivial rebase. (Previous head: fa895cb)
laanwj merged this on Nov 30, 2015laanwj closed this on Nov 30, 2015laanwj referenced this in commit a7751824ce on Nov 30, 2015MarcoFalke deleted the branch on Nov 30, 2015DrahtBot locked this on Dec 16, 2021ContributorsMilestone
0.12.0
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me