Commit graph

9531 commits

Author SHA1 Message Date
Alex Morcos 5f1f0c6490 Historical block span
Store in fee estimate file the block span for which we were tracking estimates, so we know what targets we can successfully evaluate with the data in the file. When restarting use either this historical block span to set valid range of targets until our current span of tracking estimates is just as long.
2017-05-10 11:47:45 -04:00
Alex Morcos aa19b8ea44 Clean up fee estimate debug printing 2017-05-10 11:47:45 -04:00
Alex Morcos 10f7cbd247 Track first recorded height
Track the first time we seen txs in a block that we have been tracking in our mempool. Used to evaluate validity of fee estimates for different targets.
2017-05-10 11:47:44 -04:00
Alex Morcos 3810e976d6 Rewrite estimateSmartFee
Change the logic of estimateSmartFee to check a 60% threshold at half the target, a 85% threshold at the target and a 95% threshold at double the target. Always check the shortest time horizon possible and ensure that estimates are monotonically decreasing.  Add a conservative mode, which makes sure that the 95% threshold is also met at longer time horizons as well.
2017-05-10 11:47:44 -04:00
Alex Morcos c7447ec303 Track failures in fee estimation.
Start tracking transactions which fail to confirm within the target and are then evicted or otherwise leave mempool.

Fix slight error in unit test.
2017-05-10 11:45:27 -04:00
Alex Morcos 4186d3fdfd Expose estimaterawfee
Track information the ranges of fee rates that were used to calculate the fee estimates (the last range of fee rates in which the data points met the threshold and the first to fail) and provide an RPC call to return this information.
2017-05-10 11:45:26 -04:00
Alex Morcos 2681153af3 minor refactor: explicitly track start of new bucket range and don't update curNearBucket on final loop. 2017-05-10 11:45:26 -04:00
Alex Morcos 1ba43cc0ec Make EstimateMedianVal smarter about small failures.
Instead of stopping if it encounters a "sufficient" number of transactions which don't meet the threshold for being confirmed within the target, it keeps looking to add more transactions to see if there is a temporary blip in the data.  This allows a smaller number of required data points.
2017-05-10 11:45:26 -04:00
Alex Morcos d3e30bca1b Refactor to update moving average on fly 2017-05-10 11:45:26 -04:00
Alex Morcos e5007bae35 Change parameters for fee estimation and estimates on all 3 time horizons.
Make feerate buckets smaller (5% instead of 10%) and make the 3 different horizons have half lifes of 3 hours, 1 day and 1 week respectively.
2017-05-10 11:45:26 -04:00
Simone Madeo 4f3782ed67 [doc] Removing comments about dirty entries on txmempool 2017-05-10 10:33:38 +01:00
MarcoFalke 4b766fcdd4
Merge #10371: [tests] Clean up addrman_tests.cpp
a80f295 [tests] Clean up addrman_tests.cpp (Jimmy Song)

Tree-SHA512: c745ebb0b8867e8abacfab62561a883ee5219176951e9ad4821fdc1e6152c9548663824ad624bfce1294760284fc6bd2a598749d66e62af55f39c59a1ea357ce
2017-05-09 23:23:53 +02:00
Jimmy Song a80f295666 [tests] Clean up addrman_tests.cpp
Cleanup request from #10287.
Change "Test #:" comments to "Test:"
Change BOOST_CHECK(... = ...) to BOOST_CHECK_EQUAL(..., ...)
Remove three unnecessary if statements
2017-05-09 13:59:49 -07:00
Jorge Timón 78da882edd
Util: Small improvements in gArgs usage
- Don't check gArgs.IsArgSet() is greater than 0
- Remove unneeded calls and local variables
2017-05-09 21:37:34 +02:00
Jorge Timón 52922456b8
Util: Put mapMultiArgs inside ArgsManager
- Set ArgsManager::mapMultiArgs in ArgsManager::SoftSetArg, ForceSetArg, SoftSetBoolArg
2017-05-09 21:37:29 +02:00
Jorge Timón b3cbd554d9
scripted-diff: Util: Encapsulate mapMultiArgs behind gArgs
-BEGIN VERIFY SCRIPT-
sed -i 's/mapMultiArgs.count(/gArgs.IsArgSet(/g' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i 's/mapMultiArgs.at("/gArgs.GetArgs("/g' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
-END VERIFY SCRIPT-
2017-05-09 21:29:05 +02:00
Jorge Timón f2957ce6cd
Util: Create ArgsManager class...
- Introduce ArgsManager::GetArgs()
- Adapt util_tests.cpp to ArgsManager
2017-05-09 21:29:02 +02:00
Pieter Wuille daf3e7def7
Merge #10338: Maintain state across GetStrongRandBytes calls
97477c5 Maintain state across GetStrongRandBytes calls (Pieter Wuille)

Tree-SHA512: 77e9b1f3c6eeb0c2a3e0c64358150767222ff0b7120ccd5f4ae0276cea0e4fa275c1b757e3f20be07dc0b4ef07f70ab0b70112080c8d3d0cb6ed703db8a59168
2017-05-09 10:24:45 -07:00
Pieter Wuille bc64b5aa0f
Merge #10322: Use hardware timestamps in RNG seeding
2c0a6f1 Use sanity check timestamps as entropy (Pieter Wuille)
33f853d Test that GetPerformanceCounter() increments (Pieter Wuille)
f544094 Use hardware timestamps in RNG seeding (Pieter Wuille)

Tree-SHA512: ea96ff56d425b5dc693b4dd35c8aa64ba20a01b9bd7d2d65298ece623f434e8cfa190f9c0f9b76df8aa496547bfa64533eb751edec8401d09bd5ee3478928a59
2017-05-09 10:12:41 -07:00
MarcoFalke 776ba233e9
Merge #10287: [tests] Update Unit Test for addrman.h/addrman.cpp
ed36de5 [tests] Update Unit Test for addrman.h/addrman.cpp (Jimmy Song)

Tree-SHA512: e7c08c19e227c34c230900e14a176b2290022b78b0ece387452e673662491c11f26249cbf1711235276c07a964c339e27b4cda9a2730ded5c0e23a650e0d72db
2017-05-09 12:59:01 +02:00
Wladimir J. van der Laan c973cc5a43
Merge #8855: Use a proper factory for creating chainparams
c1082a7 Chainparams: Use the factory for pow tests (Jorge Timón)
2351a06 Chainparams: Get rid of CChainParams& Params(std::string) (Jorge Timón)
f87f362 Chainparams: Use a regular factory for creating chainparams (Jorge Timón)

Tree-SHA512: 359c8a2a1bc9d02db7856d02810240ada28048ac088f878b575597a7255cdb0ffdd1a647085ee67a34c6a7e7ed9e6cfdb61240cf6e75139619b640dbb096072c
2017-05-09 10:31:45 +02:00
Wladimir J. van der Laan 08a7316c14
Merge #9279: Consensus: Move CFeeRate out of libconsensus
381a46e Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module (Jorge Timón)
330bb5a Consensus: Minimal way to move dust out of consensus (Jorge Timón)

Tree-SHA512: 19a2ea8169afd5a9d3f940d8974e34cfaead153e3ff3068ac82fccdb8694d19d9b45938904ec9e8cd095bd5ca3a0080364da29372f6aaf56b11a6c2ccd6c7a4d
2017-05-09 09:19:50 +02:00
Spencer Lievens 012fa9b99d Add OSX keystroke to clear RPCConsole
Currently only Ctrl-L is mentioned in help, but, (⌘)-L functions on OSX and isn't mentioned.
2017-05-08 21:39:34 +02:00
MarcoFalke f4b15e2de9
Merge #10310: [doc] Add hint about getmempoolentry to getrawmempool help.
3a0a5bc [doc] Add hint about getmempoolentry to getrawmempool help. (Karl-Johan Alm)

Tree-SHA512: 8327d7d7ad93296525fbf95b7a824e3525bde84653999f125afd845823eb39e3a03cd39725962ed949aa2b9ad207ecad6d287294fa321ff1a4d7fbd5a4b8560b
2017-05-08 19:28:58 +02:00
Pieter Wuille 3f57c55dba
Merge #10351: removed unused code in INV message
c707ca8 removed unused code in INV message (Greg Griffith)

