Commit Graph

329 Commits

Author SHA1 Message Date
Suhas Daftuar 1488fc8eac
Eliminate race condition in mempool_packages test
Github-Pull: #7368
Rebased-From: 4d10d2e16f
2016-01-18 10:29:32 +01:00
Alex Morcos fd4bd5009e
Add RPC call abandontransaction
- Make wallet descendant searching more efficient
- Add new rpc call: abandontransaction

Unconfirmed transactions that are not in your mempool either due to eviction or other means may be unlikely to be mined.  abandontransaction gives the wallet a way to no longer consider as spent the coins that are inputs to such a transaction.  All dependent transactions in the wallet will also be marked as abandoned.

- Add RPC test for abandoned and conflicted transactions.
- [Wallet] Call notification signal when a transaction is abandoned

Github-Pull: #7312
Rebased-From: 9e69717254 01e06d1fa3 df0e2226d9 d11fc1695c
2016-01-13 15:55:00 +01:00
Alex Morcos a36d79bfe2
Add sane fallback for fee estimation
- Always respect GetRequiredFee for wallet txs
- Add sane fallback for fee estimation
- SQUASHME: Fix rpc tests that assumed fallback to minRelayTxFee

Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.

Github-Pull: #7296
Rebased-From: 995b9f3 e420a1b bebe58b
2016-01-13 11:06:17 +01:00
Suhas Daftuar d513405cb7
[Tests] Eliminate intermittent failures in sendheaders.py
- Add race-condition debugging tool to mininode
- Eliminate race condition in sendheaders.py test

Clear the last block announcement before mining new blocks.

Github-Pull: #7308
Rebased-From: 82a0ce09b4 168915e6de
2016-01-09 16:32:30 +01:00
MarcoFalke 1ed938b5fe
[qa] wallet: Check if maintenance changes the balance
- [qa] Cleanup wallet.py test
- [qa] check if wallet or blochchain maintenance changes the balance
- [walletdb] Add missing LOCK() in Recover() for dummyWallet

Github-Pull: #7229
Rebased-From: fa0765d433 fa14d99484 fa33d9740c
2016-01-07 09:19:25 +01:00
MarcoFalke 333e1eaeea
Bump copyright headers to 2015
- Bump copyright headers to 2015
- [devtools] Rewrite fix-copyright-headers.py
- [devtools] Use git pretty-format for year parsing

Github-Pull: #7205
Rebased-From: fa6ad855e9 fa24439ff3 fa71669452
2016-01-05 14:13:33 +01:00
MarcoFalke bdd0f9e286
[qa] Move gen_return_txouts() to util.py
Github-Pull: #7250
Rebased-From: fa0a9749eb
2016-01-04 11:58:36 +01:00
Wladimir J. van der Laan 453c56701a
tests: Disable Tor interaction
This is unnecessary during the current tests (any test for Tor
interaction can explicitly enable it) and interferes with the proxy
test.

Github-Pull: #7170
Rebased-From: 4c40ec0451
2015-12-22 16:45:56 +01:00
Jonas Schnelli 9ef7c54ef0 [Tests] Add mempool_limit.py test
- [Tests] Add mempool_limit.py test
- [Tests] Refactor some shared functions

Github-Pull: #7153
Rebased-From: 110ff1142c 7632cf689a
2015-12-22 14:08:22 +01:00
Suhas Daftuar 301f16ad1c
Add more tests to p2p-fullblocktest
Github-Pull: #7226
Rebased-From: 9b41a5fba2
2015-12-22 09:54:52 +01:00
Suhas Daftuar 12c469b236
[Mempool] Fix mempool limiting and replace-by-fee for PrioritiseTransaction
1) Fix mempool limiting for PrioritiseTransaction

Redo the feerate index to be based on mining score, rather than fee.

Update mempool_packages.py to test prioritisetransaction's effect on
package scores.

2) Update replace-by-fee logic to use fee deltas

3) Use fee deltas for determining mempool acceptance

4) Remove GetMinRelayFee

One test in AcceptToMemoryPool was to compare a transaction's fee
agains the value returned by GetMinRelayFee. This value was zero for
all small transactions.  For larger transactions (between
DEFAULT_BLOCK_PRIORITY_SIZE and MAX_STANDARD_TX_SIZE), this function
was preventing low fee transactions from ever being accepted.

With this function removed, we will now allow transactions in that range
with fees (including modifications via PrioritiseTransaction) below
the minRelayTxFee, provided that they have sufficient priority.

Github-Pull: #7062
Rebased-From: eb306664e7 9ef2a25603 27fae3484c 901b01d674
2015-12-21 17:19:53 +01:00
Wladimir J. van der Laan f3ad812208
test: don't override BITCOIND and BITCOINCLI if they're set
In rpc-tests.py, don't override BITCOIND and BITCOINCLI if they're
already set. Makes it possible to run the tests with either another tree
or the GUI.

