Skip to content

Commit

Permalink
Implement BIP0023 basic pool extensions support.
Browse files Browse the repository at this point in the history
This commit implements the basic pool extension portion of the getblocktemplate
RPC as defined by BIP0023.

This is work towards btcsuite#124.
  • Loading branch information
davecgh committed Jul 10, 2014
1 parent fc56568 commit db20f25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld

// Generate the block template reply.
header := &msgBlock.Header
targetDifficulty := fmt.Sprintf("%064x", btcchain.CompactToBig(header.Bits))
templateID := encodeTemplateID(state.prevHash, state.lastGenerated)
reply := btcjson.GetBlockTemplateResult{
Bits: strconv.FormatInt(int64(header.Bits), 16),
Expand All @@ -1609,6 +1610,7 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld
LongPollID: templateID,
SubmitOld: submitOld,
MinTime: state.minTimestamp.Unix(),
Target: targetDifficulty,
}
if useCoinbaseValue {
reply.CoinbaseAux = gbtCoinbaseAux
Expand Down

0 comments on commit db20f25

Please sign in to comment.