Tree-SHA512: 8152e9bfb7e1e8a321e7c05ea46826b3ecea6fa5e176727a9c944db170cb134ba1adfa0251bece9683a68d52266291bca58240929337aba6328b915931e60eb9
2017-05-07 22:01:51 -07:00
Wladimir J. van der Laan 750c5a5b84
Merge #10189: devtools/net: add a verifier for scriptable changes. Use it to make CNode::id private.
0f3471f net: make CNode's id private (Cory Fields)
9ff0a51 scripted-diff: net: Use accessor rather than node's id directly (Cory Fields)
e50c33e devtools: add script to verify scriptable changes (Cory Fields)

Tree-SHA512: a0ff50f4e1d38a2b63109b4996546c91b3e02e00d92c0bf04f48792948f78b1f6d9227a15d25c823fd4723a0277fc6a32c2c1287c7abbb7e50fd82ffb0f8d994
2017-05-07 10:01:51 +02:00
Greg Griffith c707ca872d removed unused code in INV message
vToFetch is never used after declaration. When checked if not empty,
evaluation is always false. Best case scenario this is optimized by the
compiler, worst case it wastes  cpu cycles.  It should be removed either
way.
2017-05-07 00:42:04 -04:00
Suhas Daftuar acc2e4bc96 Bugfix: PrioritiseTransaction updates the mempool tx counter
The mempool's nTransactionsUpdated is used by getblocktemplate
to trigger new invocations of CreateNewBlock().
2017-05-06 05:27:21 -04:00
Karl-Johan Alm 3a0a5bc234
[doc] Add hint about getmempoolentry to getrawmempool help. 2017-05-06 12:51:01 +09:00
Pieter Wuille 2c0a6f157d Use sanity check timestamps as entropy 2017-05-05 11:56:24 -07:00
Pieter Wuille 33f853d8d8 Test that GetPerformanceCounter() increments 2017-05-05 11:56:24 -07:00
Pieter Wuille f544094d5e Use hardware timestamps in RNG seeding 2017-05-05 11:56:19 -07:00
Pieter Wuille 525282769e Update to latest libsecp256k1 2017-05-05 11:12:58 -07:00
Pieter Wuille e7c1b4490f Squashed 'src/secp256k1/' changes from 8225239..84973d3
84973d3 Merge #454: Remove residual parts from the schnorr expirement.
5e95bf2 Remove residual parts from the schnorr expirement.
cbc20b8 Merge #452: Minor optimizations to _scalar_inverse to save 4M
4cc8f52 Merge #437: Unroll secp256k1_fe_(get|set)_b32 to make them much faster.
465159c Further shorten the addition chain for scalar inversion.
a2b6b19 Fix benchmark print_number infinite loop.
8b7680a Unroll secp256k1_fe_(get|set)_b32 for 10x26.
aa84990 Unroll secp256k1_fe_(get|set)_b32 for 5x52.
cf12fa1 Minor optimizations to _scalar_inverse to save 4M
1199492 Merge #408: Add `secp256k1_ec_pubkey_negate` and `secp256k1_ec_privkey_negate`
6af0871 Merge #441: secp256k1_context_randomize: document.
ab31a52 Merge #444: test: Use checked_alloc
eda5c1a Merge #449: Remove executable bit from secp256k1.c
51b77ae Remove executable bit from secp256k1.c
5eb030c test: Use checked_alloc
72d952c FIXUP: Missing "is"
70ff29b secp256k1_context_randomize: document.
9d560f9 Merge #428: Exhaustive recovery
8e48aa6 Add `secp256k1_ec_pubkey_negate` and `secp256k1_ec_privkey_negate`
2cee5fd exhaustive tests: add recovery module
678b0e5 exhaustive tests: remove erroneous comment from ecdsa_sig_sign
03ff8c2 group_impl.h: remove unused `secp256k1_ge_set_infinity` function
a724d72 configure: add --enable-coverage to set options for coverage analysis
b595163 recovery: add tests to cover API misusage
6f8ae2f ecdh: test NULL-checking of arguments
25e3cfb ecdsa_impl: replace scalar if-checks with VERIFY_CHECKs in ecdsa_sig_sign

git-subtree-dir: src/secp256k1
git-subtree-split: 84973d393ac240a90b2e1a6538c5368202bc2224
2017-05-05 11:12:58 -07:00
Luke Dashjr a637734ba2 rpc/wallet: Workaround older UniValue which returns a std::string temporary for get_str 2017-05-05 00:21:00 +00:00
Russell Yanofsky c1235e3f2d Add RecursiveDynamicUsage overload for std::shared_ptr
This simplifies a few usage expressions.
2017-05-04 16:50:52 -04:00
Suhas Daftuar 71f1903353 Store disconnected block transactions outside mempool during reorg
Rather than re-add disconnected block transactions back to the mempool
immediately, store them in a separate disconnectpool for later processing,
because we expect most such transactions to reappear in the chain that is
still to be connected (and thus we can avoid the work of reprocessing those
transactions through the mempool altogether).
2017-05-04 16:50:52 -04:00
Pieter Wuille 97477c537e Maintain state across GetStrongRandBytes calls 2017-05-04 10:13:40 -07:00
Cory Fields 0f3471f3ad net: make CNode's id private 2017-05-04 01:04:47 -04:00
Cory Fields 9ff0a51164 scripted-diff: net: Use accessor rather than node's id directly
-BEGIN VERIFY SCRIPT-
sed -i "s/\(node\|to\|from\)->id/\1->GetId()/" src/net.cpp src/net_processing.cpp
-END VERIFY SCRIPT-
2017-05-04 01:04:47 -04:00
Thomas Snider 6c914ac176 [wallet] Securely erase potentially sensitive keys/values 2017-05-03 11:35:51 -07:00
Jorge Timón c1082a7d35
Chainparams: Use the factory for pow tests 2017-05-03 18:18:09 +02:00
Jorge Timón 2351a064a6
Chainparams: Get rid of CChainParams& Params(std::string) 2017-05-03 18:15:54 +02:00
Jorge Timón f87f3626e3
Chainparams: Use a regular factory for creating chainparams 2017-05-03 18:15:47 +02:00
Jorge Timón 381a46e38f
Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module
...from amount.o to policy/feerate.o

Policy, because it moves policy code to the policy directory (common module)
2017-05-03 18:00:13 +02:00
Jorge Timón 330bb5a456
Consensus: Minimal way to move dust out of consensus 2017-05-03 17:55:52 +02:00
Wladimir J. van der Laan 22d870016e
Merge #10311: Remove unused args from GetFetchFlags()
1ff2bb4 Remove unused args from GetFetchhFlags() (BtcDrak)

Tree-SHA512: 75ed1076651f4e255720425386cbce0677c2e38c789a94cda95f51a8e5ed9cb7213f21a974c65539f256da9b91ccbc2fcc16b164815b46cd499b733becbddc57
2017-05-03 11:47:35 +02:00
Wladimir J. van der Laan 0912620888
Merge #10302: [Makefile] Alphabetically Reorder addrdb.cpp
56f09df [Makefile] Alphabetically Reorder addrdb.cpp (Spencer Lievens)

Tree-SHA512: cedf64f5b4a6b20c07881f7e9c1c36421ee04a1ba17319946bae0197f9475dba6d5bda05f8f5d72539fbffcaa0adf8f474ecb2089106215c996576ab1235e8e1
2017-05-03 11:40:29 +02:00
Wladimir J. van der Laan 2a183de0ec
Merge #9966: Control mempool persistence using a command line parameter
a750d77 Add tests for mempool persistence (John Newbery)
91c91e1 Control mempool persistence using a command line parameter. (John Newbery)

Tree-SHA512: 157d01cefd1903b8bfc5cbab42a3cc5e9c1094179bf4b64b3d34c0d4d9b976d593755bfea5c41c631cb758e1de17c6c2058c130d487d20560b7c0bafcddfa520
2017-05-03 11:03:48 +02:00
Wladimir J. van der Laan d3dce0eb67
Merge #10115: Avoid reading the old hd master key during wallet encryption
185c7f0 Avoid reading the old hd master key during wallet encryption (Matt Corallo)