Github-Pull: #7209
Rebased-From: 83cdcbdca4
2015-12-17 10:58:33 +01:00
Wladimir J. van der Laan 44fef99e66 net: Fix sent reject messages for blocks and transactions
Ever since we #5913 have been sending invalid reject messages
for transactions and blocks.

test: Add basic test for `reject` code

Extend P2P test framework to make it possible to expect reject
codes for transactions and blocks.

Github-Pull: #7179
Rebased-From: 9fc6ed6003 20411903d7
2015-12-10 11:59:34 +01:00
Wladimir J. van der Laan b2d7ada372
test: remove necessity to call create_callback_map
Remove necessity to call create_callback_map (as well as the function
itself) from the Python P2P test framework. Invoke the appropriate
methods directly.

- Easy to forget to call it and wonder why it doesn't work
- Simplifies the code
- This makes it easier to handle new messages in subclasses

Github-Pull: #7171
Rebased-From: 2f601d215d
2015-12-07 12:45:14 +01:00
Gregory Maxwell f31955d9da
Replace setInventoryKnown with a rolling bloom filter.
Github-Pull: #7133
Rebased-From: ec73ef37ec e20672479e 6b849350ab b6a0da45db d41e44c9ac aa4b0c26b0
2015-12-04 15:01:09 +01:00
Peter Todd 092e9ad7d9
Remove old replace-by-fee tests
Made redundant by tests in qa/rpc-tests/replace-by-fee.py
2015-12-02 18:26:53 +08:00
Wladimir J. van der Laan 16f4a6e0fe
Merge pull request #7137
cfdc662 Explicitly set chain limits in replace-by-fee test (Suhas Daftuar)
2015-12-01 13:32:21 +01:00
Wladimir J. van der Laan 2ef5ffa59a
Merge pull request #6915
2d8860e Fix removeForReorg to use MedianTimePast (Suhas Daftuar)
b7fa4aa Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar)
7e49f5f Track coinbase spends in CTxMemPoolEntry (Suhas Daftuar)
bb8ea1f removeForReorg calls once-per-disconnect-> once-per-reorg (Matt Corallo)
474b84a Make indentation in ActivateBestChainStep readable (Matt Corallo)
b0a064c Fix comment in removeForReorg (Matt Corallo)
9b060e5 Fix removal of time-locked transactions during reorg (Matt Corallo)
0c9959a Add failing test checking timelocked-txn removal during reorg (Matt Corallo)
2015-12-01 13:17:34 +01:00
Wladimir J. van der Laan 9afbd96919
Merge pull request #7022
50947ef Change default block priority size to 0 (Alex Morcos)
2015-12-01 12:39:34 +01:00
Suhas Daftuar 2b31ab90c4 Add rpc test for prioritisetransaction 2015-12-01 11:03:57 +01:00
Suhas Daftuar 6e8b07f5f3 Add rounding helper function to util.py 2015-12-01 11:03:37 +01:00
Wladimir J. van der Laan eb3d1b3487
Merge pull request #7135
fa3a38a [qa] pull-tester: Cleanup (run keypool, tidy stdout) (MarcoFalke)
2015-12-01 09:56:09 +01:00
Wladimir J. van der Laan 30c2d8c635
Merge pull request #7105
9ac63d6 Keep track of explicit wallet conflicts instead of using mempool (Pieter Wuille)
2015-12-01 09:22:08 +01:00
Alex Morcos 50947ef23f Change default block priority size to 0
Make RPC tests have a default block priority size of 50000 (the old default) so we can still use free transactions in RPC tests.  When priority is eliminated, we will have to make a different change if we want to continue allowing free txs.
2015-11-30 16:16:24 -05:00
Gregory Maxwell 438ee59839
Merge pull request #7044
d52fbf0 Added additional config option for multiple RPC users. (Gregory Sanders)
2015-11-30 12:25:28 -08:00
Matt Corallo 0c9959a308 Add failing test checking timelocked-txn removal during reorg 2015-11-30 13:02:04 -05:00
Suhas Daftuar cfdc66280f Explicitly set chain limits in replace-by-fee test 2015-11-30 12:35:24 -05:00
MarcoFalke fa3a38a7f2 [qa] pull-tester: Cleanup (run keypool, tidy stdout)
* Run keypool (takes 6 seconds)
* Print duration of each rpc test
* Structure output (bold, new lines)
2015-11-30 16:01:57 +01:00
Wladimir J. van der Laan a7751824ce
Merge pull request #7103
fa506c0 [wallet] Add rpc tests to verify fee calculations (MarcoFalke)
4b89f01 Default fPayAtLeastCustomFee to false (Ryan Havar)
2015-11-30 12:18:20 +01:00
Wladimir J. van der Laan 6fc287f2df
Merge pull request #7027
4ea1790 [qa] keypool: DRY: Use test framework (MarcoFalke)
c6973ca [qa] keypool: Fix white space to prepare transition to test framework (MarcoFalke)
2015-11-30 12:15:21 +01:00
Gregory Sanders d52fbf00e3 Added additional config option for multiple RPC users. 2015-11-29 08:34:20 -05:00
Pieter Wuille 9ac63d6d30 Keep track of explicit wallet conflicts instead of using mempool 2015-11-29 13:24:02 +01:00
Suhas Daftuar 50262d8953 Allow block announcements with headers
This replaces using inv messages to announce new blocks, when a peer requests
(via the new "sendheaders" message) that blocks be announced with headers
instead of inv's.

