Skip to content

Commit 6bc9a2b

Browse files
committed
mining: always returns .coinbasevalue in getblocktemplate
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.
1 parent 9bcd3d0 commit 6bc9a2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rpcserver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,6 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld
23682368

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

2403+
// Return coinbasevalue anyway as lbrycrd and bitcoind do.
2404+
reply.CoinbaseValue = &msgBlock.Transactions[0].TxOut[0].Value
2405+
24042406
return &reply, nil
24052407
}
24062408

0 commit comments

Comments
 (0)