Tree-SHA512: b744e8490c0e948355bb77b2695902bb99f89a68af46aa2be9120bd2ccf3c340eb8a56340fec117f9a935192298028945c9b18120ee6b8b23e7da8ffdb635745
2017-05-03 09:11:45 +02:00
Wladimir J. van der Laan d4732f3232
Merge #9733: Add getchaintxstats RPC
bd1f138 Add getchaintxstats RPC (Pieter Wuille)

Tree-SHA512: 270785b25e7e2faad4528b5ef591d9dc6266f15236563e3f02dac1f2d9ce3732c4d44903fcccf38549f7921f29d1a93cb0a118b7453ccc5afd79739b51e68f46
2017-05-03 08:14:56 +02:00
Pieter Wuille bd1f138e73 Add getchaintxstats RPC 2017-05-03 08:08:27 +02:00
Pieter Wuille 431a548faa
Merge #10297: Simplify DisconnectBlock arguments/return value
db994b2 Simplify DisconnectBlock arguments/return value (Pieter Wuille)

Tree-SHA512: 62ce1a85bde2a5baffb9173ed28f2d8008200ecf8b09332122f1516fe68b33b9d7223cc1c2fffe804e38f767874c6353b76bd483e8ad7d48c4a5e80d6b683039
2017-05-02 20:42:15 -07:00
practicalswift 6345f0b7ec Remove unused argument from MarkBlockAsInFlight(...) 2017-05-02 23:00:14 +02:00
Jimmy Song ed36de59e4 [tests] Update Unit Test for addrman.h/addrman.cpp
Add test for adding multiple addresses to address manager
Clean up unnecessary modulo operations
Add test for GetNewBucket's alternate method signature
2017-05-02 11:01:39 -07:00
Gregory Sanders cb184b3a54 Add constant for maximum stack size 2017-05-02 13:37:41 -04:00
Wladimir J. van der Laan 2580ff81f4
Merge #10314: Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...)
3fe8a83 Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...) (practicalswift)

Tree-SHA512: 68d6a906fef86058ae7190228c7e65b5473b36f76b0cc53181b52c0de96f45d4a8dac0d1656f3793aaf4f79f4ca149ecb8293cc25b3f52fb09ceb114a343e933
2017-05-02 19:00:22 +02:00
Wladimir J. van der Laan faf2dea5ea
Merge #10234: [net] listbanned RPC and QT should show correct banned subnets
d6732d8 [tests] update disconnect_ban.py test case to work with listbanned (John Newbery)
77c54b2 [net] listbanned RPC and QT should show correct banned subnets (John Newbery)

Tree-SHA512: edd0e43377d456260d2697213c2829f8483630f3a668b6707d52605faefa610d951d10e6f22a95eff483cbd14faa8ac9b69fa7d3c0b5735c5f3df23fd71282e0
2017-05-02 18:41:58 +02:00
practicalswift 3fe8a83969 Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...) 2017-05-02 17:18:03 +02:00
Jonas Schnelli a3e756b7d6
Merge #10093: [Qt] Don't add arguments of sensitive command to console window
7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
2017-05-02 14:57:11 +02:00
Wladimir J. van der Laan f4a6180607
Merge #10175: Remove excess logic.
9a763d4 Remove excess logic. (practicalswift)

Tree-SHA512: cfef280cc9cccf5042c9c49a8cd6fb6700764671cdd0d988149121f56c2d43a9ac38c5fc99c92385a9619d2d846480e02a9d655fa2586b1c284961b4634c229b
2017-05-02 14:50:30 +02:00
Wladimir J. van der Laan e7b90f78f5
Merge #10180: [trivial] Fix typos (tempoarily → temporarily, inadvertantly → inadvertently)
66082e0 [trivial] Fix typos (tempoarily → temporarily, inadvertantly → inadvertently) (practicalswift)

Tree-SHA512: f377c379c9b6702894289c96fa50e64da01fa4e9353f8507ec5f1f58b0f3047fffdc473dffca61774f57793b82cf9e1c9b5f3d9a04fb864ccc1f44fc2a711f32
2017-05-02 14:49:04 +02:00
BtcDrak 1ff2bb4e3e
Remove unused args from GetFetchhFlags() 2017-05-02 07:32:21 +00:00
Pieter Wuille e4bbd3d230
Merge #10292: Improved efficiency in COutPoint constructors
4fbae77 Improved efficiency in COutPoint constructors (Marcos Mayorga)

Tree-SHA512: 1e402d5021a47724b6159af90955f1a5932c383f48e3e704f1c9a52daa18d2dce5d8e1fcd02fae6977eab04ab83fa22872110b821d4c6593d940d9642abc9bcd
2017-05-01 16:40:43 -07:00
Pieter Wuille c45da32047
Merge #10305: Fix potential NPD introduced in b297426c
70d3945 Fix potential NPD introduced in b297426c (Matt Corallo)

Tree-SHA512: 920d03d2081ba2f3447cfa655dcbc3e17858454dab051436f717ada977d4f4bfe999c303018bc8aa33f30e37a97c63d70ba08632f5e7b7a8aa555615dde2191a
2017-05-01 15:01:32 -07:00
CryptAxe 3503716f1e
Trivial: remove extra character from comment 2017-05-01 14:18:30 -07:00
Matt Corallo 70d39454ee Fix potential NPD introduced in b297426c
See https://github.com/bitcoin/bitcoin/pull/10290#discussion_r113954232
for more info.
2017-05-01 11:51:06 -04:00
Wladimir J. van der Laan e2b99b1313
Merge #10294: [Wallet] unset change position when there is no change
7c58863 [Wallet] unset change position when there is no change on exact match (Gregory Sanders)

Tree-SHA512: ce8b9337e4132e32d80f954258d50938052c833a48e39431649d6adb16e3d18626a0ae5d300827e7fa397927fba72a1f066cb31af9b0a3ef7f1feb6024461626
2017-05-01 15:20:51 +02:00
Gregory Sanders 7c588637d4 [Wallet] unset change position when there is no change on exact match 2017-05-01 08:07:09 -04:00
Wladimir J. van der Laan 9c33ffd387
Merge #8824: Refactor TxToJSON() and ScriptPubKeyToJSON()
0ff9320 refactor TxToJSON() and ScriptPubKeyToJSON() (jonnynewbs)

Tree-SHA512: caf7d590829e221522edd5b1ab8ce67b53a2c6986d3bbe8477eab420b1007bf60f885ed0a25ba9587e468c00768360ddc31db37847e862858573eaed5ed8b0d6
2017-05-01 09:24:01 +02:00
Wladimir J. van der Laan 8d6d43e933
Merge #10290: Add -stopatheight for benchmarking
b297426 Add -stopatheight for benchmarking (Pieter Wuille)

Tree-SHA512: e8a4cca7fc1accd0dcd3a0eda97839fc34c61f25d6302082a8d6ecf9a0291b4abacbde16a0ecba7bdd2a56dd0c8d4d54300ad3b3478386da21dd7697acce381c
2017-05-01 09:17:15 +02:00
Spencer Lievens 56f09df9d8 [Makefile] Alphabetically Reorder addrdb.cpp
To keep conformity.
2017-04-30 13:25:39 +02:00
Pieter Wuille db994b2de9 Simplify DisconnectBlock arguments/return value
DisconnectBlock currently has a complicated interface:

  Situation       Return value
                  pfClean != nullptr   pfClean == nullptr

  All good:       true                 true
  Failure:        false                false
  Unclean rewind: true                 false
                  with *pfClean=false

Change this to return a tristate enum instead. As an added bonus,
remove the ValidationState& argument which was unused.
2017-04-28 16:15:01 -07:00
John Newbery 77c54b270d [net] listbanned RPC and QT should show correct banned subnets 2017-04-28 11:24:33 -04:00
jonnynewbs 0ff9320bf5 refactor TxToJSON() and ScriptPubKeyToJSON() 2017-04-28 10:01:56 -04:00
Marcos Mayorga 4fbae77929 Improved efficiency in COutPoint constructors 2017-04-28 09:33:34 +01:00
Pieter Wuille b297426c96 Add -stopatheight for benchmarking 2017-04-27 14:39:27 -07:00
Wladimir J. van der Laan 4c924011f5
Merge #10075: Remove unused C++ code not covered by unit tests
b51aaf1 Remove unused C++ code not covered by unit tests (practicalswift)

