Skip to content

Conversation

@TheBlueMatt
Copy link
Contributor

These should be invalid.

@groffer
Copy link

groffer commented Aug 2, 2011

CheckBlock calls this function. Won't this cause a fork in the blockchain if the network doesn't upgrade as a whole and a transaction that runs afoul of this check is included in a block?

@sipa
Copy link
Member

sipa commented Aug 2, 2011

Such a transaction should already cause the block it is included in to be invalid, as ConnectInputs will detect the duplicate use of the same prevout. This patch just causes such cases to be detected in an earlier stage, before it enters the memory pool.

@TheBlueMatt
Copy link
Contributor Author

If a transaction with a duplicate input is in a block, the chain should be forked (or people are making money out of nothing).
Also, no transactions with duplicate inputs get put in blocks...someone tried it a couple weeks ago, but the txes never ended up in blocks. Im assuming there is a check somewhere later on that prevented them from getting added to a block, though I haven't done any digging on the matter. This is really to prevent such obviously invalid transactions from getting relayed.

@groffer
Copy link

groffer commented Aug 2, 2011

Right, looks like the vSpent check in ConnectInputs takes care of it.

gavinandresen added a commit that referenced this pull request Aug 8, 2011
Check for duplicate txins in CheckTransaction.
@gavinandresen gavinandresen merged commit 4e5d88c into bitcoin:master Aug 8, 2011
dexX7 added a commit to dexX7/bitcoin that referenced this pull request Jan 9, 2017
…iant characters

b262ee2 Sanitize RPC responses and replace non-UTF-8 compliant characters (dexX7)
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Apr 19, 2017
Add start-up functionality to check if Qt application settings need to be migrated.
kallewoof pushed a commit to kallewoof/bitcoin that referenced this pull request Oct 4, 2019
…nt/non-inflation chains

7bac720 add block subsidy argument to allow different/non-inflation chains (Gregory Sanders)

Pull request description:

  Previously we just set this to 0 and continued, this allows tests to otherwise pass up until this point.

Tree-SHA512: e4e6ae85779a6079ccad38941b4b0dbb3362fa4d902aff5cedbea4641201646f6946cc0d140cb0fdac81c5009ff983baabebcbeeed99f089e44ad492fd6cd1ee
rajarshimaitra pushed a commit to rajarshimaitra/bitcoin that referenced this pull request Aug 5, 2021
Introduction - Trust Model of Bitcoin
@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.

4 participants