mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
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:
parent
fc5656894d
commit
db20f25ff7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user