Tree-SHA512: 267bbd87df01a296bf23e82a8b6ee968e13e23a6aaecc535d803890a3e3e9f6208c7fc4c1f97afd98ed3e498b12fe1ada7e3cb2977ad12359a813f57336c74e5
2017-04-27 20:25:15 +02:00
Pieter Wuille a550f6e415
Merge #10283: Cleanup: reduce to one GetMinimumFee call signature
3edbd79 cleanup: reduce to one GetMinimumFee call signature (Alex Morcos)

Tree-SHA512: da7ae6f0eb06db630792243a47c95d4ceff3baf0ce1ebefa73f1eb6cab1c6fdf0a000770cf61700dd7a9e260d7a313083b79e1d667bd5cbef0b1fe8fbec411e7
2017-04-27 09:25:24 -07:00
MarcoFalke 47535d7c3e
Merge #10280: [test] Unit test amount.h/amount.cpp
dcb69fd [test] Unit test amount.h/amount.cpp (Jimmy Song)

Tree-SHA512: dc50e6158322a282a8b8b60c8eab7ce327a33c48113a1455b8a1784f07e6277ad499e85ec978199468a2dc34e9e288287c8803c215f810fa2d841cdda9a414f5
2017-04-26 23:49:39 +02:00
Alex Morcos 3edbd79a65 cleanup: reduce to one GetMinimumFee call signature 2017-04-26 15:54:23 -04:00
practicalswift b51aaf1c42 Remove unused C++ code not covered by unit tests 2017-04-26 21:20:02 +02:00
Jimmy Song dcb69fde5a [test] Unit test amount.h/amount.cpp
Add tests for MoneyRange, binary operators, ToString and a constructor
2017-04-26 07:25:57 -07:00
Wladimir J. van der Laan cf5782508a
Merge #9614: [wallet] [refactor] Simplify getbalance implementation
02d9f50 [wallet] Remove unneeded legacy getbalance code (Russell Yanofsky)
82b7dc3 [wallet] Add GetLegacyBalance method to simplify getbalance RPC (Russell Yanofsky)

Tree-SHA512: c3b890ff1f5a3df7e886309bad94bdf5cc3c12b72983bb79c72f8655ce16edf581bff0faaade2f18c2cb723f50d516e53f87792f81c3f8143b0c4377c0d80e87
2017-04-26 13:11:32 +02:00
Russell Yanofsky 02d9f50d5f [wallet] Remove unneeded legacy getbalance code 2017-04-26 06:36:38 -04:00
Russell Yanofsky 82b7dc373a [wallet] Add GetLegacyBalance method to simplify getbalance RPC
This adds a simpler new implementation of getbalance logic along with asserts
to confirm it behaves identically to the old logic. The old logic is removed in
the next commit.
2017-04-26 06:36:38 -04:00
Wladimir J. van der Laan 6fdb319165
Merge #9743: Fix several potential issues found by sanitizers
1d31093 fix tsan: utiltime race on nMockTime (Pieter Wuille)
321bbc2 fix ubsan: bitcoin-tx: not initialize context before IsFullyValid (Pieter Wuille)

Tree-SHA512: 39ea83c6122f06339cd425deb236357694e84ce2e4e9c61c10b90a8909b6e42e8c7b76396175cdc4723ababd2fa4f935d48f8a469baf853c5a06d7b962a5c8dc
2017-04-26 12:29:05 +02:00
Wladimir J. van der Laan 8254a8ae21
Merge #10278: [test] Add Unit Test for GetListenPort
1b14449 [test] Add Unit Test for GetListenPort (Jimmy Song)

Tree-SHA512: aea5f60fb3699680cc5acac9d9c8d8712634db9d629bbfa1815a29e5cf46c22f783886c608664baaa91b3282c52ce8069c358850cf4f90acf731a9e6c1701caa
2017-04-26 09:34:41 +02:00
Wladimir J. van der Laan 9c94fb6c32
Merge #9930: Trivial: Correct indentation and bracing
31a14d4 Correct indentation and remove unnecessary braces (Matthias Grundmann)

Tree-SHA512: c0e827ec4474133c7674254dfd13f59608820cd639debc7759bddae71d73451645fcfe14384f343d08f74d69ac3922bafc12a514f3b790ae2bf9271aa67d5f36
2017-04-26 08:50:18 +02:00
Jimmy Song 1b144495d0 [test] Add Unit Test for GetListenPort
Add very basic unit test for GetListenPort in net_tests.cpp
2017-04-25 10:17:04 -07:00
Wladimir J. van der Laan c29a0d4812
Merge #10265: [wallet] [moveonly] Check non-null pindex before potentially referencing
c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)

Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
2017-04-25 16:04:23 +02:00
Wladimir J. van der Laan cb007e4346
Merge #10263: Trivial: fix fee estimate write error log message
94807be Trivial: fix fee estimate write error log message (CryptAxe)

Tree-SHA512: 998c9b331e901562c9ba575a85bc6c66f28d926dfe8116f08ab903e024c63a13fd37a58d19eb6504ad880d5bbccfbf6cba83ba0a6917f5d9068c52114f71b437
2017-04-25 13:28:26 +02:00
Wladimir J. van der Laan 95f5e44075
Merge #10270: Remove Clang workaround for Boost 1.46
93dbb15 Remove Clang workaround for Boost 1.46 (fanquake)

Tree-SHA512: 1246841b264688f5fe5a2a514dd732d400307fa068686857e8aedaebb292ae65b21ab96b5ff9477ccd2f049882b967b6e143683963ce1be0b9e781596c5372d1
2017-04-25 12:04:52 +02:00
Karl-Johan Alm c36ea693ee
[wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. 2017-04-25 16:18:52 +09:00
Pavel Janík 5ec883667f Prevent warning: variable 'x' is uninitialized 2017-04-25 08:47:58 +02:00
fanquake 93dbb15954
Remove Clang workaround for Boost 1.46 2017-04-25 09:16:57 +08:00
Pieter Wuille c73af5416b
Merge #10249: Switch CCoinsMap from boost to std unordered_map
e6756ad Switch CCoinsMap from boost to std unordered_map (Pieter Wuille)
344a2c4 Add support for std::unordered_{map,set} to memusage.h (Pieter Wuille)

Tree-SHA512: 51288301e7c0f29ffac8c59f4cc73ddc36b7abeb764009da6543f2eaeeb9f89bd47dde48131a7e0aefad8f7cb0b74b2f33b8be052c8e8a718339c3e6bb963447
2017-04-24 16:06:15 -07:00
Wladimir J. van der Laan fa1ac2881f
Merge #9951: Wallet database handling abstractions/simplifications
911a480 wallet: Add comment describing the various classes in walletdb.h (Wladimir J. van der Laan)
69d2e9b wallet: Make IsDummy private in CWalletDBWrapper (Wladimir J. van der Laan)
3323281 wallet: CWalletDB CDB composition not inheritance (Wladimir J. van der Laan)
be9e1a9 wallet: Reduce references to global bitdb environment (Wladimir J. van der Laan)
071c955 wallet: Get rid of fFileBacked (Wladimir J. van der Laan)
71afe3c wallet: Introduce database handle wrapper (Wladimir J. van der Laan)

Tree-SHA512: e4e72953c61a2f6995d609a32f8ed8e18cab9a92bc9e193d46a1d1f06d9daa5c6da6fce2867d4e3ba4fc0439141901a3d35f246486f0fa8f59587786379dfcbd
2017-04-24 16:31:34 +02:00
Wladimir J. van der Laan 342b9bc390
Merge #9792: FastRandomContext improvements and switch to ChaCha20
4fd2d2f Add a FastRandomContext::randrange and use it (Pieter Wuille)
1632922 Switch FastRandomContext to ChaCha20 (Pieter Wuille)
e04326f Add ChaCha20 (Pieter Wuille)
663fbae FastRandom benchmark (Pieter Wuille)
c21cbe6 Introduce FastRandomContext::randbool() (Pieter Wuille)

Tree-SHA512: 7fff61e3f6d6dc6ac846ca643d877b377db609646dd401a0e8f50b052c6b9bcd2f5fc34de6bbf28f04afd1724f6279ee163ead5f37d724fb782a00239f35db1d
2017-04-24 14:28:49 +02:00
CryptAxe 94807be8c6
Trivial: fix fee estimate write error log message 2017-04-23 10:36:26 -07:00
MarcoFalke ed22eb4a62
Merge #10258: Fixed typo in documentation for merkleblock.h
dd07068 Fixed typo in documentation for merkleblock.h (Mikerah)

Tree-SHA512: 92655c8022eb33852c116da517b12bd17b3b668713cd85fe185a15245ea9810605626b1d0955fa117f7b56863e0a52b3a86dab42409332452b5eb72a7d34f30d
2017-04-23 16:49:53 +02:00
Mikerah dd07068d6b Fixed typo in documentation for merkleblock.h 2017-04-22 07:22:17 -04:00
Wladimir J. van der Laan a6548a47a5
Merge #10201: pass Consensus::Params& to ReceivedBlockTransactions()
25660e9 pass Consensus::Params& to ReceivedBlockTransactions() (Mario Dian)

Tree-SHA512: d3a5b19d93313e4bda622b322bc9cbfb7e31486010eac40fca6eea9703f814f9667f778122ba7366bb304482a2c03e2e3325083beecac374751692361952e467
2017-04-21 18:42:06 +02:00
Wladimir J. van der Laan 911a4808fb wallet: Add comment describing the various classes in walletdb.h 2017-04-21 16:04:26 +02:00
Pieter Wuille f478d98fe4 Fix some empty vector references
streams.h has some methods that can be tricked into dereferencing
null pointers or end() iterators. Fix this.
2017-04-21 05:58:31 -07:00
Pieter Wuille e6756ad335 Switch CCoinsMap from boost to std unordered_map 2017-04-21 05:34:14 -07:00
Pieter Wuille 344a2c4122 Add support for std::unordered_{map,set} to memusage.h 2017-04-21 05:26:23 -07:00
Wladimir J. van der Laan 27faa6cccd
Merge #10228: build: regenerate bitcoin-config.h as necessary
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields)
3577603 build: remove wonky auto top-level convenience targets (Cory Fields)

Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
2017-04-21 11:12:29 +02:00
Wladimir J. van der Laan f6f3b58a72
Merge #10242: [qt] Don't call method on null WalletModel object
fb463d1 [qt] Don't call method on null WalletModel object (Russell Yanofsky)