Since headers-first was introduced, peers send getheaders messages in response
to an inv, which requires generating a block locator that is large compared to
the size of the header being requested, and requires an extra round-trip before
a reorg can be relayed.  Save time by tracking headers that a peer is likely to
know about, and send a headers chain that would connect to a peer's known
headers, unless the chain would be too big, in which case we revert to sending
an inv instead.

Based off of @sipa's commit to announce all blocks in a reorg via inv,
which has been squashed into this commit.

Rebased-by: Pieter Wuille
2015-11-29 11:59:23 +01:00
MarcoFalke fa506c0c9b [wallet] Add rpc tests to verify fee calculations 2015-11-28 22:52:13 +01:00
Wladimir J. van der Laan 0e935865b9
Merge pull request #6871
63b5840 Fix usage of local python-bitcoinlib (Peter Todd)
16a2f93 Fix incorrect locking of mempool during RBF replacement (Peter Todd)
97203f5 Port test to rpc-test framework (Suhas Daftuar)
20367d8 Add test for max replacement limit (Suhas Daftuar)
73d9040 Improve RBF replacement criteria (Suhas Daftuar)
b272ecf Reject replacements that add new unconfirmed inputs (Peter Todd)
fc8c19a Prevent low feerate txs from (directly) replacing high feerate txs (Peter Todd)
0137e6f Add tests for transaction replacement (Peter Todd)
5891f87 Add opt-in full-RBF to mempool (Peter Todd)
2015-11-27 13:20:39 +01:00
Wladimir J. van der Laan e92377fa7f
Merge pull request #6134
e304432 Pass reference to estimateSmartFee and cleanup whitespace (Suhas Daftuar)
56106a3 Expose RPC calls for estimatesmart functions (Alex Morcos)
e93a236 add estimateSmartFee to the unit test (Alex Morcos)
6303051 EstimateSmart functions consider mempool min fee (Alex Morcos)
f22ac4a Increase success threshold for fee estimation to 95% (Alex Morcos)
4fe2823 Change wallet and GUI code to use new smart fee estimation calls. (Alex Morcos)
22eca7d Add smart fee estimation functions (Alex Morcos)
2015-11-27 12:59:37 +01:00
Wladimir J. van der Laan ed34e0577e
Merge pull request #7052
a0953cd [qa] python-bitcoinrpc is no longer a subtree (MarcoFalke)
2015-11-24 09:29:46 +01:00
Gregory Maxwell 0b0fc179ab
Merge pull request #7028
e16ee1c [qa] Extend README.md (MarcoFalke)
cc97574 [qa] Split README.md to /qa and /qa/rpc-tests (MarcoFalke)
2015-11-22 14:51:30 -08:00
Gregory Maxwell 9cdd407ca5
Merge pull request #7029
c800c95 Remove unmaintained example test script_test.py (Suhas Daftuar)
2015-11-22 14:47:40 -08:00
Peter Todd 63b5840257
Fix usage of local python-bitcoinlib
Previously was using the system-wide python-bitcoinlib, if it existed,
rather than the local copy that you check out in the README.
2015-11-20 16:23:01 -05:00
Wladimir J. van der Laan 07b770caf3
Merge pull request #7019
33b7f83 [qa] travis: cover *receivedby* rpcs (MarcoFalke)
2015-11-20 09:01:07 +01:00
MarcoFalke a0953cdf07 [qa] python-bitcoinrpc is no longer a subtree
* Only authproxy.py is taken from the python-bitcoinrpc
2015-11-19 12:39:49 +01:00
MarcoFalke e16ee1cd1e [qa] Extend README.md 2015-11-18 11:59:12 +01:00
MarcoFalke cc975745d5 [qa] Split README.md to /qa and /qa/rpc-tests
+ Update with new -help message
2015-11-17 13:03:59 +01:00
Alex Morcos 56106a3300 Expose RPC calls for estimatesmart functions
Also add testing for estimatesmartfee in smartfees.py
2015-11-16 15:42:31 -05:00
Suhas Daftuar c800c95997 Remove unmaintained example test script_test.py 2015-11-16 09:50:50 -05:00
MarcoFalke 4ea1790553 [qa] keypool: DRY: Use test framework 2015-11-16 12:01:32 +01:00
MarcoFalke c6973ca03b [qa] keypool: Fix white space to prepare transition to test framework 2015-11-16 12:01:32 +01:00
MarcoFalke 33b7f83c59 [qa] travis: cover *receivedby* rpcs 2015-11-14 22:33:13 +01:00
Jonas Schnelli d61fcff071
don't enforce maxuploadtargets disconnect for whitelisted peers 2015-11-13 21:04:12 +01:00