Commit Graph

1329 Commits

Author SHA1 Message Date
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
Wladimir J. van der Laan
c41e3c69aa UpdateTip: log only one line at most per block 2018-10-17 20:26:54 +03:00
Gregory Maxwell
89655c3a1e Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool. 2018-10-17 20:22:44 +03:00
Gregory Maxwell
16b0e12385 Do not use mempool for GETDATA for tx accepted after the last mempoolreq 2018-10-17 19:56:28 +03:00
Gregory Maxwell
c41eb3a831 Move bloom and feerate filtering to just prior to tx sending. 2018-10-17 19:47:32 +03:00
Pieter Wuille
eeded98dce Handle mempool requests in send loop, subject to trickle
By eliminating queued entries from the mempool response and responding only at
trickle time, this makes the mempool no longer leak transaction arrival order
information (as the mempool itself is also sorted)-- at least no more than
relay itself leaks it.
2018-10-17 19:45:45 +03:00
Pieter Wuille
16e9766115 Split up and optimize transaction and block inv queues 2018-10-17 19:45:37 +03:00
Daniel Kraft
ad0ec643b7 [trivial] Add missing const qualifiers.
Add some const qualifiers to references that are not modified and should
be marked as const.
2018-10-17 19:44:48 +03:00
Gregory Maxwell
05c3d2e290 Eliminate TX trickle bypass, sort TX invs for privacy and priority.
Previously Bitcoin would send 1/4 of transactions out to all peers
 instantly.  This causes high overhead because it makes >80% of
 INVs size 1.  Doing so harms privacy, because it limits the
 amount of source obscurity a transaction can receive.

These randomized broadcasts also disobeyed transaction dependencies
 and required use of the orphan pool.  Because the orphan pool is
 so small this leads to poor propagation for dependent transactions.

When the bypass wasn't in effect, transactions were sent in the
 order they were received.  This avoided creating orphans but
 undermines privacy fairly significantly.

This commit:
 Eliminates the bypass. The bypass is replaced by halving the
  average delay for outbound peers.

 Sorts candidate transactions for INV by their topological
  depth then by their feerate (then hash); removing the
  information leakage and providing priority service to
  higher fee transactions.

 Limits the amount of transactions sent in a single INV to
  7tx/sec (and twice that for outbound); this limits the
  harm of low fee transaction floods, gives faster relay
  service to higher fee transactions. The 7 sounds lower
  than it really is because received advertisements need
  not be sent, and because the aggregate rate is multipled
  by the number of peers.
