Commit graph

8408 commits

Author SHA1 Message Date
Jeremy Rubin c9e69fbf39 Add CuckooCache implementation and replace the sigcache map_type with it
SQUASHME: Change cuckoocache to only work for powers of two, to avoid mod operator
SQUASHME: Update Documentation and simplify logarithm logic
SQUASHME: OSX Build Errors
SQUASHME: minor Feedback from sipa + bluematt
SQUASHME: DOCONLY: Clarify a few comments.
2016-12-14 16:02:05 -05:00
Wladimir J. van der Laan b68685a16a
Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlock
a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
2016-12-14 10:56:28 +01:00
Pieter Wuille 57e337d40e
Merge #9290: Make RelayWalletTransaction attempt to AcceptToMemoryPool.
f692fce Make RelayWalletTransaction attempt to AcceptToMemoryPool. (Gregory Maxwell)
2016-12-14 01:28:09 -08:00
Wladimir J. van der Laan 47e6a19e6b
Merge #9330: [Qt] Console: add security warning
ed6b377 [Qt] Console: add security warning (Jonas Schnelli)
2016-12-14 09:34:31 +01:00
Pieter Wuille ed5896976a Batch construct batches
Reuse the serialization buffers used for constructing the LevelDB
write batch. This avoids 2 allocations per utxo write.
2016-12-14 00:31:28 -08:00
Jonas Schnelli 390bd14684
[Qt] Console: don't allow empty arguments when using the comma-syntax 2016-12-14 09:00:09 +01:00
Gregory Maxwell da9cdd2c9c Do not run functions with necessary side-effects in assert() 2016-12-14 01:50:00 +00:00
Gregory Sanders 5882c099d9 CreateTransaction: Don't return success with too-many-ancestor txn 2016-12-13 09:41:07 -05:00
Gregory Sanders 0b2294a980 SelectCoinsMinConf: Prefer coins with fewer ancestors 2016-12-13 09:41:04 -05:00
Wladimir J. van der Laan 26fe5c98ab
Merge #9326: Update for OpenSSL 1.1 API.
b05b1af Fix qt/paymentrequestplus.cpp for OpenSSL 1.1 API. (Gregory Maxwell)
bae1eef Fix wallet/test/crypto_tests.cpp for OpenSSL 1.1 API. (Gregory Maxwell)
2016-12-13 12:22:30 +01:00
Wladimir J. van der Laan 5233aefa3f
Merge #9305: Refactor: Removed begin/end_ptr functions.
8c1dbc5 Refactor: Removed begin/end_ptr functions. (Karl-Johan Alm)
2016-12-13 12:21:18 +01:00
Wladimir J. van der Laan cfd5e6b1dc
Merge #9334: Update to latest libsecp256k1
7b49f22 Squashed 'src/secp256k1/' changes from 7a49cac..8225239 (Pieter Wuille)
2016-12-13 12:16:47 +01:00
Wladimir J. van der Laan b6abdc77d3
Merge #9302: Return txid even if ATMP fails for new transaction
b3a7410 Return txid even if ATMP fails for new transaction (Pieter Wuille)
2016-12-13 12:15:27 +01:00
Luke Dashjr 6a32c0f69d
Qt/Test: Check handling of empty arguments in RPC debug console 2016-12-13 09:18:13 +01:00
Jonas Schnelli 89c8d2c12c
[Qt] Console: allow empty arguments 2016-12-13 09:17:35 +01:00
Richard Kiss e49a252bae Fix spelling. 2016-12-12 16:06:59 -05:00
Gregory Maxwell b05b1af10b Fix qt/paymentrequestplus.cpp for OpenSSL 1.1 API.
This avoids a compile failure on newly installed debian stretch systems.
2016-12-12 19:24:34 +00:00
Pieter Wuille 547a53d135 Update libsecp256k1 to master 2016-12-12 11:08:47 -08:00
Pieter Wuille 7b49f22bdb Squashed 'src/secp256k1/' changes from 7a49cac..8225239
8225239 Merge #433: Make the libcrypto detection fail the newer API.
12de863 Make the libcrypto detection fail the newer API.
2928420 Merge #427: Remove Schnorr from travis as well
8eecc4a Remove Schnorr from travis as well
a8abae7 Merge #310: Add exhaustive test for group functions on a low-order subgroup
b4ceedf Add exhaustive test for verification
83836a9 Add exhaustive tests for group arithmetic, signing, and ecmult on a small group
20b8877 Add exhaustive test for group functions on a low-order subgroup
80773a6 Merge #425: Remove Schnorr experiment
e06e878 Remove Schnorr experiment
04c8ef3 Merge #407: Modify parameter order of internal functions to match API parameter order
6e06696 Merge #411: Remove guarantees about memcmp-ability
40c8d7e Merge #421: Update scalar_4x64_impl.h
a922365 Merge #422: Restructure nonce clearing
3769783 Restructure nonce clearing
0f9e69d Restructure nonce clearing
9d67afa Update scalar_4x64_impl.h
7d15cd7 Merge #413: fix auto-enabled static precompuatation
00c5d2e fix auto-enabled static precompuatation
91219a1 Remove guarantees about memcmp-ability
353c1bf Fix secp256k1_ge_set_table_gej_var parameter order
541b783 Fix secp256k1_ge_set_all_gej_var parameter order
7d893f4 Fix secp256k1_fe_inv_all_var parameter order

