From db20f25ff7c58d97e1e9a8bd53eb724f834789fe Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 29 Jun 2014 19:45:10 -0500 Subject: [PATCH] Implement BIP0023 basic pool extensions support. This commit implements the basic pool extension portion of the getblocktemplate RPC as defined by BIP0023. This is work towards #124. --- rpcserver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 01ab0fe9..c7cf9dc1 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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), @@ -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