message: Add segwit tx data to getrawtransaction for bitcore
diff: @@ -70,10 +70,14 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue&
  {
  uint256 txid = tx.GetHash();
  - entry.push_back(Pair("txid", txid.GetHex()));
  - entry.push_back(Pair("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)));
  - entry.push_back(Pair("version", tx.nVersion));
  - entry.push_back(Pair("locktime", (int64_t)tx.nLockTime));
  + entry.pushKV("txid", tx.GetHash().GetHex());
  + entry.pushKV("hash", tx.GetWitnessHash().GetHex());
  + entry.pushKV("version", tx.nVersion);
  + entry.pushKV("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));
  + entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);
  + entry.pushKV("weight", GetTransactionWeight(tx));
  + entry.pushKV("locktime", (int64_t)tx.nLockTime);
  +
  UniValue vin(UniValue::VARR);
  for(const CTxIn& txin : tx.vin) {
  UniValue in(UniValue::VOBJ);
  @@ -86,7 +90,13 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue&
  o.push_back(Pair("asm", ScriptToAsmStr(txin.scriptSig, true)));
  o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
  in.push_back(Pair("scriptSig", o));
  -
  + if (!txin.scriptWitness.IsNull()) {
  + UniValue txinwitness(UniValue::VARR);
  + for (const auto& item : txin.scriptWitness.stack) {
  + txinwitness.push_back(HexStr(item.begin(), item.end()));
  + }
  + in.pushKV("txinwitness", txinwitness);
  + }
  // Add address and value info if spentindex enabled
  CSpentIndexValue spentInfo;
  CSpentIndexKey spentKey(txin.prevout.hash, txin.prevout.n);
  