Tree-SHA512: 84c9d394a16eb44e2673e7d16961ea9514fd0ef3912baf7cd7b8424a46ead138ac8ecc59c4eebfb46941fa3081555fd6ee15fec699a3952e81f960932e06cee0
2017-04-21 10:57:16 +02:00
Wladimir J. van der Laan 86ea3c2ff2
Merge #10181: Include cleanup
1c897fc Missing includes (Jorge Timón)
a1fd450 Trivial: Remove unneeded includes from .h: (Jorge Timón)

Tree-SHA512: ada3e62cc2435e58172a88b380be371b717a05725956c15e5493b6e19fe2903e5e6e43fd22dc24699333a0e8a0c7b42eb1ae61b41cb4ba82495be18e2d4ef3c6
2017-04-20 23:24:00 +02:00
Alex Morcos c0a273f4c8 Change file format for fee estimates.
Move buckets and bucketMap to be stored as part of overall serialization of estimator.
Add some placeholder data so file format is only changed once.
Maintain 3 different TxConfirmStats with potential for different decays and scales.
2017-04-20 15:46:15 -04:00
Russell Yanofsky fb463d1717 [qt] Don't call method on null WalletModel object
This doesn't crash currently because the method doesn't access any object
members, but this behavior is fragile and incompatible with #10102.
2017-04-20 15:17:17 -04:00
Wladimir J. van der Laan 14c948987f
Merge #9942: Refactor CBlockPolicyEstimator
68af651 MOVEONLY: move TxConfirmStats to cpp (Alex Morcos)
2332f19 Initialize TxConfirmStats in constructor (Alex Morcos)
5ba81e5 Read and Write fee estimate file directly from CBlockPolicyEstimator (Alex Morcos)
14e10aa Call estimate(Smart)Fee directly from CBlockPolicyEstimator (Alex Morcos)
dbb9e36 Give CBlockPolicyEstimator it's own lock (Alex Morcos)
f6187d6 Make processBlockTx private. (Alex Morcos)
ae7327b Make feeEstimator its own global instance of CBlockPolicyEstimator (Alex Morcos)

Tree-SHA512: dbf3bd2b30822e609a35f3da519b62d23f8a50e564750695ddebd08553b4c01874ae3e07d792c6cc78cc377d2db33b951ffedc46ac7edaf5793f9ebb931713af
2017-04-20 21:17:17 +02:00
Wladimir J. van der Laan 69d2e9ba67 wallet: Make IsDummy private in CWalletDBWrapper
This is only for use in the low-level functions, and CDB is already
a friend class.
2017-04-20 17:55:01 +02:00
Wladimir J. van der Laan 33232810dc wallet: CWalletDB CDB composition not inheritance
CWalletDB now contains a CDB instead of inheriting from it.

This makes it easier to replace the internal transaction with a different
database, without leaking through internals.
2017-04-20 17:55:01 +02:00
Wladimir J. van der Laan be9e1a968d wallet: Reduce references to global bitdb environment 2017-04-20 17:15:31 +02:00
Wladimir J. van der Laan 071c95570b wallet: Get rid of fFileBacked
Instead, CWalletDB() with a dummy handle will just give you a no-op
database in which writes always succeeds and reads always fail. CDB
already had functionality for this, so just use that.
2017-04-20 17:15:31 +02:00
Wladimir J. van der Laan 71afe3c099 wallet: Introduce database handle wrapper
Abstract database handle from explicit strFilename into
CWalletDBWrapper.

Also move CWallet::Backup to db.cpp - as it deals with representation
details this is a database specific operation.
2017-04-20 17:15:30 +02:00
Pieter Wuille 1d31093d4d fix tsan: utiltime race on nMockTime 2017-04-20 06:25:15 -07:00
Pieter Wuille 321bbc2079 fix ubsan: bitcoin-tx: not initialize context before IsFullyValid 2017-04-20 06:25:15 -07:00
Wladimir J. van der Laan 987a6c0956
Merge #10231: [Qt] Reduce a significant cs_main lock freeze
4082fb0 Add missing <atomic> header in clientmodel.h (Jonas Schnelli)
928d4a9 Set both time/height header caches at the same time (Jonas Schnelli)
610a917 Declare headers height/time cache mutable, re-set the methods const (Jonas Schnelli)
cf92bce Update the remaining blocks left in modaloverlay at init. (Jonas Schnelli)
7148f5e Reduce cs_main locks during modal overlay by adding an atomic cache (Jonas Schnelli)

Tree-SHA512: a92ca22f90b8b2a5e8eb94fdce531ef44542e21a8dbbb0693f7723d7018592cb68de687a2a0aac91d31cbf019793f8e922550656d2b130ed3d854d60630341db
2017-04-20 13:41:07 +02:00
Jonas Schnelli 4082fb0003
Add missing <atomic> header in clientmodel.h 2017-04-20 13:29:12 +02:00
Wladimir J. van der Laan a987def4f6
Merge #10143: [net] Allow disconnectnode RPC to be called with node id
d54297f [tests] disconnect_ban: add tests for disconnect-by-nodeid (John Newbery)
5cc3ee2 [tests] disconnect_ban: remove dependency on urllib (John Newbery)
12de2f2 [tests] disconnect_ban: use wait_until instead of sleep (John Newbery)
2077fda [tests] disconnect_ban: add logging (John Newbery)
395561b [tests] disconnectban test - only use two nodes (John Newbery)
e367ad5 [tests] rename nodehandling to disconnectban (John Newbery)
d6564a2 [tests] fix nodehandling.py flake8 warnings (John Newbery)
23e6e64 Allow disconnectnode() to be called with node id (John Newbery)