git-subtree-dir: src/secp256k1
git-subtree-split: 8225239f490f79842a5a3b82ad6cc8aa11d5208e
2016-12-12 11:08:47 -08:00
Jonas Schnelli ed6b377ae2
[Qt] Console: add security warning 2016-12-12 15:58:40 +01:00
Gregory Maxwell bae1eef752 Fix wallet/test/crypto_tests.cpp for OpenSSL 1.1 API.
This avoids a compile failure on newly installed debian stretch systems.
2016-12-12 08:10:27 +00:00
MarcoFalke faf4ca84e4 [wallet] Disable free transactions when relay is disabled 2016-12-10 17:45:23 +01:00
Pieter Wuille a1dcf2e108
Merge #9240: Remove txConflicted
a874ab5 remove internal tracking of mempool conflicts for reporting to wallet (Alex Morcos)
bf663f8 remove external usage of mempool conflict tracking (Alex Morcos)
2016-12-09 16:31:03 -08:00
Pieter Wuille d38b0d7a6b
Merge #9307: Remove undefined FetchCoins method declaration
fe41f58 Remove undefined FetchCoins method declaration (Russell Yanofsky)
2016-12-09 16:21:28 -08:00
Pieter Wuille 815640ec6a
Merge #9295: [Wallet] Bugfix: Fundrawtransaction: don't terminate when keypool is empty
1a6eacb [QA] add fundrawtransaction test on a locked wallet with empty keypool (Jonas Schnelli)
c24a4f5 [Wallet] Bugfix: FRT: don't terminate when keypool is empty (Jonas Schnelli)
2016-12-09 16:14:54 -08:00
Alex Morcos 01fea7a048 If we don't allow free txs, always send a fee filter 2016-12-09 15:25:46 -05:00
Alex Morcos 06329393c7 Flush wallet after abandontransaction 2016-12-09 13:36:42 -05:00
Karl-Johan Alm 8c1dbc5e9d Refactor: Removed begin/end_ptr functions. 2016-12-09 13:15:19 +09:00
Pieter Wuille 760765d5a9 Update ctaes 2016-12-08 17:09:07 -08:00
BtcDrak c5c92c46fb
Update python tests for default tx version=2 2016-12-08 20:12:00 +00:00
BtcDrak dab207e4e6
Preserve tx version=1 for certain tests
Without this change, the tests would be affected by default
tx version increases.
2016-12-08 20:11:51 +00:00
Alex Morcos c5d746ace7
tiny test fix for mempool_tests 2016-12-08 20:11:39 +00:00
BtcDrak 1f0ca1ae1c
Bump default transaction version to 2 2016-12-08 20:11:27 +00:00
Pieter Wuille b3a74100b8 Return txid even if ATMP fails for new transaction 2016-12-08 11:55:32 -08:00
Wladimir J. van der Laan 86017842d6
Merge #9291: Remove mapOrphanTransactionsByPrev from DoS_tests
819ca3f Remove mapOrphanTransactionsByPrev from DoS_tests (Pieter Wuille)
2016-12-08 08:38:15 +01:00
Wladimir J. van der Laan 9851a8461d
Merge #9255: qt: layoutAboutToChange signal is called layoutAboutToBeChanged
f36349e qt: Remove on_toggleNetworkActiveButton_clicked from RPCConsole (Wladimir J. van der Laan)
297cc20 qt: layoutAboutToChange signal is called layoutAboutToBeChanged (Wladimir J. van der Laan)
2016-12-08 08:14:16 +01:00
Wladimir J. van der Laan 2044e37beb
Merge #9266: Bugfix: Qt/RPCConsole: Put column enum in the right places
df17fe0 Bugfix: Qt/RPCConsole: Put column enum in the right places (Luke Dashjr)
2016-12-08 08:13:15 +01:00
Russell Yanofsky fe41f58365 Remove undefined FetchCoins method declaration 2016-12-07 15:41:56 -05:00
Alex Morcos b919179cbb remove no longer needed check for premature v2 txs 2016-12-07 09:58:20 -05:00
Wladimir J. van der Laan f36349e898 qt: Remove on_toggleNetworkActiveButton_clicked from RPCConsole
There is no network toggle button (anymore?) in the RPC console.
Removes another warning (#9250).
2016-12-07 05:55:16 +01:00
Pieter Wuille 09c4fd157c
Merge #9268: Fix rounding privacy leak introduced in #9260
9b9324e Fix rounding privacy leak introduced in #9260 (Matt Corallo)
2016-12-06 13:33:01 -08:00
Alex Morcos 28f8ae8adf Fix missed change to WalletTx structure 2016-12-06 08:56:12 -05:00
Jonas Schnelli c24a4f5981
[Wallet] Bugfix: FRT: don't terminate when keypool is empty 2016-12-06 13:45:56 +01:00
Jonas Schnelli e15660c16f
Merge #9280: [Qt] Show ModalOverlay by pressing the progress bar, allow hiding
89a3723 [Qt] Show ModalOverlay by pressing the progress bar, disabled show() in sync mode (Jonas Schnelli)
2016-12-06 13:03:33 +01:00
Gregory Maxwell f692fce8a4 Make RelayWalletTransaction attempt to AcceptToMemoryPool.
This resolves an issue where a wallet transaction which failed to
 relay previously because it couldn't make it into the mempool
 will not try again until restart, even though mempool conditions
 may have changed.

Abandoned and known-conflicted transactions are skipped.

Some concern was expressed that there may be users with many
 unknown conflicts would waste a lot of CPU time trying to
 add them to their memory pools over and over again.  But I am
 doubtful these users exist in any number, if they do exist
 they have worse problems, and they can mitigate any performance
 issue this might have by abandoning the transactions in question.
2016-12-06 08:01:27 +00:00
Pieter Wuille 80d073c9bc Complain when unknown rpcserialversion is specified 2016-12-05 23:26:32 -08:00
Pieter Wuille 819ca3f18e Remove mapOrphanTransactionsByPrev from DoS_tests
This is another violation of the one definition rule, as the type
for mapOrphanTransactionsByPrev did not match the one in
net_processing.cpp anymore. As it now depends on a custom Iterator,
it seems too much hassle to correctly expose it to the tests.
Instead, this commit just removes the one test it was referenced in.
2016-12-05 23:04:50 -08:00
Russell Yanofsky 07df40babb [test] Add CCoinsViewCache Access/Modify/Write tests
Add more comprehensive unit tests for CCoinsViewCache. Right now it is hard to
refactor caching code or fix bugs in the caching logic because you have to try
to mentally enumerate all the different states the cache might be in to make
sure a change doesn't cause unintended consequences. The new tests explicitly
enumerate relevant cache states, documenting and verifying the behavior in each
state, so it will be safer and easier to make changes to the caching code in
the future.
2016-12-05 18:30:46 -05:00
Alex Morcos a874ab5ccf remove internal tracking of mempool conflicts for reporting to wallet 2016-12-05 13:41:25 -05:00
Alex Morcos bf663f8e93 remove external usage of mempool conflict tracking 2016-12-05 13:41:25 -05:00
Jonas Schnelli 89a3723bdc
[Qt] Show ModalOverlay by pressing the progress bar, disabled show() in sync mode 2016-12-05 13:58:00 +01:00
instagibbs 412bab22b2 Adapt ZMQ/rest serialization to take rpcserialversion arg 2016-12-05 07:43:22 -05:00
Gregory Sanders bc7ff8db99 Add option to return non-segwit serialization via rpc 2016-12-05 07:43:22 -05:00
Wladimir J. van der Laan 7d5d44969b
Merge #9282: CMutableTransaction is defined as struct
c4b6fa8 CMutableTransaction is defined as struct. (Pavel Janík)
2016-12-05 12:55:03 +01:00
Wladimir J. van der Laan c01f16aaa0
Merge #9165: SendMoney: use already-calculated balance
ea83d00 SendMoney: use already-calculated balance (instagibbs)
2016-12-05 12:47:31 +01:00
Pavel Janík c4b6fa8edf CMutableTransaction is defined as struct. 2016-12-05 11:13:17 +01:00
Wladimir J. van der Laan 43e8150ef6
Merge #9269: Align struct COrphan definition
2efc438 Align struct COrphan definition (Pieter Wuille)
2016-12-05 11:09:26 +01:00
Wladimir J. van der Laan 613bda418f
Merge #8613: LevelDB 1.19
634ad51 Squashed 'src/leveldb/' changes from 20ca81f..a31c8aa (Pieter Wuille)
2016-12-05 10:58:36 +01:00
Pieter Wuille 2efc43874c Align struct COrphan definition 2016-12-05 00:35:07 -08:00
Pieter Wuille f6fb7acda4 Move CTxInWitness inside CTxIn 2016-12-04 23:47:12 -08:00
Wladimir J. van der Laan d04aebaec7
Merge #9014: Fix block-connection performance regression
dd0df81 Document ConnectBlock connectTrace postconditions (Matt Corallo)
2d6e561 Switch pblock in ProcessNewBlock to a shared_ptr (Matt Corallo)
2736c44 Make the optional pblock in ActivateBestChain a shared_ptr (Matt Corallo)
ae4db44 Create a shared_ptr for the block we're connecting in ActivateBCS (Matt Corallo)
fd9d890 Keep blocks as shared_ptrs, instead of copying txn in ConnectTip (Matt Corallo)
6fdd43b Add struct to track block-connect-time-generated info for callbacks (Matt Corallo)
2016-12-05 08:07:45 +01:00
Wladimir J. van der Laan 46904ee5d2
Merge #8580: Make CTransaction actually immutable
81e3228 Make CTransaction actually immutable (Pieter Wuille)
42fd8de Make DecodeHexTx return a CMutableTransaction (Pieter Wuille)
c3f5673 Make CWalletTx store a CTransactionRef instead of inheriting (Pieter Wuille)
a188353 Switch GetTransaction to returning a CTransactionRef (Pieter Wuille)
2016-12-05 08:05:48 +01:00
Jonas Schnelli 4d955fc582
Merge #9218: qt: Show progress overlay when clicking spinner icon
042f9fa qt: Show progress overlay when clicking spinner icon (Wladimir J. van der Laan)
827d9a3 qt: Replace NetworkToggleStatusBarControl with generic ClickableLabel (Wladimir J. van der Laan)
2016-12-04 20:57:57 +01:00
Matt Corallo a13fa4c80f Remove unused CDiskBlockPos* argument from ProcessNewBlock 2016-12-04 00:23:17 -08:00
Matt Corallo dd0df81ebd Document ConnectBlock connectTrace postconditions 2016-12-04 00:18:44 -08:00
Matt Corallo 2d6e5619af Switch pblock in ProcessNewBlock to a shared_ptr
This (finally) fixes a performance regression in
b3b3c2a562
2016-12-04 00:17:30 -08:00
Matt Corallo 2736c44c8e Make the optional pblock in ActivateBestChain a shared_ptr 2016-12-04 00:13:09 -08:00
Matt Corallo ae4db44d03 Create a shared_ptr for the block we're connecting in ActivateBCS 2016-12-04 00:13:09 -08:00
Matt Corallo fd9d89070a Keep blocks as shared_ptrs, instead of copying txn in ConnectTip 2016-12-04 00:13:09 -08:00
Matt Corallo 6fdd43b968 Add struct to track block-connect-time-generated info for callbacks 2016-12-04 00:13:09 -08:00
Gregory Maxwell 749be013f5 Move GetWarnings() into its own file. 2016-12-03 07:17:34 +00:00
Gregory Maxwell e3ba0ef956 Eliminate data races for strMiscWarning and fLargeWork*Found.
This moves all access to these datastructures through accessor functions
 and protects them with a lock.
2016-12-03 07:17:34 +00:00
Gregory Maxwell c63198f1c7 Make QT runawayException call GetWarnings instead of directly access strMiscWarning.
This is a first step in avoiding racy accesses to strMiscWarning.

The change required moving GetWarnings and related globals to util.
2016-12-03 07:17:28 +00:00
Matt Corallo 9b9324ee49 Fix rounding privacy leak introduced in #9260 2016-12-02 21:30:36 -08:00
Pieter Wuille 81e3228fcb Make CTransaction actually immutable 2016-12-02 18:37:43 -08:00
Pieter Wuille 42fd8dee30 Make DecodeHexTx return a CMutableTransaction 2016-12-02 18:28:22 -08:00
Pieter Wuille c3f5673a63 Make CWalletTx store a CTransactionRef instead of inheriting 2016-12-02 18:28:22 -08:00
Pieter Wuille a1883536b4 Switch GetTransaction to returning a CTransactionRef 2016-12-02 18:28:22 -08:00
Pieter Wuille 2efcfa5acf
Merge #9260: Mrs Peacock in The Library with The Candlestick (killed main.{h,cpp})
76faa3c Rename the remaining main.{h,cpp} to validation.{h,cpp} (Matt Corallo)
e736772 Move network-msg-processing code out of main to its own file (Matt Corallo)
87c35f5 Remove orphan state wipe from UnloadBlockIndex. (Matt Corallo)
2016-12-02 18:25:40 -08:00
MarcoFalke c36229b0b2
Merge #9251: Improvement of documentation of command line parameter 'whitelist'
8a70a9d Improvement of documentation of command line parameter 'whitelist' (wodry)
2016-12-02 20:34:06 +01:00
Matt Corallo 76faa3cdfe Rename the remaining main.{h,cpp} to validation.{h,cpp} 2016-12-02 09:42:51 -08:00
Matt Corallo e736772c56 Move network-msg-processing code out of main to its own file 2016-12-02 09:42:51 -08:00
MarcoFalke 5412c08c3c
Merge #9223: unification of Bloom filter representation
b7aa290 unification of Bloom filter representation (S. Matthew English)
2016-12-02 15:58:57 +01:00
Luke Dashjr df17fe046f Bugfix: Qt/RPCConsole: Put column enum in the right places
QModelIndex::data argument is a role, not a column
2016-12-02 13:51:14 +00:00
Wladimir J. van der Laan fe37fbe606 bitcoin-cli: Make error message less confusing
Sorry for the churn on this, but the current message (introduced in #9073)
isn't acceptable:

    $ src/bitcoin-cli getinfo
    rpc: couldn't connect to server
    (make sure server is running and you are connecting to the correct RPC port: -1 unknown)

Putting the error code after the words "RPC port" made me wonder whether
there was a port configuration issue.

This changes it to:

    $ src/bitcoin-cli getinfo
    error: couldn't connect to server: unknown (code -1)
    (make sure server is running and you are connecting to the correct RPC port)
2016-12-02 08:55:18 +01:00
Wladimir J. van der Laan 3fbf079262
Merge #9239: Disable fee estimates for 1 block target
e878689 Make GUI incapable of setting tx confirm target of 1 (Alex Morcos)
d824ad0 Disable fee estimates for a confirm target of 1 block (Alex Morcos)
2016-12-02 08:21:06 +01:00
Wladimir J. van der Laan c4d22f6eb2
Merge #9229: Remove calls to getaddrinfo_a
10ae7a7 Revert "Use async name resolving to improve net thread responsiveness" (Matt Corallo)
2016-12-02 05:48:45 +01:00
Pieter Wuille 605d701471 Merge in LevelDB 1.19 changes 2016-12-01 16:14:45 -08:00
Matt Corallo 87c35f5843 Remove orphan state wipe from UnloadBlockIndex.
As orphan state is now "network state", like in
d6ea737be1,

UnloadBlockIndex is only used during init if we end up reindexing
to clear our block state so that we can start over. However, at
that time no connections have been brought up as CConnman hasn't
been started yet, so all of the network processing state logic is
empty when its called.
2016-12-01 16:08:34 -08:00
Pieter Wuille dc6dee41f7
Merge #9183: Final Preparation for main.cpp Split
2c8c57e Document cs_main status when calling into PNB or PNBH (Matt Corallo)
58a215c Use ProcessNewBlockHeaders in CMPCTBLOCK processing (Matt Corallo)
a8b936d Use exposed ProcessNewBlockHeaders from ProcessMessages (Matt Corallo)
63fd101 Split ::HEADERS processing into two separate cs_main locks (Matt Corallo)
4a6b1f3 Expose AcceptBlockHeader through main.h (Matt Corallo)
2016-12-01 16:07:25 -08:00
Matt Corallo 10ae7a7b23 Revert "Use async name resolving to improve net thread responsiveness"
This reverts commit caf6150e97.

getaddrinfo_a has a nasty tendency to segfault internally in its
background thread, on every version of glibc I tested, especially
under helgrind.

See https://sourceware.org/bugzilla/show_bug.cgi?id=20874
2016-12-01 14:32:44 -08:00
Pieter Wuille ad826b3df9
Merge #9188: Make orphan parent fetching ask for witnesses.
5b0150a Make orphan parent fetching ask for witnesses. (Gregory Maxwell)
2016-12-01 13:34:49 -08:00
Pieter Wuille c1a5227684
Merge #9253: Fix calculation of number of bound sockets to use
9e1f468 Fix calculation of number of bound sockets to use (Matt Corallo)
2016-12-01 13:07:08 -08:00
Matt Corallo 2c8c57e72f Document cs_main status when calling into PNB or PNBH 2016-12-01 11:03:32 -08:00
Matt Corallo 58a215ce8c Use ProcessNewBlockHeaders in CMPCTBLOCK processing 2016-12-01 11:03:31 -08:00
Matt Corallo a8b936df20 Use exposed ProcessNewBlockHeaders from ProcessMessages 2016-12-01 11:03:31 -08:00
Wladimir J. van der Laan c79e52ad30
Merge #9230: Fix some benign races in timestamp logging
8b22efb Make fStartedNewLine an std::atomic_bool (Matt Corallo)
507145d Fix race when accessing std::locale::classic() (Matt Corallo)
2016-12-01 11:47:47 +01:00
Wladimir J. van der Laan 297cc20e70 qt: layoutAboutToChange signal is called layoutAboutToBeChanged
This was misnamed, resulting in a warning message and missing
functionality. I'm not sure what the change in behavior will be here,
this needs testing.

Also remove connection to non-existing slot "test".
This was used for testing if the signal arrived. It is no
longer necessary.

Fixes:

    2016-12-01 10:04:06 GUI: QObject::connect: No such signal PeerTableModel::layoutAboutToChange() in qt/rpcconsole.cpp:518
    2016-12-01 10:04:06 GUI: QObject::connect:  (receiver name: 'RPCConsole')
    2016-12-01 10:04:06 GUI: QObject::connect: No such slot RPCConsole::test() in qt/rpcconsole.cpp:781
    2016-12-01 10:04:06 GUI: QObject::connect:  (receiver name: 'RPCConsole')
2016-12-01 11:45:07 +01:00
Matt Corallo 9e1f46821d Fix calculation of number of bound sockets to use 2016-11-30 18:56:08 -08:00
Pieter Wuille 3bf06e9bac
Merge #9226: Remove fNetworkNode and pnodeLocalHost.
bdb922b Remove pnodeLocalHost. (Gregory Maxwell)
083f203 Remove fNetworkNode. (Gregory Maxwell)
2016-11-30 17:15:58 -08:00