-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Implement "feefilter" P2P message #7542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember adding the clang-format script some time ago. Something like git diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v should do all of this.
|
Nice Work! |
src/main.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To unlock the thread-lock for the LogPrint at L5174.
|
Any volunteer to write some test cases? |
src/protocol.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luke-jr Can you please assign a BIP number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morcos needs to request this.
|
What will we do when we sent In the DIP draft, you wrote:
Is this what we want? Why should a protocol 70013 peer relay such |
|
Addressed the cleanup comments @paveljanik It's impossible to be sure there aren't invs or txs in flight with fee rates below the cut off. Also in general we don't have a good system for responding to p2p misbehavior. I think this could be extended later with that ability, but as of now it does not appear to open up any additional DoS attacks if you don't abide by the message. |
src/main.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its -> it is/it's
|
Squashed and rebased |
|
Please mention the bip number in the github subject line. Also you'd need to update |
doc/release-notes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I am pretty sure this goes up to "Notable changes" (Example item) as this place down here is usually used for the detailed change log only.
|
Concept ACK ef3b850 |
|
@MarcoFalke OK I made your suggested change |
src/main.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit: Add missing ampersand to CAmount nAbsurdFee?
|
ACK |
1 similar comment
|
ACK |
src/main.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs merge conflict resolved.
The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool. This will allow them to filter invs to you according to this feerate.
|
Squashed 1 commit and rebased to address merge conflict (trivial) |
|
utACK 0371797 |
| if (pto->nVersion >= FEEFILTER_VERSION && GetBoolArg("-feefilter", DEFAULT_FEEFILTER) && | ||
| !(pto->fWhitelisted && GetBoolArg("-whitelistforcerelay", DEFAULT_WHITELISTFORCERELAY))) { | ||
| CAmount currentFilter = mempool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK(); | ||
| int64_t timeNow = GetTimeMicros(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use nNow variable which is also set to GetTimeMicros() earlier in this function?
This reverts commit 11ac70a.
This reverts commit 11ac70a.
Please see mailing list discussion
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-February/012449.html