2018-10-17 19:44:11 +03:00
Matt Corallo
705fe53e49 Fix some minor compact block issues that came up in review 2018-10-17 19:24:21 +03:00
Matt Corallo
4e55d9962c Get our "best three" peers to announce blocks using cmpctblocks 2018-10-17 19:23:07 +03:00
Matt Corallo
0fcad61796 Add receiver-side protocol implementation for CMPCTBLOCK stuff 2018-10-17 19:20:33 +03:00
Matt Corallo
c94ec58bcf Add sender-side protocol implementation for CMPCTBLOCK stuff 2018-10-17 19:20:24 +03:00
Matt Corallo
78b7288568 If AcceptBlockHeader returns true, pindex will be set. 2018-10-17 19:13:58 +03:00
Daniel Kraft
7571028f10 net: Avoid duplicate getheaders requests. 2018-10-17 19:08:41 +03:00
Pavel Janík
dadb56e60d Fix doxygen comment: the transaction is returned in txOut
Github-Pull: #8993
Rebased-From: 1d8e12ba48154b2c59213e92efb50958d430a007
2018-10-17 01:09:27 +03:00
Cory Fields
793b8f55b1 net: don't send feefilter messages before the version handshake is complete
Github-Pull: #9117
Rebased-From: 46625538d674a5aaf1bcfa7c8be8a49e5a23fa9e
2018-10-17 01:03:48 +03:00
lateminer
eb242178e1 Attempt to fix testnet 2018-10-17 00:40:44 +03:00
lateminer
eea97b0e37 Make it compile and apply some fixes 2018-10-14 22:49:30 +03:00
lateminer
f7422db2f7 Update to Core 0.12.2 2018-10-14 19:07:51 +03:00
Gregory Maxwell
1bf644c43f IBD check uses minimumchain work instead of checkpoints. 2018-10-14 17:00:29 +03:00
Pavel Janík
e670323162 Log invalid block hash to make debugging easier. 2018-10-14 15:26:26 +03:00
ptschip
99c318c13f Do not download transactions during inital sync 2018-10-14 15:11:16 +03:00
lateminer
43e6bbc312 Make it compile 2018-10-14 14:22:03 +03:00
Kaz Wesley
000a97ca5f replace mapNextTx with slimmer setSpends 2018-10-13 18:59:42 +03:00
Pieter Wuille
cd30f2becb Rename to PrecomputedTransactionData 2018-10-13 17:57:50 +03:00
Pieter Wuille
d8d19c532f Precompute sighashes 2018-10-13 17:39:41 +03:00
Pieter Wuille
81e04cabfe Refactor script validation to observe amounts 2018-10-13 17:05:24 +03:00
lateminer
c6238629b3 Remove drivechain support using OP_COUNT_ACKS 2018-10-13 16:30:31 +03:00
lateminer
b76793c9f9 Fix backporting errors
main.cpp
wallet/wallet.cpp
wallet/wallet.h
2018-10-13 16:14:49 +03:00
Alex Morcos
b821da64ef Implement "feefilter" P2P message. 2018-10-13 15:44:02 +03:00
Suhas Daftuar
75e463decf Improve handling of unconnecting headers 2018-10-13 14:05:45 +03:00
lateminer
b35f06eda3 Update code with PACKAGE_NAME and COPYRIGHT_HOLDERS 2018-10-13 13:49:46 +03:00
Luke Dashjr
116f49d390 Implement BIP 9 GBT changes
- BIP9DeploymentInfo struct for static deployment info
- VersionBitsDeploymentInfo: Avoid C++11ism by commenting parameter names
- getblocktemplate: Make sure to set deployments in the version if it is LOCKED_IN
- In this commit, all rules are considered required for clients to support
2018-10-13 02:42:30 +03:00
lateminer
66dd63a23b Proof-of-stake related code refactoring and cleanup 2018-10-12 23:40:50 +03:00
lateminer
e9886e3f1b Code cleanup 2018-10-12 00:34:40 +03:00
lateminer
d452787a2c Completely remove coinage 2018-10-12 00:04:41 +03:00
lateminer
b338987d94 Move block height check from ContextualCheckBlock() to ConnectBlock() 2018-10-11 22:56:04 +03:00
lateminer
b1bb30cb3a Remove address indexes 2018-10-11 22:02:52 +03:00
lateminer
3a29ae6903 Some code refactoring and cleanup 2018-10-02 01:04:31 +03:00
Jonas Schnelli
71eeb17454 [Qt] show network/chain errors in the GUI 2018-09-30 18:56:56 +03:00
BtcDrak
556187e3f8 Remove bad chain alert partition check
As per meeting 2016-03-31
https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts

The partition checker was producing huge number of false-positives
and was disabled in 0.12.1 on the understanding it would either be
fixed in 0.13 or removed entirely from master if not.
2018-09-30 18:14:12 +03:00
BtcDrak
694c451c7e Update alert notification and GUI 2018-09-30 18:07:26 +03:00
BtcDrak
8fb8ada384 Remove -alerts option 2018-09-30 18:06:51 +03:00
BtcDrak
7de932ba87 Remove p2p alert handling 2018-09-30 18:03:59 +03:00
lateminer
20938be16f Fix: Reformat version in UpdateTip and other messages 2018-01-13 14:27:47 +03:00
Russell Yanofsky
67c3960ddb Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in https://github.com/bitcoin/bitcoin/pull/8680#r78209060
2018-01-13 13:45:03 +03:00