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.
This commit is contained in:
Dave Collins 2014-06-29 19:45:10 -05:00
parent fc5656894d
commit db20f25ff7

View file

@ -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