def sign_stake_tx(self, block, stake_in_value, fZPoS=False):
    ' signs a coinstake transaction\n        :param      block:           (CBlock) block with stake to sign\n                    stake_in_value:  (int) staked amount\n                    fZPoS:           (bool) zerocoin stake\n        :return:    stake_tx_signed: (CTransaction) signed tx\n        '
    self.block_sig_key = CECKey()
    if fZPoS:
        self.log.info('Signing zPoS stake...')
        raw_stake = self.node.createrawzerocoinstake(block.prevoutStake)
        stake_tx_signed_raw_hex = raw_stake['hex']
        stake_pkey = raw_stake['private-key']
        self.block_sig_key.set_compressed(True)
        self.block_sig_key.set_secretbytes(bytes.fromhex(stake_pkey))
    else:
        self.block_sig_key.set_secretbytes(hash256(pack('<I', 65535)))
        pubkey = self.block_sig_key.get_pubkey()
        scriptPubKey = CScript([pubkey, OP_CHECKSIG])
        outNValue = int((stake_in_value + (2 * COIN)))
        stake_tx_unsigned = CTransaction()
        stake_tx_unsigned.nTime = block.nTime
        stake_tx_unsigned.vin.append(CTxIn(block.prevoutStake))
        stake_tx_unsigned.vin[0].nSequence = 4294967295
        stake_tx_unsigned.vout.append(CTxOut())
        stake_tx_unsigned.vout.append(CTxOut(outNValue, scriptPubKey))
        stake_tx_signed_raw_hex = self.node.signrawtransaction(bytes_to_hex_str(stake_tx_unsigned.serialize()))['hex']
    stake_tx_signed = CTransaction()
    stake_tx_signed.deserialize(BytesIO(hex_str_to_bytes(stake_tx_signed_raw_hex)))
    return stake_tx_signed
signs a coinstake transaction
:param      block:           (CBlock) block with stake to sign
            stake_in_value:  (int) staked amount
            fZPoS:           (bool) zerocoin stake
:return:    stake_tx_signed: (CTransaction) signed tx
def sign_stake_tx(self, block, stake_in_value, fZPoS=False):
    ' signs a coinstake transaction\n        :param      block:           (CBlock) block with stake to sign\n                    stake_in_value:  (int) staked amount\n                    fZPoS:           (bool) zerocoin stake\n        :return:    stake_tx_signed: (CTransaction) signed tx\n        '
    self.block_sig_key = CECKey()
    if fZPoS:
        self.log.info('Signing zPoS stake...')
        raw_stake = self.node.createrawzerocoinstake(block.prevoutStake)
        stake_tx_signed_raw_hex = raw_stake['hex']
        stake_pkey = raw_stake['private-key']
        self.block_sig_key.set_compressed(True)
        self.block_sig_key.set_secretbytes(bytes.fromhex(stake_pkey))
    else:
        self.block_sig_key.set_secretbytes(hash256(pack('<I', 65535)))
        pubkey = self.block_sig_key.get_pubkey()
        scriptPubKey = CScript([pubkey, OP_CHECKSIG])
        outNValue = int((stake_in_value + (2 * COIN)))
        stake_tx_unsigned = CTransaction()
        stake_tx_unsigned.nTime = block.nTime
        stake_tx_unsigned.vin.append(CTxIn(block.prevoutStake))
        stake_tx_unsigned.vin[0].nSequence = 4294967295
        stake_tx_unsigned.vout.append(CTxOut())
        stake_tx_unsigned.vout.append(CTxOut(outNValue, scriptPubKey))
        stake_tx_signed_raw_hex = self.node.signrawtransaction(bytes_to_hex_str(stake_tx_unsigned.serialize()))['hex']
    stake_tx_signed = CTransaction()
    stake_tx_signed.deserialize(BytesIO(hex_str_to_bytes(stake_tx_signed_raw_hex)))
    return stake_tx_signed