Tree-SHA512: a371bb05a24a91cdb16a7ac4fbb091d5d3bf6554b29bd69d74522cb7523d3f1c5b1989d5e7b03f3fc7369fb727098dd2a549de551b731dd480c121d9517d3576
2017-04-20 11:47:22 +02:00
Jonas Schnelli 928d4a9ac5
Set both time/height header caches at the same time 2017-04-20 09:51:41 +02:00
Jonas Schnelli 610a91719c
Declare headers height/time cache mutable, re-set the methods const 2017-04-20 09:51:05 +02:00
Jonas Schnelli cf92bce526
Update the remaining blocks left in modaloverlay at init. 2017-04-19 20:54:30 +02:00
Jonas Schnelli 7148f5e7d7
Reduce cs_main locks during modal overlay by adding an atomic cache 2017-04-19 20:54:18 +02:00
John Newbery 23e6e64a24 Allow disconnectnode() to be called with node id
disconnectnode() can currently only be called with the IP address/port
of the node the user wishes to connect. This commit allows the node to
be disconnected using the nodeid returned by getpeerinfo().
2017-04-19 13:47:51 -04:00
Wladimir J. van der Laan c91ca0ace9
Merge #9827: Improve ScanForWalletTransactions return value
30abce7 Improve ScanForWalletTransactions return value (Russell Yanofsky)

Tree-SHA512: 195028553b103052a842b6a37e67410118a20c32475b80f7fd22d6d8622f92eca1c2d84f291d1092bef2161d3187d91052799b533e1e265b7613d51955490b8d
2017-04-19 12:30:02 +02:00
Jonas Schnelli e96486cbeb
Merge #10221: Stop treating coinbase outputs differently in GUI: show them at 1conf
608bbcc [qt] Stop treating coinbase outputs differently: show them at 1conf (Matt Corallo)

Tree-SHA512: 62ba10520da8b83cf8e97c86dec3ccdcca8b7bfae0174d1a4099d33aa5d11933cc7c248394bf67c2b105211cf7931955816c741957832e703211030c7f4f002f
2017-04-19 11:15:06 +02:00
Wladimir J. van der Laan 64c45aada7
Merge #10226: wallet: Use boost to more portably ensure -wallet specifies only a filename
a4186dd wallet: Use boost to more portably ensure -wallet specifies only a filename (Luke Dashjr)

Tree-SHA512: 6dfde31fa599638e5ec76489363e2fed97403be3e5762e4560dfc6ac261ce169a92b5a1b92bb34a893cc898e6073c81f74f49528e8df07e86273ddb37dd1ce80
2017-04-19 10:55:13 +02:00
Cory Fields 91ab8f5a99 build: fix bitcoin-config.h regeneration after touching build files
This was a long-standing and annoying problem.

If autogen.sh was not manually run after touching configure.ac,
bitcoin-config.h would not be properly regenerated. This causes very subtle
problems when configure appears to enable a new value, but it does not end up
reflected in the build.
2017-04-18 19:14:25 -04:00
Luke Dashjr a4186dd239 wallet: Use boost to more portably ensure -wallet specifies only a filename 2017-04-18 15:39:16 +00:00
Wladimir J. van der Laan 393160cf6c
Merge #10208: [wallet] Rescan abortability
9141622 [rpc] Add abortrescan command to RPC interface. (Kalle Alm)
75a08e7 [wallet] Add support for aborting wallet transaction rescans. (Kalle Alm)

Tree-SHA512: 18545a1dc48c6dc112993f971f3adc7c0341fa621186c6d70bef1052e1d127ca116c5769595d721a209d502ca2019f2ad33876fe35d2b17216393404607a6c76
2017-04-18 08:05:24 +02:00
Kalle Alm 9141622a0f
[rpc] Add abortrescan command to RPC interface. 2017-04-18 11:41:46 +09:00
MarcoFalke 50a1cc0f0a
Merge #10207: Clarify importprivkey help text ... example of blank label without rescan
c9e31c3 Clarify importprivkey help text with example of blank label without rescan Occasionally I waste a lot of time not remembering that the second parameter to importprivkey must be blank if you intend to stop rescan with "false" as the third parameter. (Warren Togami)

Tree-SHA512: 23781e1d6fd59a9d06d6e12ad10e8ed6641947b3e4a1f66c8fdb5d44cbd8f291e8f2a5e686aa9f9ba5e4bab8ca688caa17244e837f651546055ddf7cc8e7df8f
2017-04-17 22:11:03 +02:00
Kalle Alm 75a08e7d17
[wallet] Add support for aborting wallet transaction rescans. 2017-04-17 23:35:53 +09:00
Matt Corallo 608bbccfb9 [qt] Stop treating coinbase outputs differently: show them at 1conf 2017-04-17 10:16:21 -04:00
Wladimir J. van der Laan 2584925077
Merge #10178: Remove CValidationInterface::UpdatedTransaction
9fececb Remove CValidationInterface::UpdatedTransaction (Matt Corallo)
d89f8ad Make DisconnectBlock and ConnectBlock static in validation.cpp (Matt Corallo)

Tree-SHA512: 146597b538c09c1e8071f4f88ffeba0645c6816f86030b142174bd298cc18ae09a400e6ca8de04d091e37b635f99f4c05982c09e6729691eb8ca6b8439ab97ca
2017-04-17 14:46:04 +02:00
Pieter Wuille a077a90da8
Merge #10215: Check interruptNet during dnsseed lookups
b2c9254 Check interruptNet during dnsseed lookups (Matt Corallo)

Tree-SHA512: a76b5749b085d5571ac65a6925bb1c50fa1d02c02854d9126224dc2ec419eb9103f7c92bf9a0bbd39c7dee93a2266dc3973fb16b48e8daea057f45d452e2513c
2017-04-17 05:15:37 -07:00
Pieter Wuille c5e9e428a9
Merge #9693: Prevent integer overflow in ReadVarInt.
45f0961 Prevent integer overflow in ReadVarInt. (Gregory Maxwell)

Tree-SHA512: 385ea0efb6b59d44c45a49227e5f6fff236b4775544cbeb236312a3fd87fd75c226ac56f7aa1bca66b853639da75a579610074f7582f92cf2ebd4a74bc40f6f0
2017-04-17 04:58:31 -07:00
Matt Corallo b2c9254205 Check interruptNet during dnsseed lookups 2017-04-14 16:52:42 -04:00
Wladimir J. van der Laan f4db00f9a5
Merge #10204: [rpc] rename disconnectnode argument
883154c [rpc] rename disconnectnode argument (John Newbery)

Tree-SHA512: 14245befd0a7315edd9e03c8bb283ff6b546cf4ef93c3ce02c01de687fea3bb96c510a638a42d2d6799e5e3e5b4f800021c2530b504baeaa4a4dc99323165986
2017-04-14 10:16:01 +02:00
Warren Togami c9e31c36ff Clarify importprivkey help text with example of blank label without rescan
Occasionally I waste a lot of time not remembering that the second parameter to importprivkey must be blank if you intend to stop rescan with "false" as the third parameter.
2017-04-13 20:11:42 -07:00
John Newbery 883154cbcb [rpc] rename disconnectnode argument 2017-04-13 15:38:59 -04:00
Pieter Wuille b7365f0545
Merge #9480: De-duplicate SignatureCacheHasher
f9c8807 Deduplicate SignatureCacheHasher (Jeremy Rubin)

Tree-SHA512: 714a0f39d1c836fedd1868369b4ebf1096cd800cc544d57b54101da338c80c627a3e59c6644b3268054efe85053cf1a7be508af935f624491e7acfae61123994
2017-04-13 10:13:13 -07:00
Matt Corallo 185c7f08be Avoid reading the old hd master key during wallet encryption
This makes SetHDMasterKey responsible for maintinaing the CHDChain
version instead of always creating it with the latest version and
making EncryptWallet responsible for keeping the version from
changing.
2017-04-13 11:55:43 -04:00
Wladimir J. van der Laan eab00d96df
Merge #9665: Use cached [compact] blocks to respond to getdata messages
b49ad44 Add comment about cs_most_recent_block coverage (Matt Corallo)
c47f5b7 Cache witness-enabled state with recent-compact-block-cache (Matt Corallo)
efc135f Use cached [compact] blocks to respond to getdata messages (Matt Corallo)

Tree-SHA512: ffc478bddbf14b8ed304a3041f47746520ce545bdeffa9652eff2ccb25c8b0d5194abe72568c10f9c1b246ee361176ba217767af834752a2ca7263d292005e87
2017-04-13 17:22:26 +02:00
Mario Dian 25660e91ef pass Consensus::Params& to ReceivedBlockTransactions() 2017-04-13 22:37:46 +08:00
Matt Corallo 9fececb2cb Remove CValidationInterface::UpdatedTransaction
This removes another callback from block connection logic, making it
easier to reason about the wallet-RPCs-returns-stale-info issue.

