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

Check for duplicate txins in CheckTransaction. #443

Merged
merged 1 commit into from Aug 8, 2011

Conversation

Projects
None yet
4 participants
@TheBlueMatt
Copy link
Contributor

TheBlueMatt commented Jul 31, 2011

These should be invalid.

@groffer

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

TheBlueMatt commented Aug 2, 2011

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

This comment has been minimized.

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

Merge pull request #443 from TheBlueMatt/dupin
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

Merge bitcoin#443: Sanitize RPC responses and replace non-UTF-8 compl…
…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

Merge pull request bitcoin#443 from Justaphf/migrateSettings
Add start-up functionality to check if Qt application settings need to be migrated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment