Commit graph

12306 commits

Author SHA1 Message Date
Gregory Maxwell
083f203698 Remove fNetworkNode.
Matt pointed out to me that this appeared to be doing nothing (except involving itself in data races).
2016-11-27 04:13:54 +00:00
Matt Corallo
dfed983f19 Fix unlocked access to vNodes.size() 2016-11-26 15:42:55 -08:00
Matt Corallo
303352286f Remove double brackets in addrman 2016-11-26 15:42:55 -08:00
Matt Corallo
dbfaade72a Fix AddrMan locking 2016-11-26 15:42:55 -08:00
Matt Corallo
047ea1052d Make fImporting an std::atomic 2016-11-26 15:42:48 -08:00
S. Matthew English
b7aa2902fd unification of Bloom filter representation
Output instances of "BloomFilter" changed to "Bloom filter", in accordance with Wikipedia standard notation: 

https://en.wikipedia.org/wiki/Bloom_filter

also to sync with the majority of cases in the self-same file
2016-11-26 14:57:19 +01:00
Matt Corallo
42071ca264 Make fDisconnect an std::atomic 2016-11-25 18:03:12 -08:00
Pieter Wuille
76fec09d87
Merge #9128: net: Decouple CConnman and message serialization
c7be56d net: push only raw data into CConnman (Cory Fields)
2ec935d net: add CVectorWriter and CNetMsgMaker (Cory Fields)
b7695c2 net: No need to check individually for disconnection anymore (Cory Fields)
fedea8a net: don't send any messages before handshake or after requested disconnect (Cory Fields)
d74e352 net: Set feelers to disconnect at the end of the version message (Cory Fields)
2016-11-25 11:18:23 -08:00
Cory Fields
c7be56dcef net: push only raw data into CConnman
This fixes one of the last major layer violations in the networking stack.

The network side is no longer in charge of message serialization, so it is now
decoupled from Bitcoin structures. Only the header is serialized and attached
to the payload.
2016-11-25 12:37:33 -05:00
Cory Fields
2ec935dcaa net: add CVectorWriter and CNetMsgMaker
CVectorWriter is useful for overwriting or appending an existing byte vector.

CNetMsgMaker is a shortcut for creating messages on-the-fly which are suitable
for pushing to CConnman.
2016-11-25 12:09:58 -05:00
Cory Fields
b7695c2275 net: No need to check individually for disconnection anymore 2016-11-25 12:09:58 -05:00
MarcoFalke
e22f409f18
Merge #9220: Refactor: Stop using namespace std (bitcoin-cli/-tx).
2f2625a Removed using namespace std from bitcoin-cli/-tx and added std:: in appropriate places. (Karl-Johan Alm)
2016-11-25 11:35:53 +01:00
MarcoFalke
97ec6e5c90
Merge #9100: tx_valid: re-order inputs to how they are encoded
5262a15 tx_valid: re-order inputs to how they are encoded (Daniel Cousens)
2016-11-25 10:38:19 +01:00
Wladimir J. van der Laan
dd34570c45 doc: Improve windows build instructions using Linux subsystem
I did a build on a windows 10 laptop and took notes, and tried
to improve the document:

- It's the Linux subsystem for Windows, not the other way around.

- Split out dependencies: general ones, 64-bit, 32-bit. Remove the
  reference to `build-unix.md`, easy enough to be self-contained.

- Place 64-bit instructions first. 99% will want these.

- Installation instructions: recommend using `/` for prefix, same as we
  do on gitian builds. This will allow copying the files to a usable
  (from Windows) place using just `make DESTDIR=...`.