UpdatedTransaction was previously used by the GUI to display
coinbase transactions only after they have a block built on top of
them. This worked fine for in most cases, but only worked due to a
corner case if the user received a coinbase payout in a block
immediately prior to restart. In that case, the normal process of
caching the most recent coinbase transaction's hash would not work,
and instead it would only work because of the on-load -checkblocks
calling DisconnectBlock and ConnectBlock on the current tip.

In order to make this more robust, a full mapWallet loop after the
first block which is connected after restart was added.
2017-04-13 10:36:21 -04:00
Wladimir J. van der Laan cf8a8b1028
Merge #10176: net: gracefully handle NodeId wrapping
c851be4 net: define NodeId as an int64_t (Cory Fields)

Tree-SHA512: 2ccc931cfcdc555313b9434d8de2f6cea759b31891212ca62f962208f60157d4fc593010e3ca61265d1a20d6f78c6ca79103600b85df77983d5509d192875b96
2017-04-13 16:35:27 +02:00
Wladimir J. van der Laan 70f6f56e9d
Merge #10165: [Wallet] Refactoring by using CInputCoin instead of std::pair
c37e32a [Wallet] Prevent CInputCoin to be in a null state (NicolasDorier)
f597dcb [Wallet] Simplify code using CInputCoin (NicolasDorier)
e78bc45 [Wallet] Decouple CInputCoin from CWalletTx (NicolasDorier)
fd44ac1 [Wallet] Rename std::pair<const CWalletTx*, unsigned int> to CInputCoin (NicolasDorier)

Tree-SHA512: d24361fc514a0566bce1c3953d766dfe4fece79c549cb4db2600695a4ce08e85caa61b7717812618e523a2f2a1669877dad2752ed079e2ed2d27249f9bc8590e
2017-04-13 12:08:26 +02:00
Wladimir J. van der Laan c9ff4f8ee6
Merge #10186: Remove SYNC_TRANSACTION_NOT_IN_BLOCK magic number
d0cd0bd Make CWallet::SyncTransactions() interface friendlier (John Newbery)
714e4ad AddToWalletIfInvolvingMe should test pIndex, not posInBlock (John Newbery)

Tree-SHA512: d02e7ffce635c53f3e099c37cc5613b431f74e0e3ea189269132901a99fc539477849ddad0282ce721d46a4d794c2d46523d58b64f0c26c655f70b5808c745a5
2017-04-13 10:50:00 +02:00
NicolasDorier c37e32af0d [Wallet] Prevent CInputCoin to be in a null state 2017-04-13 05:32:24 +00:00
NicolasDorier f597dcb7c8 [Wallet] Simplify code using CInputCoin 2017-04-13 05:31:08 +00:00
NicolasDorier e78bc45810 [Wallet] Decouple CInputCoin from CWalletTx 2017-04-13 05:30:52 +00:00
Jorge Timón 1c897fc3da
Missing includes 2017-04-13 02:31:44 +02:00
Jorge Timón a1fd450328
Trivial: Remove unneeded includes from .h:
- validation.h doesn't need to include chain.h anymore
- Remove unneeded includes from net.h
2017-04-13 02:27:27 +02:00
Jeremy Rubin f9c88079df Deduplicate SignatureCacheHasher
This moves the SignatureCacheHasher to the sigcache header, out of the anonymous
namespace, so that the tests can import it.
2017-04-12 14:42:41 -07:00
Wladimir J. van der Laan de01da7cad
Merge #10177: Changed "Send" button default status from true to false
8c3e6c6 Changed "Send" button default status from true to false (KibbledJiveElkZoo)

Tree-SHA512: e60d7481351e88925d99b33bdb616f3c234e93ef052571b9c4a1328186ec9abb8b61b0c4299afcb731edad2634aef6b1adaad121646b6c0c56dc933662904674
2017-04-12 20:15:37 +02:00
Wladimir J. van der Laan 350b22497c
Merge #10150: [rpc] Add logging rpc
7fd50c3 allow libevent logging to be updated during runtime (John Newbery)
5255aca [rpc] Add logging RPC (John Newbery)
4d9950d Set BCLog::LIBEVENT correctly for old libevent versions. (John Newbery)

Tree-SHA512: d6788a7205372c0528da71eca052910dfb055f2940ca884f422ff3db66e23a2b49c6a15b8f27d5255554fe5c5a928f5dd903fdc63b0bd6c8fa7783e77bb30fe8
2017-04-12 19:57:22 +02:00
Cory Fields c851be4b25 net: define NodeId as an int64_t
This should make occurances of NodeId wrapping essentially impossible for
real-world usage.
2017-04-12 13:42:02 -04:00
John Newbery d0cd0bd6d9 Make CWallet::SyncTransactions() interface friendlier 2017-04-11 17:17:46 -04:00
John Newbery 714e4ad13d AddToWalletIfInvolvingMe should test pIndex, not posInBlock 2017-04-11 10:23:32 -04:00
John Newbery 7fd50c3b70 allow libevent logging to be updated during runtime 2017-04-10 17:05:59 -04:00
John Newbery 5255aca3f4 [rpc] Add logging RPC
Adds an RPC to get and set currently active logging categories.
2017-04-10 17:05:59 -04:00
John Newbery 4d9950d3bc Set BCLog::LIBEVENT correctly for old libevent versions. 2017-04-10 17:05:59 -04:00
practicalswift 66082e0119 [trivial] Fix typos (tempoarily → temporarily, inadvertantly → inadvertently) 2017-04-10 22:44:57 +02:00
Matt Corallo d89f8adf25 Make DisconnectBlock and ConnectBlock static in validation.cpp 2017-04-10 16:20:12 -04:00
Wladimir J. van der Laan 67023e9004
Merge #9725: CValidationInterface Cleanups
b1a6d4c Take a CTransactionRef in AddToWalletIfInvolvingMe to avoid a copy (Matt Corallo)
1c95e2f Use std::shared_ptr instead of boost::shared_ptr in ScriptForMining (Matt Corallo)
91f1e6c Remove dead-code tracking of requests for blocks we generated (Matt Corallo)
acad82f Add override to functions using CValidationInterface methods (Matt Corallo)
e6d5e6c Hold cs_wallet for whole block [dis]connection processing (Matt Corallo)
461e49f SyncTransaction->TxAddedToMempool/BlockConnected/Disconnected (Matt Corallo)
f404334 Handle SyncTransaction in ActivateBestChain instead of ConnectTrace (Matt Corallo)
a147687 Keep conflictedTxs in ConnectTrace per-block (Matt Corallo)
d3167ba Handle conflicted transactions directly in ConnectTrace (Matt Corallo)
29e6e23 Make ConnectTrace::blocksConnected private, hide behind accessors (Matt Corallo)
822000c Add pblock to connectTrace at the end of ConnectTip, not start (Matt Corallo)
f5e9a01 Include missing #include in zmqnotificationinterface.h (Matt Corallo)

Tree-SHA512: 8893d47559da3b28d2ef7359768547cba8a4b43b6f891d80f5848f995a84b1517bfb0f706fdc8cd43f09a1350349eb440d9724a59363ab517dfcc4fcb31b2018
2017-04-10 21:21:01 +02:00
Alex Morcos 68af651498 MOVEONLY: move TxConfirmStats to cpp 2017-04-10 13:56:50 -04:00
Alex Morcos 2332f19bef Initialize TxConfirmStats in constructor
and change to storing as a pointer.
2017-04-10 13:56:50 -04:00
Alex Morcos 5ba81e54e0 Read and Write fee estimate file directly from CBlockPolicyEstimator 2017-04-10 13:56:50 -04:00
Alex Morcos 14e10aa842 Call estimate(Smart)Fee directly from CBlockPolicyEstimator 2017-04-10 13:56:50 -04:00
Alex Morcos dbb9e3699b Give CBlockPolicyEstimator it's own lock 2017-04-10 13:51:51 -04:00
Alex Morcos f6187d6e39 Make processBlockTx private. 2017-04-10 13:51:51 -04:00
Alex Morcos ae7327b832 Make feeEstimator its own global instance of CBlockPolicyEstimator 2017-04-10 13:51:51 -04:00
KibbledJiveElkZoo 8c3e6c6987 Changed "Send" button default status from true to false
Changed the "Send" button's default status from true to false to prevent
quirky Windows autofocus behavior.
2017-04-10 11:52:18 -05:00
Wladimir J. van der Laan e183ea2047
Merge #10164: Wallet: reduce excess logic InMempool()
3491476 Wallet: reduce excess logic InMemPool() (Kewde)

