Commit Graph

1375 Commits

Author SHA1 Message Date
Jonas Schnelli
c8ab3c44ef Log/report in 10% steps during VerifyDB 2018-10-24 21:39:41 +03:00
Kaz Wesley
ed20890e82 drop vAddrToSend after sending big addr message
We send a newly-accepted peer a 1000-entry addr message, and then only use
vAddrToSend for small messages. Deallocate vAddrToSend after it's been used for
the big message to save about 40 kB per connected inbound peer.
2018-10-24 21:39:30 +03:00
Kaz Wesley
1ed6d18a3c IsInitialBlockDownload: usually avoid locking
Optimistically test the latch bool before taking the lock.
For all IsInitialBlockDownload calls after the first to return false,
this avoids the need to lock cs_main.
2018-10-24 21:38:43 +03:00
instagibbs
099dbe4bb9 comment nit: miners don't vote 2018-10-24 21:37:28 +03:00
mrbandrews
ee5df5c99f Catch exceptions from non-canonical encoding and print only to log 2018-10-24 21:37:03 +03:00
Pavel Janík
a5a7b5ce44 Remove useless argument to AlertNotify. 2018-10-24 21:35:20 +03:00
Kaz Wesley
cf16a6e0d1 lock cs_main for chainActive 2018-10-24 21:31:26 +03:00
Kaz Wesley
7d7c806637 lock cs_main for State/Misbehaving
ProcessMessage calls State(...) and Misbehaving(...) without holding the
required lock; add LOCK(cs_main) blocks.
2018-10-24 21:27:36 +03:00
Alex Morcos
ee9e86ad0c Avoid unnecessary database access for unknown transactions 2018-10-24 21:22:44 +03:00
lateminer
7e41e6974f Remove redundant chainparams declaration
main.cpp
2018-10-23 23:30:04 +03:00
Pieter Wuille
1b70520ceb Align constant names for maximum compact block / blocktxn depth 2018-10-23 23:24:58 +03:00
lateminer
1534febd08 Move DEFAULT_BYTES_PER_SIGOP to policy/policy.h 2018-10-23 23:11:23 +03:00
Gregory Maxwell
8a98c894d4 Increase maximum orphan size to 100,000 bytes.
Although this increases node memory usage in the worst case by perhaps
 30MB, the current behavior causes severe issues with dependent tx relay.
2018-10-23 22:53:13 +03:00
Gregory Maxwell
e0505fced9 Treat orphans as implicit inv for parents, discard when parents rejected.
An orphan whos parents were rejected is never going to connect, so there
 is little utility in keeping it.

Orphans also helpfully tell us what we're missing, so go ahead and treat
 it as INVed.
2018-10-23 22:53:04 +03:00
Gregory Maxwell
654a62c131 Adds an expiration time for orphan tx.
This prevents higher order orphans and other junk from
 holding positions in the orphan map.  Parents delayed
 twenty minutes are more are unlikely to ever arrive.

The freed space will improve the orphan matching success rate for
 other transactions.
2018-10-23 22:52:51 +03:00
Pieter Wuille
10ae5af2c5 Track orphan by prev COutPoint rather than prev hash 2018-10-23 22:39:39 +03:00
instagibbs
61b8aea708 Rename ReconsiderBlock func to reflect real behavior 2018-10-23 22:24:41 +03:00
instagibbs
46038d59ea Remove state arg from ReconsiderBlock 2018-10-23 22:24:01 +03:00
Jorge Timón
4a2d793f2a Globals: Explicitly pass const CChainParams& to UpdateTip() 2018-10-23 22:22:50 +03:00
face
7e7f211dea Pass CChainParams to DisconnectTip() 2018-10-23 22:22:19 +03:00
Luke Dashjr
7828e48b69 Remove -enforcenodebloom 2018-10-23 22:15:45 +03:00
lateminer
afa46b1aef Use nAbsurdFee instead of maxTxFee in AcceptToMemoryPoolWorker()
main.cpp
2018-10-23 22:09:14 +03:00
lateminer
79085ea232 Add missing fMayBanPeerIfInvalid parameter in ProcessNewBlock() call
main.cpp
2018-10-22 22:37:05 +03:00
Wladimir J. van der Laan
7a11d02bde Break circular dependency main ↔ txdb
Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.
2018-10-22 00:42:47 +03:00
21E14
69de80c238 Remove obsolete reference to CValidationState from UpdateCoins. 2018-10-22 00:40:59 +03:00
Jonas Schnelli
6d90c71b64 include the chaintip blockindex in the SyncTransaction signal, add signal UpdateTip() 2018-10-21 23:51:31 +03:00
Suhas Daftuar
f2a7a4d1ba Fix compact block handling to not ban if block is invalid 2018-10-21 23:41:27 +03:00
lateminer
a40209ddbd Declare nNewHeight;
main.cpp
2018-10-19 20:55:01 +03:00
Matt Corallo
7ce6f6ebdb Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) 2018-10-19 20:08:41 +03:00
Wladimir J. van der Laan
c5e913fd28 Make max tip age an option instead of chainparam 2018-10-19 19:59:49 +03:00
Pieter Wuille
3da1cf3080 Switch to a more efficient rolling Bloom filter
For each 'bit' in the filter we really maintain 2 bits, which store either:
0: not set
1-3: set in generation N