- Remove double spaces / consistent width reformatting.
2016-11-25 09:32:34 +01:00
Karl-Johan Alm
2f2625a0bb Removed using namespace std from bitcoin-cli/-tx and added std:: in appropriate places. 2016-11-25 17:17:57 +09:00
Wladimir J. van der Laan
d932159f34
Merge #9189: Always add default_witness_commitment with GBT client support
95f4a03 [qa] Test getblocktemplate default_witness_commitment (Suhas Daftuar)
ad04d1c Always add default_witness_commitment with GBT client support (Pieter Wuille)
2016-11-25 08:26:25 +01:00
MarcoFalke
bc121b0eb1
Merge #9216: Doc: Fix copypasted comment
f26da35 Fix copypasted comment. (Pavel Janík)
2016-11-24 14:00:34 +01:00
MarcoFalke
c98f6b3d93
Merge #9144: [Trivial] Correct waitforblockheight example help text
e3c4f7e Correct help output for waitfor RPC commands (fanquake)
2016-11-24 13:14:06 +01:00
fanquake
e3c4f7e182
Correct help output for waitfor RPC commands 2016-11-24 19:50:07 +08:00
Wladimir J. van der Laan
db5e22e053
Merge #9190: qt: Plug many memory leaks
ed998ea qt: Avoid OpenSSL certstore-related memory leak (Wladimir J. van der Laan)
5204598 qt: Avoid shutdownwindow-related memory leak (Wladimir J. van der Laan)
e4f126a qt: Avoid splash-screen related memory leak (Wladimir J. van der Laan)
693384e qt: Prevent thread/memory leak on exiting RPCConsole (Wladimir J. van der Laan)
47db075 qt: Plug many memory leaks (Wladimir J. van der Laan)
2016-11-24 12:17:39 +01:00
Pavel Janík
f26da35142 Fix copypasted comment. 2016-11-24 12:12:57 +01:00
Cory Fields
fedea8a14d net: don't send any messages before handshake or after requested disconnect
Also, send reject messages earlier in SendMessages(), so that disconnections are
processed earlier.

These changes combined should ensure that no message is ever sent after
fDisconnect is set.
2016-11-23 19:53:28 -05:00
Cory Fields
d74e352e01 net: Set feelers to disconnect at the end of the version message
This way we're not relying on messages going out after fDisconnect has been
set.

This should not cause any real behavioral changes, though feelers should
arguably disconnect earlier in the process. That can be addressed in a later
functional change.
2016-11-23 19:53:28 -05:00
Matt Corallo
63fd101c52 Split ::HEADERS processing into two separate cs_main locks
This will allow NotifyHeaderTip to be called from an
AcceptBlockHeader wrapper function without holding cs_main.
2016-11-23 16:29:38 -08:00
Matt Corallo
4a6b1f36b7 Expose AcceptBlockHeader through main.h 2016-11-23 16:29:38 -08:00
Pieter Wuille
93566e0c37
Merge #8930: Move orphan processing to ActivateBestChain
d2b88f9 Move orphan-conflict removal from main logic into a callback (Matt Corallo)
97e2802 Erase orphans per-transaction instead of per-block (Matt Corallo)
ec4525c Move orphan processing to ActivateBestChain (Matt Corallo)
2016-11-23 16:27:16 -08:00
Pieter Wuille
407d9232ef
Merge #9199: Always drop the least preferred HB peer when adding a new one.
ca8549d Always drop the least preferred HB peer when adding a new one. (Gregory Maxwell)
2016-11-23 16:14:21 -08:00
Matt Corallo
d2b88f97a1 Move orphan-conflict removal from main logic into a callback
This makes the orphan map a part of net-processing logic instead
of main logic.
2016-11-23 12:29:26 -08:00
MarcoFalke
0de7fd36de
Merge #9139: Change sync_blocks to pick smarter maxheight (on top of #9196)
1126c85 [qa] Change sync_blocks to pick smarter maxheight (Russell Yanofsky)
2016-11-23 13:01:53 +01:00
Wladimir J. van der Laan
ed998ea7a0 qt: Avoid OpenSSL certstore-related memory leak
- Correctly manage the X509 and X509_STORE objects lifetime.
2016-11-23 12:33:37 +01:00
Wladimir J. van der Laan
5204598f8d qt: Avoid shutdownwindow-related memory leak
Store a reference to the shutdown window on BitcoinApplication,
so that it will be deleted when exiting the main loop.
2016-11-23 12:33:36 +01:00
Wladimir J. van der Laan
e4f126a7ba qt: Avoid splash-screen related memory leak
Make splash screen queue its own deletion when it receives the finished
command, instead of relying on WA_DeleteOnClose which doesn't work under
these circumstances.
2016-11-23 12:33:36 +01:00
Wladimir J. van der Laan
693384eedb qt: Prevent thread/memory leak on exiting RPCConsole
Make ownership of the QThread object clear, so that the RPCConsole
can wait for the executor thread to quit before shutdown is called. This
increases overall thread safety, and prevents some objects from leaking
on exit.
2016-11-23 12:33:36 +01:00
Wladimir J. van der Laan
47db075377 qt: Plug many memory leaks
None of these are very serious, and are leaks in objects that are
created at most one time.

