diff options
| author | Pieter Wuille <[email protected]> | 2016-11-18 12:15:01 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-11-21 15:01:04 -0800 |
| commit | ad04d1cb35b9612d36078c62213bdbb13f56d73d (patch) | |
| tree | 7ccd702d3a83693cf5ad21ff1e1ce9ca6d6309f7 /src/rpc/mining.cpp | |
| parent | Merge #8872: Remove block-request logic from INV message processing (diff) | |
| download | discoin-ad04d1cb35b9612d36078c62213bdbb13f56d73d.tar.xz discoin-ad04d1cb35b9612d36078c62213bdbb13f56d73d.zip | |
Always add default_witness_commitment with GBT client support
Diffstat (limited to 'src/rpc/mining.cpp')
| -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 6b0e52a30..f3cd1fbf0 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()))); } |