aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-11-25 08:25:30 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-11-25 08:26:25 +0100
commitd932159f3467cc197caaf281f34f3324e6b5bea8 (patch)
tree060c7278581eeeeaade71153af302c9239751fdb /src/rpc
parentbc121b0eb19713ec72002b5be03ba5ac35903a17 (diff)
parent95f4a03777ec2ad82a94a3e2890192a93ad83509 (diff)
Merge #9189: Always add default_witness_commitment with GBT client support
95f4a03 [qa] Test getblocktemplate default_witness_commitment (Suhas Daftuar) ad04d1c Always add default_witness_commitment with GBT client support (Pieter Wuille)
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/mining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 6b0e52a309..f3cd1fbf0b 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -680,7 +680,9 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
result.push_back(Pair("curtime", pblock->GetBlockTime()));
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));
- if (!pblocktemplate->vchCoinbaseCommitment.empty()) {
+
+ const struct BIP9DeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT];
+ if (!pblocktemplate->vchCoinbaseCommitment.empty() && setClientRules.find(segwit_info.name) != setClientRules.end()) {
result.push_back(Pair("default_witness_commitment", HexStr(pblocktemplate->vchCoinbaseCommitment.begin(), pblocktemplate->vchCoinbaseCommitment.end())));
}