In most cases this means properly using the QObject parent hierarchy,
except for BanTablePriv/PeerTablePriv which are not QObject,
so use a std::unique_ptr instead.
2016-11-23 12:33:35 +01:00
MarcoFalke
e662d281b8
Merge #9206: Make test constant consistent with consensus.h
09dc406 Make test constant consistent with consensus.h (BtcDrak)
2016-11-23 11:40:25 +01:00
Wladimir J. van der Laan
fa1f944107
Merge #9207: [Doc] Move comments above bash command in build-unix
69bc8e7 [Doc] Move comments above bash command (Amir Abrams)
2016-11-23 11:10:54 +01:00
Amir Abrams
69bc8e7967 [Doc] Move comments above bash command 2016-11-23 02:22:59 -06:00
Wladimir J. van der Laan
74ced54b7e
Merge #9204: Clarify CreateTransaction error messages
918b126 fix CreateTransaction error messages (instagibbs)
2016-11-23 08:42:06 +01:00
Wladimir J. van der Laan
5e8631b6cb
Merge #9205: Minor change to comment for consistency.
f004e67 Minor change to comment above new NODE_WITNESS service flag to keep it consitent with existing comment structure. Helps with readability. (Greg Walker)
2016-11-23 08:41:12 +01:00
Wladimir J. van der Laan
7e2bfd6241
Merge #9196: Send tip change notification from invalidateblock
67c6326 Send tip change notification from invalidateblock (Russell Yanofsky)
2016-11-23 08:40:20 +01:00
Wladimir J. van der Laan
791b58d148
Merge #8690: Do not fully sort all nodes for addr relay
a33b169 Do not fully sort all nodes for addr relay (Pieter Wuille)
2016-11-23 08:19:57 +01:00
Wladimir J. van der Laan
5ea5e0401c
Merge #9141: Remove unnecessary calls to CheckFinalTx
4512550 Remove unnecessary calls to CheckFinalTx (Jonas Schnelli)
2016-11-23 07:24:43 +01:00
Wladimir J. van der Laan
40022fe5f2
Merge #9142: Move -salvagewallet, -zap(wtx) to where they belong
2e44893 Move -salvagewallet, -zap(wtx) to where they belong (Jonas Schnelli)
2016-11-23 07:18:24 +01:00
Wladimir J. van der Laan
4d8558a287
Merge #9025: getrawtransaction should take a bool for verbose
240189b add testcases for getrawtransaction (John Newbery)
ce2bb23 getrawtransaction should take a bool for verbose (jnewbery)
2016-11-23 07:13:46 +01:00
Greg Walker
f004e67df3 Minor change to comment above new NODE_WITNESS service flag to keep it consitent with existing comment structure. Helps with readability. 2016-11-22 18:59:20 +00:00
instagibbs
918b126901 fix CreateTransaction error messages 2016-11-22 13:40:57 -05:00
John Newbery
240189b2c1 add testcases for getrawtransaction 2016-11-22 14:37:59 +00:00
jnewbery
ce2bb23aa5 getrawtransaction should take a bool for verbose 2016-11-22 14:37:33 +00:00
Jonas Schnelli
ac489b2445
Merge #9130: Mention the new network toggle functionality in the tooltip.
1260c11 Mention the new network toggle functionality in the tooltip. (Pavel Janík)
2016-11-22 15:32:45 +01:00
Wladimir J. van der Laan
3532818746 bench: Add support for measuring CPU cycles
This adds cycle min/max/avg to the statistics.

Supported on x86 and x86_64 (natively through rdtsc), as well as Linux
(perf syscall).
2016-11-22 12:20:57 +01:00