Changeset View
Changeset View
Standalone View
Standalone View
src/core_write.cpp
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <core_io.h> | #include <core_io.h> | ||||
#include <config.h> | |||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <script/sigencoding.h> | #include <script/sigencoding.h> | ||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <util.h> | #include <util.h> | ||||
▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { | ||||
return; | return; | ||||
} | } | ||||
out.pushKV("reqSigs", nRequired); | out.pushKV("reqSigs", nRequired); | ||||
out.pushKV("type", GetTxnOutputType(type)); | out.pushKV("type", GetTxnOutputType(type)); | ||||
UniValue a(UniValue::VARR); | UniValue a(UniValue::VARR); | ||||
for (const CTxDestination &addr : addresses) { | for (const CTxDestination &addr : addresses) { | ||||
a.push_back(EncodeDestination(addr)); | a.push_back(EncodeDestination(addr, GetConfig())); | ||||
} | } | ||||
out.pushKV("addresses", a); | out.pushKV("addresses", a); | ||||
} | } | ||||
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | ||||
bool include_hex, int serialize_flags) { | bool include_hex, int serialize_flags) { | ||||
entry.pushKV("txid", tx.GetId().GetHex()); | entry.pushKV("txid", tx.GetId().GetHex()); | ||||
entry.pushKV("hash", tx.GetHash().GetHex()); | entry.pushKV("hash", tx.GetHash().GetHex()); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |