Branch: refs/heads/master
  Home:   https://github.com/conformal/btcd
  Commit: a64ffb820a7249e9c49b738c9abb221195ff7192
      
https://github.com/conformal/btcd/commit/a64ffb820a7249e9c49b738c9abb221195ff7192
  Author: Dave Collins <[email protected]>
  Date:   2015-01-08 (Thu, 08 Jan 2015)

  Changed paths:
    M rpcserver.go

  Log Message:
  -----------
  Correct RPC time handling for getblocktemplate.

This commit modifies the getblocktemplate RPC to correctly handle the
curtime field.

Currently, the RPC server will refuse to serve a block template if the
current time is before the minimum allowed time for a block even though
the real generated block template already accounted for it.

This consists of three changes:
- Remove the unnecessary and incorrect check in the RPC invocation for the
  current time against the min required time since it is already handled
  properly by the block template generation.
- Expose the network time source to the RPC work state and use the
  adjusted time for checking against the maximum allowed time instead of
  the current time.
- Set the returned RPC result curtime field to the time of the generated
  block header.

Fixes #209.


Reply via email to