rpc: only add wit-nonce if segwit is active (submitblock).

This commit is contained in:
Christopher Jeffrey 2017-02-25 18:22:22 -08:00
parent 4c4cf9e6a4
commit 386ef622c0
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1467,7 +1467,7 @@ RPC.prototype.submitblock = co(function* submitblock(args) {
block = Block.fromRaw(toString(args[0]), 'hex');
// Fix eloipool bug (witness nonce is not present).
if (block.getCommitmentHash()) {
if (this.chain.state.hasWitness() && block.getCommitmentHash()) {
tx = block.txs[0];
if (!tx.hasWitness()) {
this.logger.warning('Submitted block had no witness nonce.');