mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Backport 8824 (#2968)
* Merge #8824: Refactor TxToJSON() and ScriptPubKeyToJSON()
0ff9320
refactor TxToJSON() and ScriptPubKeyToJSON() (jonnynewbs)
Tree-SHA512: caf7d590829e221522edd5b1ab8ce67b53a2c6986d3bbe8477eab420b1007bf60f885ed0a25ba9587e468c00768360ddc31db37847e862858573eaed5ed8b0d6
* remove witness and vsize
Signed-off-by: Pasta <Pasta@dash.org>
* Add valueSat
To preserve rpc output format
* Move extrapayload and special tx json output to `TxToUniv`
* Add spent index info
This commit is contained in:
parent
1d7710d06a
commit
56d1d13c43
@ -15,6 +15,8 @@ struct CMutableTransaction;
|
||||
class uint256;
|
||||
class UniValue;
|
||||
|
||||
struct CSpentIndexTxInfo;
|
||||
|
||||
// core_read.cpp
|
||||
CScript ParseScript(const std::string& s);
|
||||
std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
|
||||
@ -28,6 +30,6 @@ std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strN
|
||||
std::string FormatScript(const CScript& script);
|
||||
std::string EncodeHexTx(const CTransaction& tx);
|
||||
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
|
||||
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry);
|
||||
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, const CSpentIndexTxInfo* ptxSpentInfo = nullptr);
|
||||
|
||||
#endif // BITCOIN_CORE_IO_H
|
||||
|
@ -10,11 +10,18 @@
|
||||
#include "script/standard.h"
|
||||
#include "serialize.h"
|
||||
#include "streams.h"
|
||||
#include <univalue.h>
|
||||
#include "univalue.h"
|
||||
#include "util.h"
|
||||
#include "utilmoneystr.h"
|
||||
#include "utilstrencodings.h"
|
||||
|
||||
#include "spentindex.h"
|
||||
|
||||
#include "evo/cbtx.h"
|
||||
#include "evo/providertx.h"
|
||||
#include "evo/specialtx.h"
|
||||
#include "llmq/quorums_commitment.h"
|
||||
|
||||
#include <boost/assign/list_of.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
@ -146,10 +153,12 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
|
||||
out.pushKV("addresses", a);
|
||||
}
|
||||
|
||||
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
|
||||
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, const CSpentIndexTxInfo* ptxSpentInfo)
|
||||
{
|
||||
entry.pushKV("txid", tx.GetHash().GetHex());
|
||||
uint256 txid = tx.GetHash();
|
||||
entry.pushKV("txid", txid.GetHex());
|
||||
entry.pushKV("version", tx.nVersion);
|
||||
entry.pushKV("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));
|
||||
entry.pushKV("locktime", (int64_t)tx.nLockTime);
|
||||
|
||||
UniValue vin(UniValue::VARR);
|
||||
@ -164,6 +173,23 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
|
||||
o.pushKV("asm", ScriptToAsmStr(txin.scriptSig, true));
|
||||
o.pushKV("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()));
|
||||
in.pushKV("scriptSig", o);
|
||||
|
||||
// Add address and value info if spentindex enabled
|
||||
if (ptxSpentInfo != nullptr) {
|
||||
CSpentIndexKey spentKey(txin.prevout.hash, txin.prevout.n);
|
||||
auto it = ptxSpentInfo->mSpentInfo.find(spentKey);
|
||||
if (it != ptxSpentInfo->mSpentInfo.end()) {
|
||||
auto spentInfo = it->second;
|
||||
UniValue outValue(UniValue::VNUM, FormatMoney(spentInfo.satoshis));
|
||||
in.push_back(Pair("value", outValue));
|
||||
in.push_back(Pair("valueSat", spentInfo.satoshis));
|
||||
if (spentInfo.addressType == 1) {
|
||||
in.push_back(Pair("address", CBitcoinAddress(CKeyID(spentInfo.addressHash)).ToString()));
|
||||
} else if (spentInfo.addressType == 2) {
|
||||
in.push_back(Pair("address", CBitcoinAddress(CScriptID(spentInfo.addressHash)).ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
in.pushKV("sequence", (int64_t)txin.nSequence);
|
||||
vin.push_back(in);
|
||||
@ -178,15 +204,77 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
|
||||
|
||||
UniValue outValue(UniValue::VNUM, FormatMoney(txout.nValue));
|
||||
out.pushKV("value", outValue);
|
||||
out.pushKV("valueSat", txout.nValue);
|
||||
out.pushKV("n", (int64_t)i);
|
||||
|
||||
UniValue o(UniValue::VOBJ);
|
||||
ScriptPubKeyToUniv(txout.scriptPubKey, o, true);
|
||||
out.pushKV("scriptPubKey", o);
|
||||
|
||||
// Add spent information if spentindex is enabled
|
||||
if (ptxSpentInfo != nullptr) {
|
||||
CSpentIndexKey spentKey(txid, i);
|
||||
auto it = ptxSpentInfo->mSpentInfo.find(spentKey);
|
||||
if (it != ptxSpentInfo->mSpentInfo.end()) {
|
||||
auto spentInfo = it->second;
|
||||
out.push_back(Pair("spentTxId", spentInfo.txid.GetHex()));
|
||||
out.push_back(Pair("spentIndex", (int)spentInfo.inputIndex));
|
||||
out.push_back(Pair("spentHeight", spentInfo.blockHeight));
|
||||
}
|
||||
}
|
||||
vout.push_back(out);
|
||||
}
|
||||
entry.pushKV("vout", vout);
|
||||
|
||||
if (!tx.vExtraPayload.empty()) {
|
||||
entry.push_back(Pair("extraPayloadSize", (int)tx.vExtraPayload.size()));
|
||||
entry.push_back(Pair("extraPayload", HexStr(tx.vExtraPayload)));
|
||||
}
|
||||
|
||||
if (tx.nType == TRANSACTION_PROVIDER_REGISTER) {
|
||||
CProRegTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proRegTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
|
||||
CProUpServTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpServTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
|
||||
CProUpRegTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpRegTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REVOKE) {
|
||||
CProUpRevTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpRevTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_COINBASE) {
|
||||
CCbTx cbTx;
|
||||
if (GetTxPayload(tx, cbTx)) {
|
||||
UniValue obj;
|
||||
cbTx.ToJson(obj);
|
||||
entry.push_back(Pair("cbTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_QUORUM_COMMITMENT) {
|
||||
llmq::CFinalCommitmentTxPayload qcTx;
|
||||
if (GetTxPayload(tx, qcTx)) {
|
||||
UniValue obj;
|
||||
qcTx.ToJson(obj);
|
||||
entry.push_back(Pair("qcTx", obj));
|
||||
}
|
||||
}
|
||||
|
||||
if (!hashBlock.IsNull())
|
||||
entry.pushKV("blockhash", hashBlock.GetHex());
|
||||
|
||||
|
@ -236,15 +236,3 @@ std::string CCbTx::ToString() const
|
||||
return strprintf("CCbTx(nHeight=%d, nVersion=%d, merkleRootMNList=%s, merkleRootQuorums=%s)",
|
||||
nVersion, nHeight, merkleRootMNList.ToString(), merkleRootQuorums.ToString());
|
||||
}
|
||||
|
||||
void CCbTx::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("height", (int)nHeight));
|
||||
obj.push_back(Pair("merkleRootMNList", merkleRootMNList.ToString()));
|
||||
if (nVersion >= 2) {
|
||||
obj.push_back(Pair("merkleRootQuorums", merkleRootQuorums.ToString()));
|
||||
}
|
||||
}
|
||||
|
@ -7,10 +7,10 @@
|
||||
|
||||
#include "consensus/validation.h"
|
||||
#include "primitives/transaction.h"
|
||||
#include "univalue.h"
|
||||
|
||||
class CBlock;
|
||||
class CBlockIndex;
|
||||
class UniValue;
|
||||
|
||||
// coinbase transaction
|
||||
class CCbTx
|
||||
@ -40,7 +40,18 @@ public:
|
||||
}
|
||||
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("height", (int)nHeight));
|
||||
obj.push_back(Pair("merkleRootMNList", merkleRootMNList.ToString()));
|
||||
if (nVersion >= 2) {
|
||||
obj.push_back(Pair("merkleRootQuorums", merkleRootQuorums.ToString()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool CheckCbTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state);
|
||||
|
@ -421,28 +421,6 @@ std::string CProRegTx::ToString() const
|
||||
nVersion, collateralOutpoint.ToStringShort(), addr.ToString(), (double)nOperatorReward / 100, CBitcoinAddress(keyIDOwner).ToString(), pubKeyOperator.ToString(), CBitcoinAddress(keyIDVoting).ToString(), payee);
|
||||
}
|
||||
|
||||
void CProRegTx::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("collateralHash", collateralOutpoint.hash.ToString()));
|
||||
obj.push_back(Pair("collateralIndex", (int)collateralOutpoint.n));
|
||||
obj.push_back(Pair("service", addr.ToString(false)));
|
||||
obj.push_back(Pair("ownerAddress", CBitcoinAddress(keyIDOwner).ToString()));
|
||||
obj.push_back(Pair("votingAddress", CBitcoinAddress(keyIDVoting).ToString()));
|
||||
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("payoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("pubKeyOperator", pubKeyOperator.ToString()));
|
||||
obj.push_back(Pair("operatorReward", (double)nOperatorReward / 100));
|
||||
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
|
||||
std::string CProUpServTx::ToString() const
|
||||
{
|
||||
CTxDestination dest;
|
||||
@ -455,21 +433,6 @@ std::string CProUpServTx::ToString() const
|
||||
nVersion, proTxHash.ToString(), addr.ToString(), payee);
|
||||
}
|
||||
|
||||
void CProUpServTx::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("service", addr.ToString(false)));
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptOperatorPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("operatorPayoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
|
||||
std::string CProUpRegTx::ToString() const
|
||||
{
|
||||
CTxDestination dest;
|
||||
@ -482,34 +445,8 @@ std::string CProUpRegTx::ToString() const
|
||||
nVersion, proTxHash.ToString(), pubKeyOperator.ToString(), CBitcoinAddress(keyIDVoting).ToString(), payee);
|
||||
}
|
||||
|
||||
void CProUpRegTx::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("votingAddress", CBitcoinAddress(keyIDVoting).ToString()));
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("payoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("pubKeyOperator", pubKeyOperator.ToString()));
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
|
||||
std::string CProUpRevTx::ToString() const
|
||||
{
|
||||
return strprintf("CProUpRevTx(nVersion=%d, proTxHash=%s, nReason=%d)",
|
||||
nVersion, proTxHash.ToString(), nReason);
|
||||
}
|
||||
|
||||
void CProUpRevTx::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("reason", (int)nReason));
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
|
@ -9,11 +9,12 @@
|
||||
#include "consensus/validation.h"
|
||||
#include "primitives/transaction.h"
|
||||
|
||||
#include "base58.h"
|
||||
#include "netaddress.h"
|
||||
#include "pubkey.h"
|
||||
#include "univalue.h"
|
||||
|
||||
class CBlockIndex;
|
||||
class UniValue;
|
||||
|
||||
class CProRegTx
|
||||
{
|
||||
@ -61,7 +62,28 @@ public:
|
||||
std::string MakeSignString() const;
|
||||
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("collateralHash", collateralOutpoint.hash.ToString()));
|
||||
obj.push_back(Pair("collateralIndex", (int)collateralOutpoint.n));
|
||||
obj.push_back(Pair("service", addr.ToString(false)));
|
||||
obj.push_back(Pair("ownerAddress", CBitcoinAddress(keyIDOwner).ToString()));
|
||||
obj.push_back(Pair("votingAddress", CBitcoinAddress(keyIDVoting).ToString()));
|
||||
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("payoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("pubKeyOperator", pubKeyOperator.ToString()));
|
||||
obj.push_back(Pair("operatorReward", (double)nOperatorReward / 100));
|
||||
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
};
|
||||
|
||||
class CProUpServTx
|
||||
@ -95,7 +117,21 @@ public:
|
||||
|
||||
public:
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("service", addr.ToString(false)));
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptOperatorPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("operatorPayoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
};
|
||||
|
||||
class CProUpRegTx
|
||||
@ -133,7 +169,22 @@ public:
|
||||
|
||||
public:
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("votingAddress", CBitcoinAddress(keyIDVoting).ToString()));
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(scriptPayout, dest)) {
|
||||
CBitcoinAddress bitcoinAddress(dest);
|
||||
obj.push_back(Pair("payoutAddress", bitcoinAddress.ToString()));
|
||||
}
|
||||
obj.push_back(Pair("pubKeyOperator", pubKeyOperator.ToString()));
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
};
|
||||
|
||||
class CProUpRevTx
|
||||
@ -174,7 +225,16 @@ public:
|
||||
|
||||
public:
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.clear();
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", nVersion));
|
||||
obj.push_back(Pair("proTxHash", proTxHash.ToString()));
|
||||
obj.push_back(Pair("reason", (int)nReason));
|
||||
obj.push_back(Pair("inputsHash", inputsHash.ToString()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#include "evo/specialtx.h"
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
namespace llmq
|
||||
{
|
||||
|
||||
@ -133,28 +131,6 @@ bool CFinalCommitment::VerifySizes(const Consensus::LLMQParams& params) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void CFinalCommitment::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("llmqType", (int)llmqType));
|
||||
obj.push_back(Pair("quorumHash", quorumHash.ToString()));
|
||||
obj.push_back(Pair("signersCount", CountSigners()));
|
||||
obj.push_back(Pair("validMembersCount", CountValidMembers()));
|
||||
obj.push_back(Pair("quorumPublicKey", quorumPublicKey.ToString()));
|
||||
}
|
||||
|
||||
void CFinalCommitmentTxPayload::ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("height", (int)nHeight));
|
||||
|
||||
UniValue qcObj;
|
||||
commitment.ToJson(qcObj);
|
||||
obj.push_back(Pair("commitment", qcObj));
|
||||
}
|
||||
|
||||
bool CheckLLMQCommitment(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state)
|
||||
{
|
||||
CFinalCommitmentTxPayload qcTx;
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
#include "bls/bls.h"
|
||||
|
||||
#include "univalue.h"
|
||||
|
||||
namespace llmq
|
||||
{
|
||||
|
||||
@ -52,8 +54,6 @@ public:
|
||||
bool VerifyNull() const;
|
||||
bool VerifySizes(const Consensus::LLMQParams& params) const;
|
||||
|
||||
void ToJson(UniValue& obj) const;
|
||||
|
||||
public:
|
||||
ADD_SERIALIZE_METHODS
|
||||
|
||||
@ -86,6 +86,17 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("llmqType", (int)llmqType));
|
||||
obj.push_back(Pair("quorumHash", quorumHash.ToString()));
|
||||
obj.push_back(Pair("signersCount", CountSigners()));
|
||||
obj.push_back(Pair("validMembersCount", CountValidMembers()));
|
||||
obj.push_back(Pair("quorumPublicKey", quorumPublicKey.ToString()));
|
||||
}
|
||||
};
|
||||
|
||||
class CFinalCommitmentTxPayload
|
||||
@ -109,7 +120,16 @@ public:
|
||||
READWRITE(commitment);
|
||||
}
|
||||
|
||||
void ToJson(UniValue& obj) const;
|
||||
void ToJson(UniValue& obj) const
|
||||
{
|
||||
obj.setObject();
|
||||
obj.push_back(Pair("version", (int)nVersion));
|
||||
obj.push_back(Pair("height", (int)nHeight));
|
||||
|
||||
UniValue qcObj;
|
||||
commitment.ToJson(qcObj);
|
||||
obj.push_back(Pair("commitment", qcObj));
|
||||
}
|
||||
};
|
||||
|
||||
bool CheckLLMQCommitment(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state);
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "chain.h"
|
||||
#include "chainparams.h"
|
||||
#include "core_io.h"
|
||||
#include "primitives/block.h"
|
||||
#include "primitives/transaction.h"
|
||||
#include "validation.h"
|
||||
@ -59,10 +60,6 @@ struct CCoin {
|
||||
}
|
||||
};
|
||||
|
||||
/* Defined in rawtransaction.cpp */
|
||||
void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
|
||||
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
|
||||
|
||||
static bool RESTERR(HTTPRequest* req, enum HTTPStatusCode status, std::string message)
|
||||
{
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
@ -386,7 +383,7 @@ static bool rest_tx(HTTPRequest* req, const std::string& strURIPart)
|
||||
|
||||
case RF_JSON: {
|
||||
UniValue objTx(UniValue::VOBJ);
|
||||
TxToJSON(*tx, hashBlock, objTx);
|
||||
TxToUniv(*tx, hashBlock, objTx);
|
||||
std::string strJSON = objTx.write() + "\n";
|
||||
req->WriteHeader("Content-Type", "application/json");
|
||||
req->WriteReply(HTTP_OK, strJSON);
|
||||
@ -568,7 +565,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
|
||||
|
||||
// include the script in a json output
|
||||
UniValue o(UniValue::VOBJ);
|
||||
ScriptPubKeyToJSON(coin.out.scriptPubKey, o, true);
|
||||
ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);
|
||||
utxo.push_back(Pair("scriptPubKey", o));
|
||||
utxos.push_back(utxo);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "consensus/validation.h"
|
||||
#include "instantsend.h"
|
||||
#include "validation.h"
|
||||
#include "core_io.h"
|
||||
#include "policy/policy.h"
|
||||
#include "primitives/transaction.h"
|
||||
#include "rpc/server.h"
|
||||
@ -134,7 +135,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
|
||||
if(txDetails)
|
||||
{
|
||||
UniValue objTx(UniValue::VOBJ);
|
||||
TxToJSON(*tx, uint256(), objTx);
|
||||
TxToUniv(*tx, uint256(), objTx);
|
||||
txs.push_back(objTx);
|
||||
}
|
||||
else
|
||||
@ -1235,7 +1236,7 @@ UniValue gettxout(const JSONRPCRequest& request)
|
||||
}
|
||||
ret.push_back(Pair("value", ValueFromAmount(coin.out.nValue)));
|
||||
UniValue o(UniValue::VOBJ);
|
||||
ScriptPubKeyToJSON(coin.out.scriptPubKey, o, true);
|
||||
ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);
|
||||
ret.push_back(Pair("scriptPubKey", o));
|
||||
ret.push_back(Pair("coinbase", (bool)coin.fCoinBase));
|
||||
|
||||
|
@ -44,142 +44,38 @@
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex)
|
||||
{
|
||||
txnouttype type;
|
||||
std::vector<CTxDestination> addresses;
|
||||
int nRequired;
|
||||
|
||||
out.push_back(Pair("asm", ScriptToAsmStr(scriptPubKey)));
|
||||
if (fIncludeHex)
|
||||
out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
|
||||
|
||||
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {
|
||||
out.push_back(Pair("type", GetTxnOutputType(type)));
|
||||
return;
|
||||
}
|
||||
|
||||
out.push_back(Pair("reqSigs", nRequired));
|
||||
out.push_back(Pair("type", GetTxnOutputType(type)));
|
||||
|
||||
UniValue a(UniValue::VARR);
|
||||
BOOST_FOREACH(const CTxDestination& addr, addresses)
|
||||
a.push_back(CBitcoinAddress(addr).ToString());
|
||||
out.push_back(Pair("addresses", a));
|
||||
}
|
||||
|
||||
void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
||||
{
|
||||
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("type", tx.nType));
|
||||
entry.push_back(Pair("locktime", (int64_t)tx.nLockTime));
|
||||
UniValue vin(UniValue::VARR);
|
||||
BOOST_FOREACH(const CTxIn& txin, tx.vin) {
|
||||
UniValue in(UniValue::VOBJ);
|
||||
if (tx.IsCoinBase())
|
||||
in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
|
||||
else {
|
||||
in.push_back(Pair("txid", txin.prevout.hash.GetHex()));
|
||||
in.push_back(Pair("vout", (int64_t)txin.prevout.n));
|
||||
UniValue o(UniValue::VOBJ);
|
||||
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));
|
||||
// Call into TxToUniv() in bitcoin-common to decode the transaction hex.
|
||||
//
|
||||
// Blockchain contextual information (confirmations and blocktime) is not
|
||||
// available to code in bitcoin-common, so we query them here and push the
|
||||
// data into the returned UniValue.
|
||||
|
||||
// Add address and value info if spentindex enabled
|
||||
uint256 txid = tx.GetHash();
|
||||
|
||||
// Add spent information if spentindex is enabled
|
||||
CSpentIndexTxInfo txSpentInfo;
|
||||
for (const auto& txin : tx.vin) {
|
||||
if (!tx.IsCoinBase()) {
|
||||
CSpentIndexValue spentInfo;
|
||||
CSpentIndexKey spentKey(txin.prevout.hash, txin.prevout.n);
|
||||
if (GetSpentIndex(spentKey, spentInfo)) {
|
||||
in.push_back(Pair("value", ValueFromAmount(spentInfo.satoshis)));
|
||||
in.push_back(Pair("valueSat", spentInfo.satoshis));
|
||||
if (spentInfo.addressType == 1) {
|
||||
in.push_back(Pair("address", CBitcoinAddress(CKeyID(spentInfo.addressHash)).ToString()));
|
||||
} else if (spentInfo.addressType == 2) {
|
||||
in.push_back(Pair("address", CBitcoinAddress(CScriptID(spentInfo.addressHash)).ToString()));
|
||||
}
|
||||
txSpentInfo.mSpentInfo.emplace(spentKey, spentInfo);
|
||||
}
|
||||
|
||||
}
|
||||
in.push_back(Pair("sequence", (int64_t)txin.nSequence));
|
||||
vin.push_back(in);
|
||||
}
|
||||
entry.push_back(Pair("vin", vin));
|
||||
UniValue vout(UniValue::VARR);
|
||||
for (unsigned int i = 0; i < tx.vout.size(); i++) {
|
||||
const CTxOut& txout = tx.vout[i];
|
||||
UniValue out(UniValue::VOBJ);
|
||||
out.push_back(Pair("value", ValueFromAmount(txout.nValue)));
|
||||
out.push_back(Pair("valueSat", txout.nValue));
|
||||
out.push_back(Pair("n", (int64_t)i));
|
||||
UniValue o(UniValue::VOBJ);
|
||||
ScriptPubKeyToJSON(txout.scriptPubKey, o, true);
|
||||
out.push_back(Pair("scriptPubKey", o));
|
||||
|
||||
// Add spent information if spentindex is enabled
|
||||
CSpentIndexValue spentInfo;
|
||||
CSpentIndexKey spentKey(txid, i);
|
||||
if (GetSpentIndex(spentKey, spentInfo)) {
|
||||
out.push_back(Pair("spentTxId", spentInfo.txid.GetHex()));
|
||||
out.push_back(Pair("spentIndex", (int)spentInfo.inputIndex));
|
||||
out.push_back(Pair("spentHeight", spentInfo.blockHeight));
|
||||
}
|
||||
|
||||
vout.push_back(out);
|
||||
}
|
||||
entry.push_back(Pair("vout", vout));
|
||||
|
||||
if (!tx.vExtraPayload.empty()) {
|
||||
entry.push_back(Pair("extraPayloadSize", (int)tx.vExtraPayload.size()));
|
||||
entry.push_back(Pair("extraPayload", HexStr(tx.vExtraPayload)));
|
||||
}
|
||||
|
||||
if (tx.nType == TRANSACTION_PROVIDER_REGISTER) {
|
||||
CProRegTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proRegTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
|
||||
CProUpServTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpServTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
|
||||
CProUpRegTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpRegTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REVOKE) {
|
||||
CProUpRevTx proTx;
|
||||
if (GetTxPayload(tx, proTx)) {
|
||||
UniValue obj;
|
||||
proTx.ToJson(obj);
|
||||
entry.push_back(Pair("proUpRevTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_COINBASE) {
|
||||
CCbTx cbTx;
|
||||
if (GetTxPayload(tx, cbTx)) {
|
||||
UniValue obj;
|
||||
cbTx.ToJson(obj);
|
||||
entry.push_back(Pair("cbTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_QUORUM_COMMITMENT) {
|
||||
llmq::CFinalCommitmentTxPayload qcTx;
|
||||
if (GetTxPayload(tx, qcTx)) {
|
||||
UniValue obj;
|
||||
qcTx.ToJson(obj);
|
||||
entry.push_back(Pair("qcTx", obj));
|
||||
txSpentInfo.mSpentInfo.emplace(spentKey, spentInfo);
|
||||
}
|
||||
}
|
||||
|
||||
TxToUniv(tx, uint256(), entry, &txSpentInfo);
|
||||
|
||||
bool chainLock = false;
|
||||
if (!hashBlock.IsNull()) {
|
||||
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
|
||||
@ -199,6 +95,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool fLocked = instantsend.IsLockedInstantSendTransaction(txid);
|
||||
bool fLLMQLocked = llmq::quorumInstantSendManager->IsLocked(txid);
|
||||
entry.push_back(Pair("instantlock", fLocked || fLLMQLocked || chainLock));
|
||||
@ -621,7 +518,7 @@ UniValue decoderawtransaction(const JSONRPCRequest& request)
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
TxToJSON(CTransaction(std::move(mtx)), uint256(), result);
|
||||
TxToUniv(CTransaction(std::move(mtx)), uint256(), result);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -661,7 +558,7 @@ UniValue decodescript(const JSONRPCRequest& request)
|
||||
} else {
|
||||
// Empty scripts are valid
|
||||
}
|
||||
ScriptPubKeyToJSON(script, r, false);
|
||||
ScriptPubKeyToUniv(script, r, false);
|
||||
|
||||
UniValue type;
|
||||
|
||||
|
@ -96,6 +96,11 @@ struct CSpentIndexKeyCompare
|
||||
}
|
||||
};
|
||||
|
||||
struct CSpentIndexTxInfo
|
||||
{
|
||||
std::map<CSpentIndexKey, CSpentIndexValue, CSpentIndexKeyCompare> mSpentInfo;
|
||||
};
|
||||
|
||||
struct CTimestampIndexIteratorKey {
|
||||
unsigned int timestamp;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "d21633ba23f70118185227be58a63527675641ad37967e2aa461559f577aec43",
|
||||
"version": 1,
|
||||
"size": 10,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "4ebd325a4b394cff8c57e8317ccf5a8d0e2bdf1b8526f8aad6c8e43d8240621a",
|
||||
"version": 2,
|
||||
"size": 10,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "81b2035be1da1abe745c6141174a73d151009ec17b3d5ebffa2e177408c50dfd",
|
||||
"version": 1,
|
||||
"size": 3040,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -187,6 +188,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.3782,
|
||||
"valueSat": 137820000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
@ -200,6 +202,7 @@
|
||||
},
|
||||
{
|
||||
"value": 0.01000001,
|
||||
"valueSat": 1000001,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 6c772e9cf96371bba3da8cb733da70a2fcf20078 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "c46ccd75b5050e942b2e86a3648f843f525fe6fc000bf0534ba5973063354493",
|
||||
"version": 1,
|
||||
"size": 3155,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -196,6 +197,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.3782,
|
||||
"valueSat": 137820000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "aded538f642c17e15f4d3306b8be7e1a4d1ae0c4616d641ab51ea09ba65e5cb5",
|
||||
"version": 1,
|
||||
"size": 3189,
|
||||
"locktime": 317000,
|
||||
"vin": [
|
||||
{
|
||||
@ -196,6 +197,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.3782,
|
||||
"valueSat": 137820000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
@ -209,6 +211,7 @@
|
||||
},
|
||||
{
|
||||
"value": 0.01000001,
|
||||
"valueSat": 1000001,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 6c772e9cf96371bba3da8cb733da70a2fcf20078 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "fe7d174f42dce0cffa7a527e9bc8368956057619ec817648f6138b98f2533e8f",
|
||||
"version": 2,
|
||||
"size": 201,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -34,6 +35,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.18,
|
||||
"valueSat": 18000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
@ -47,6 +49,7 @@
|
||||
},
|
||||
{
|
||||
"value": 4.00,
|
||||
"valueSat": 400000000,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 f2d4db28cad6502226ee484ae24505c2885cb12d OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "0481afb29931341d0d7861d8a2f6f26456fa042abf54a23e96440ed7946e0715",
|
||||
"version": 2,
|
||||
"size": 19,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.00,
|
||||
"valueSat": 0,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "07894b4d12fe7853dd911402db1620920d261b9627c447f931417d330c25f06e",
|
||||
"version": 1,
|
||||
"size": 176,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -16,6 +17,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.18,
|
||||
"valueSat": 18000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
@ -29,6 +31,7 @@
|
||||
},
|
||||
{
|
||||
"value": 4.00,
|
||||
"valueSat": 400000000,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_RETURN 54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "c14b007fa3a6c1e7765919c1d14c1cfc2b8642c3a5d3be4b1fa8c4ccfec98bb0",
|
||||
"version": 2,
|
||||
"size": 176,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -16,6 +17,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.18,
|
||||
"valueSat": 18000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
@ -29,6 +31,7 @@
|
||||
},
|
||||
{
|
||||
"value": 0.00,
|
||||
"valueSat": 0,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_RETURN 54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "8df6ed527472542dd5e137c242a7c5a9f337ac34f7b257ae4af886aeaebb51b0",
|
||||
"version": 2,
|
||||
"size": 85,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -16,6 +17,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.18,
|
||||
"valueSat": 18000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "c4dea671b0d7b48f8ab10bc46650e8329d3c5766931f548f513847a19f5ba75b",
|
||||
"version": 1,
|
||||
"size": 126,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -25,6 +26,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.18,
|
||||
"valueSat": 18000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "0d1d4edfc217d9db3ab6a9298f26a52eae3c52f55a6cb8ccbc14f7c727572894",
|
||||
"version": 1,
|
||||
"size": 124,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.00,
|
||||
"valueSat": 100000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "2 02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d 02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485 3 OP_CHECKMULTISIG",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "0d861f278a3b7bce7cb5a88d71e6e6a903336f95ad5a2c29b295b63835b6eee3",
|
||||
"version": 1,
|
||||
"size": 42,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.00,
|
||||
"valueSat": 100000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_HASH160 1c6fbaf46d64221e80cbae182c33ddf81b9294ac OP_EQUAL",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "f42b38ac12e3fafc96ba1a9ba70cbfe326744aef75df5fb9db5d6e2855ca415f",
|
||||
"version": 1,
|
||||
"size": 54,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.00,
|
||||
"valueSat": 0,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "f0851b68202f736b792649cfc960259c2374badcb644ab20cac726b5f72f61c9",
|
||||
"version": 1,
|
||||
"size": 20,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.00,
|
||||
"valueSat": 0,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DROP",
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"txid": "6e07a7cc075e0703f32ee8c4e5373fe654bfbc315148fda364e1be286ff290d0",
|
||||
"version": 1,
|
||||
"size": 42,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.00,
|
||||
"valueSat": 0,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_HASH160 71ed53322d470bb96657deb786b94f97dd46fb15 OP_EQUAL",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"txid": "977e7cd286cb72cd470d539ba6cb48400f8f387d97451d45cdb8819437a303af",
|
||||
"version": 1,
|
||||
"size": 224,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
@ -16,6 +17,7 @@
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.001,
|
||||
"valueSat": 100000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 5834479edbbe0539b31ffd3a8f8ebadc2165ed01 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
|
Loading…
Reference in New Issue
Block a user