Tree-SHA512: 554ea2827cfd482281fae0ba3d0a7989dbfeace98a35462732ea08bf3cc94c9564a9ea8ca2fa9905b963367d0b56a490ef0d83ceb6731c8f06187de98b6a7f23
2017-04-10 15:27:34 +02:00
Luke Dashjr c99ab3ca4b RPC: Allow multiple names for parameters 2017-04-10 09:26:03 -04:00
Wladimir J. van der Laan e19586a8a9
Merge #10135: [p2p] Send the correct error code in reject messages
5d08c9c Send the correct error code in reject messages (John Newbery)

Tree-SHA512: 0cd3ef3ae202584b138cc0bbfba4125635822e0c5a755fb9276a604b39286959ab22dabc3104aa5d7e71358cd69d965de2a333ff04bf3e8ed43cf0296ac01264
2017-04-10 14:44:22 +02:00
Wladimir J. van der Laan a27dbc55b1
Merge #9949: [bench] Avoid function call arguments which are pointers to uninitialized values
218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0
2017-04-10 14:19:55 +02:00
Wladimir J. van der Laan 51833a1734
Merge #10156: Fix for issues with startup and multiple monitors on windows.
e9ff818 Fix for issues with startup and multiple monitors on windows. (Allan Doensen)

Tree-SHA512: 8502042a9b5a2fd6f5e409163bee9bd7c85e34c158754f393065f8cc6cdd0f8505b9a1803069d01fc1fb2df04d1b2ed6291388851f2ed3608eb2dd53fc22e06e
2017-04-10 11:34:20 +02:00
Allan Doensen e9ff818b69 Fix for issues with startup and multiple monitors on windows. 2017-04-10 11:17:12 +02:00
Jonas Schnelli 1fa4ae67a3
Merge #9890: Add a button to open the config file in a text editor
9ab9e7d Add a button to open the config file in a text editor (Eric Shaw Jr)

Tree-SHA512: 1d13be9ac788a05a5116dbb3e1136ef65732dc2b5634547860612658109668922c9ea80b77bde4ba5beaa762d54f2a986a6064d4e34e963cdcd3d126a4eced37
2017-04-10 10:46:21 +02:00
practicalswift 9a763d4f86 Remove excess logic. 2017-04-10 10:24:49 +02:00
Wladimir J. van der Laan 813eacf81b
Merge #10167: [trivial] Fix typo ("improssible" → "impossible")
bcca57e [trivial] Fix typo ("improssible" → "impossible") (practicalswift)

Tree-SHA512: 87cdd0474b9e5d5150d3be7f93c61df126f7444f6e0cf34e763b25d68ad9149497535f34f7638eb42291a78d1ca2cff576014331151daedd26c57df5c31b9b0c
2017-04-10 09:27:25 +02:00
Wladimir J. van der Laan ed09dd3f5a
Merge #10142: Run bitcoin_test-qt under minimal QPA platform
bf10264 Run bitcoin_test-qt under minimal QPA platform (Russell Yanofsky)

Tree-SHA512: 35782f0d7e4dcdc27d991d5a10fcffbd2d201139293fe7917ef6f7cd7ae4d3a162ebc21f83266d821ae3bad86f62d947b047bb317f6c5899df4d6bcb4c957157
2017-04-10 09:01:58 +02:00
NicolasDorier fd44ac1e8b [Wallet] Rename std::pair<const CWalletTx*, unsigned int> to CInputCoin 2017-04-08 03:50:14 +00:00
John Newbery dd7e43e438 Fix build warning from #error text 2017-04-07 14:37:25 -04:00
practicalswift bcca57eff0 [trivial] Fix typo ("improssible" → "impossible") 2017-04-07 18:29:54 +02:00
Wladimir J. van der Laan a5fd746674
Merge #9681: Refactor Bumpfee, move core functionality to CWallet
5f59d3e Improve CFeeBumper interface, add comments, make use of std::move (Jonas Schnelli)
0df22ed Cancel feebump is vErrors is not empty (Jonas Schnelli)
44cabe6 Use static calls for GetRequiredFee and GetMinimumFee, remove make_pair from emplace_back (Jonas Schnelli)
bb78c15 Restore CalculateMaximumSignedTxSize function signature (Jonas Schnelli)
51ea44f Use "return false" instead assert() in CWallet::SignTransaction (Jonas Schnelli)
bcc72cc Directly abort execution in FeeBumper::commit if wallet or tx is not available (Jonas Schnelli)
2718db0 Restore invalid fee check (must be > 0) (Jonas Schnelli)
0337a39 Refactor Bumpfee core functionality (Jonas Schnelli)
d1a95e8 Bumpfee move request parameter interaction to the top (Jonas Schnelli)

Tree-SHA512: 0e6d1f3322ed671fa2291e59ac9556ce4646bc78267edc6eedc46b0014b7b08aa83c30315358b911d82898847d4845634a18b67e253a7b699dcc852eb2652c07
2017-04-07 15:51:26 +02:00
Wladimir J. van der Laan 928695bee6
Merge #10155: build: Deduplicate version numbers
9ff7818 doc: Update release process for simplified version bumping (Wladimir J. van der Laan)
08d9aee build: Remove duplicate version information from src/clientversion.h (Wladimir J. van der Laan)
168a703 doc: Make build system insert version in Doxyfile (Wladimir J. van der Laan)
b67eb8d doc: Remove version numbers from READMEs (Wladimir J. van der Laan)

Tree-SHA512: 531e44282b1c1383a382847a5605177917dfbf78acfaa754d1cbadd2e165c7e34ddbd01790f87615083fac359571708c2551ad24b712aab1f84a2068360c3a17
2017-04-07 15:41:04 +02:00
Wladimir J. van der Laan a3a2160b66
Merge #10162: [trivial] Log calls to getblocktemplate
1352092 Log calls to getblocktemplate (John Newbery)

Tree-SHA512: de2c6faac8baea2f63eb499dbcd0669062a71759050cf8bcada9b454fe82f056c23635d41c755badf55158ffc40a380f82bea1f40c8a2cc51604d981515b71eb
2017-04-07 14:55:29 +02:00
Matt Corallo b1a6d4cd56 Take a CTransactionRef in AddToWalletIfInvolvingMe to avoid a copy 2017-04-07 11:53:43 +02:00
Matt Corallo 1c95e2f9c9 Use std::shared_ptr instead of boost::shared_ptr in ScriptForMining 2017-04-07 11:53:43 +02:00
Matt Corallo 91f1e6ce5e Remove dead-code tracking of requests for blocks we generated 2017-04-07 11:53:43 +02:00
Matt Corallo acad82f375 Add override to functions using CValidationInterface methods 2017-04-07 11:53:43 +02:00
Matt Corallo e6d5e6cbbe Hold cs_wallet for whole block [dis]connection processing
This simplifies fixing the wallet-returns-stale-info issue as we
now hold cs_wallet across an entire block instead of only per-tx.
2017-04-07 11:53:43 +02:00
Matt Corallo 461e49fee2 SyncTransaction->TxAddedToMempool/BlockConnected/Disconnected
This simplifies fixing the wallet-returns-stale-info issue as we
can now hold cs_wallet across an entire block instead of only
per-tx (though we only actually do so in the next commit).

This change also removes the NOT_IN_BLOCK constant in favor of only
passing the CBlockIndex* parameter to SyncTransactions when a new
block is being connected, instead of also when a block is being
disconnected.

This change adds a parameter to BlockConnectedDisconnected which
lists the transactions which were removed from mempool due to
confliction as a result of this operation. While its somewhat of a
shame to make block-validation-logic generate a list of mempool
changes to be included in its generated callbacks, fixing this isnt
too hard.

Further in this change-set, CValidationInterface starts listening
to mempool directly, placing it in the middle and giving it a bit
of logic to know how to route notifications from block-validation,
mempool, etc (though not listening for conflicted-removals yet).
2017-04-07 11:53:43 +02:00