Skip to content

Commit

Permalink
mining: always returns .coinbasevalue in getblocktemplate
Browse files Browse the repository at this point in the history
Although the BIPs specify that coinbasetxn and coinbasevalue are
mutually exclusive, both the latest bitcoind (22.0.0) and lbrycrd
(0.17.3) return .coinbasevalue regardeless if 'coinbasetxn' is
specified in the capabilities.

We'll make lbcd behave the same for compatibility.
  • Loading branch information
roylee17 committed Sep 26, 2022
1 parent 9bcd3d0 commit 6bc9a2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,6 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld

if useCoinbaseValue {
reply.CoinbaseAux = gbtCoinbaseAux
reply.CoinbaseValue = &msgBlock.Transactions[0].TxOut[0].Value
} else {
// Ensure the template has a valid payment address associated
// with it when a full coinbase is requested.
Expand Down Expand Up @@ -2401,6 +2400,9 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld
reply.CoinbaseTxn = &resultTx
}

// Return coinbasevalue anyway as lbrycrd and bitcoind do.
reply.CoinbaseValue = &msgBlock.Transactions[0].TxOut[0].Value

return &reply, nil
}

Expand Down

0 comments on commit 6bc9a2b

Please sign in to comment.