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

Added RPC call 'getmemorypool' to get list of transactions that would be #476

Merged
merged 1 commit into from Oct 1, 2011
Merged

Added RPC call 'getmemorypool' to get list of transactions that would be #476

merged 1 commit into from Oct 1, 2011

Conversation

forrestv
Copy link
Contributor

Added RPC call 'getmemorypool' to get list of transactions that would be included in a generated block.

This is useful for any program that wants to create its own generation transaction while mining.

P2Pool recently generated its first block, and this patch would let it include transactions.

@gavinandresen
Copy link
Contributor

Was there a design discussion for this anywhere?

You're returning more than just the list of transactions, and there is some magic code I don't understand (like the ...GetTime() - nStart > 60 ... what is that about?)

@forrestv
Copy link
Contributor Author

There wasn't a discussion - I assumed we'd have it here and I'd revise it.

It also returns the previous block and the total amount of fees in those transactions. The previous block hash is important because these specific transactions are only valid following that block.

The magic code is just a copy of the block caching code from the getwork handler.

@gavinandresen
Copy link
Contributor

"If it is a more complicated or potentially controversial change, then the patch submitter will be asked to start a discussion (if they haven't already) on the development forums: http://www.bitcoin.org/smf/index.php?board=6.0 "

... from the top-level README. Please start a discussion on the forums or the bitcoin-dev mailing list.

@TheBlueMatt
Copy link
Contributor

you still suggest anyone try to start a sensible discussion on those forums?

@forrestv
Copy link
Contributor Author

@nanotube
Copy link

by the way, wanted to make a note @gavinandresen : this will also be useful for writing that cross-client test-suite you were talking about.

when we were discussing it, you were primarily focusing on sending client various bits of blockchain. however, as we know from the existing bug where transactions with duplicate inputs are treated as valid for the purposes of rebroadcast, testing the client by sending it a bunch of weird transactions would be good too. and this getmemorypool functionality would let you query the client to see if it has 'accepted' the transaction.

just a thought. :)

@ervwalter
Copy link

can you rebase this against 0.4rc?

@forrestv
Copy link
Contributor Author

forrestv commented Sep 5, 2011

Rebased.

@goblin
Copy link

goblin commented Sep 6, 2011

I'm soooo excited about it! :-D

Thanks to this the awesome decentralized p2pool can now include transactions and make actual use of the mining power :-)
First mined block with transactions: http://blockexplorer.com/b/143923

Thanks

@gavinandresen
Copy link
Contributor

I'd like to pull this; can you rebase again?

…struct a block with a custom generation transaction and submit a solution

getmemorypool [data]
If [data] is not specified, returns data needed to construct a block to work on:
  "version" : block version
  "previousblockhash" : hash of current highest block
  "transactions" : contents of non-coinbase transactions that should be included in the next block
  "coinbasevalue" : maximum allowable input to coinbase transaction, including the generation award and transaction fees
  "time" : timestamp appropriate for next block
  "bits" : compressed target of next block
If [data] is specified, tries to solve the block and returns true if it was successful.
@forrestv
Copy link
Contributor Author

forrestv commented Oct 1, 2011

Rebased. Thanks!

gavinandresen added a commit that referenced this pull request Oct 1, 2011
Added RPC call 'getmemorypool' for p2p mining pools
@gavinandresen gavinandresen merged commit ad9ceec into bitcoin:master Oct 1, 2011
coblee referenced this pull request in litecoin-project/litecoin Jul 17, 2012
Added RPC call 'getmemorypool' for p2p mining pools
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants