diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-18 12:15:01 -0800 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-12-02 08:38:02 +0100 |
commit | 99477c71c4cdb5127e0fd6e12f29507320432d9f (patch) | |
tree | 2c7e7484d3b078a5adb95c9eee041f5541552627 /src/rpc | |
parent | da5a16b11dca8f61d75f92bb08f1dd19a7800158 (diff) | |
download | bitcoin-99477c71c4cdb5127e0fd6e12f29507320432d9f.tar.xz |
Always add default_witness_commitment with GBT client support
Github-Pull: #9189
Rebased-From: ad04d1cb35b9612d36078c62213bdbb13f56d73d
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/mining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index e6901bc77e..ba48079c05 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -683,7 +683,9 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) 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()))); } |