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

pull forrestv wants to merge 1 commits into bitcoin:master from forrestv:getmemorypool changing 3 files +85 −2
  1. forrestv commented at 4:48 am on August 24, 2011: 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.

  2. gavinandresen commented at 1:36 pm on August 24, 2011: 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?)

  3. forrestv commented at 2:12 pm on August 24, 2011: contributor

    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.

  4. gavinandresen commented at 2:32 pm on August 24, 2011: 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.

  5. TheBlueMatt commented at 2:33 pm on August 24, 2011: member
    you still suggest anyone try to start a sensible discussion on those forums?
  6. forrestv commented at 9:06 pm on August 24, 2011: contributor
  7. nanotube commented at 2:40 pm on August 30, 2011: none

    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. :)

  8. ervwalter commented at 12:53 pm on September 5, 2011: none
    can you rebase this against 0.4rc?
  9. forrestv commented at 6:59 pm on September 5, 2011: contributor
    Rebased.
  10. goblin commented at 3:04 pm on September 6, 2011: none

    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

  11. gavinandresen commented at 5:03 pm on October 1, 2011: contributor
    I’d like to pull this; can you rebase again?
  12. Added RPC call 'getmemorypool' that provides everything needed to construct 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.
    074d584a04
  13. forrestv commented at 6:49 pm on October 1, 2011: contributor
    Rebased. Thanks!
  14. gavinandresen referenced this in commit ad9ceecf9c on Oct 1, 2011
  15. gavinandresen merged this on Oct 1, 2011
  16. gavinandresen closed this on Oct 1, 2011

  17. coblee referenced this in commit ffc57f071a on Jul 17, 2012
  18. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me