After (nElements / 2) insertions, we switch to a new generation, and wipe
entries which already had the new generation number, effectively switching
from the last 1.5 * nElements set to the last 1.0 * nElements set.

This is 25% more space efficient than the previous implementation, and can
(at peak) store 1.5 times the requested amount of history (though only
1.0 times the requested history is guaranteed).

The existing unit tests should be sufficient.
2018-10-19 19:47:22 +03:00
leijurv
e0e706c9cf various typos 2018-10-18 23:30:54 +03:00
Ethan Heilman
82072c13f8 Added feeler connections increasing good addrs in the tried table. 2018-10-18 23:26:46 +03:00
Gregory Maxwell
35c0e679b7 Add recently accepted blocks and txn to AttemptToEvictConnection.
This protects any not-already-protected peers who were the most
 recent four to relay transactions and most recent four to send
 blocks to us.
2018-10-18 22:35:51 +03:00
Pieter Wuille
cb47af78cc Introduce REQUIRED_SERVICES constant 2018-10-18 22:32:31 +03:00
Pieter Wuille
c043d2fedc Introduce enum ServiceFlags for service flags 2018-10-18 22:32:23 +03:00
Pieter Wuille
be365a0d15 Only store and connect to NODE_NETWORK nodes 2018-10-18 22:26:29 +03:00
Pieter Wuille
0c7d5a8af8 Verify that outbound connections have expected services 2018-10-18 22:26:18 +03:00
Pieter Wuille
f1d80ea69b Keep addrman's nService bits consistent with outbound observations 2018-10-18 22:26:08 +03:00
Pieter Wuille
3a1602b31d Use C++11 thread-safe static initializers 2018-10-18 21:55:20 +03:00
Gregory Maxwell
e577b5c7e1 Only send one GetAddr response per connection. 2018-10-17 22:14:44 +03:00
21E14
fcc23c5c63 Double semicolon cleanup. 2018-10-17 22:10:51 +03:00
lateminer
786436baef Make it compile 2018-10-17 21:37:53 +03:00
Pieter Wuille
834db9539b Get rid of CTxMempool::lookup() entirely 2018-10-17 20:51:51 +03:00
Pieter Wuille
2737ac3d7f Optimization: use usec in expiration and reuse nNow 2018-10-17 20:51:42 +03:00
Pieter Wuille
594213c60d Optimization: don't check the mempool at all if no mempool req ever 2018-10-17 20:51:33 +03:00
Pieter Wuille
d4e4acd906 Optimize the relay map to use shared_ptr's 2018-10-17 20:51:23 +03:00
Pieter Wuille
ab86d7e4ff Switch CTransaction storage in mempool to std::shared_ptr 2018-10-17 20:34:25 +03:00
Suhas Daftuar
0814da4e9d Only use AddInventoryKnown for transactions
filterInventoryKnown is only used when relaying transactions,
so stop adding block hashes to the filter.
2018-10-17 20:32:50 +03:00
Gregory Maxwell
b3992a38d4 Defer inserting into maprelay until just before relaying. 2018-10-17 20:32:14 +03:00