Skip to content
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

Show peer that sent transaction when it causes a DoS(100). #1375

Closed
wants to merge 1 commit into from

Conversation

rebroad
Copy link
Contributor

@rebroad rebroad commented May 22, 2012

I originally raised pull #1311 with this, but that was too big and contained too many changes. Pull #1338 followed, but still had some changes which were contentious. This pull contains just the addition of displaying the peer of DoS(100) transactions, and pull #1338 has had that part removed.

@gavinandresen
Copy link
Contributor

Is this thread safe? What if the thread executing the if (txnode) is interrupted after the if test, could another thread wake up and set txnode=NULL ?

NACK in general-- too many code changes, the risks outweigh the (minimal) benefits.

@luke-jr
Copy link
Member

luke-jr commented May 26, 2012

NACK, example of bad use of a global IMO

@rebroad
Copy link
Contributor Author

rebroad commented May 29, 2012

@gavinandresen It's thread safe unless some future change tries to change the value of txnode from a different thread. So far, only one thread uses txnode, so the value won't get changed between the test and the use.

@luke-jr - thanks for the feedback. How would you recommend doing it? I realise I could just add one line in ProcessMessage() to log the peer against the tx, but I guess my motivation was to keep debug.log small (at the expense of code brevity)....

@sipa
Copy link
Member

sipa commented May 29, 2012

You're right that currently txnode is only set in ProcessMessage, which is only used in a single thread. But I agree it's a bad use of a global. If you really need to know who sent it, pass it along in arguments, or only report the offender from functions that do know.

Not worth it, imho.

@rebroad
Copy link
Contributor Author

rebroad commented May 29, 2012

@sipa I did try passing it in arguments, but I was getting errors about incorrect number of arguments. Perhaps my understanding of C++ isn't quite sufficient.. :-s Is there any way to restrict the use of txnode so that it can't be used by other threads?

@luke-jr
Copy link
Member

luke-jr commented May 29, 2012

Too bad C++ doesn't have Perl's locals ;)

@jgarzik
Copy link
Contributor

jgarzik commented Aug 1, 2012

Consensus: not worth it, closing

@jgarzik jgarzik closed this Aug 1, 2012
@jgarzik jgarzik mentioned this pull request Aug 1, 2012
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
* fix recently observed crash on IsValid

+some small cleanup

* txin.prevout.n should not exceed txOutpointCreated.vout.size()

* fix log output
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Jan 22, 2019
In the previous attempt I forgot to change an operator
definition in miner.cpp and one in txmempool.h
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request May 6, 2020
…he UI model

9182b90 Initialize logging before we do parameter interaction (Jonas Schnelli)
dec0787 [QT] Call inits parameter interaction before we create the options model (Jonas Schnelli)
18480ce Refactor parameter interaction, call it before AppInit2() (Jonas Schnelli)

Pull request description:

  Backport of bitcoin#6780

  Currently optionsModel(QT) parameters interaction overwrites/dominates initial and depending parameter settings. This PR would factor out init's parameter interaction and call it before AppInit2().

ACKs for top commit:
  furszy:
    ACK 9182b90
  random-zebra:
    ACK rebase 9182b90 and merging...

Tree-SHA512: f01c9b6603452d59c3fa7df8b8f85998b9c716fd3209f80fc6d4591035c995ad577b217d1d7ffd7f642d16fe130ee922ba0394870ec391b8e972587022962611
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request May 6, 2020
…ns can be shared

77998ed Combine common error strings so translations can be shared and reused (Luke Dashjr)

Pull request description:

  Backport of bitcoin#7257

  Adds helper methods for common translatable string outputs during init, end result is that the number of strings sent to Transifex is reduced/standardized.

  Based on top of bitcoin#1375

  Conflicts with bitcoin#1373 (this to be rebased after both bitcoin#1373 and bitcoin#1375 are merged)

ACKs for top commit:
  random-zebra:
    utACK 77998ed
  furszy:
    utACK 77998ed and merging..

Tree-SHA512: 9805b931829f76cbc34b43b7e6141b236d162bd0267342714222612b8e51cdc9d8b35e68971775bd7a489e95a3c4f9b533bbf1ecaa0e56b19a443ed308141c87
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants