mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON (#2510)
* Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON * Implement ToJson for CFinalCommitmentTxPayload and use it in TxToJSON Otherwise the nVersion and nHeight members of it are not shown.
This commit is contained in:
parent
5da4c97284
commit
5a3f64310b
@ -144,6 +144,17 @@ void CFinalCommitment::ToJson(UniValue& obj) const
|
||||
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;
|
||||
|
@ -108,6 +108,8 @@ public:
|
||||
READWRITE(nHeight);
|
||||
READWRITE(commitment);
|
||||
}
|
||||
|
||||
void ToJson(UniValue& obj) const;
|
||||
};
|
||||
|
||||
bool CheckLLMQCommitment(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state);
|
||||
|
@ -168,7 +168,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
||||
entry.push_back(Pair("cbTx", obj));
|
||||
}
|
||||
} else if (tx.nType == TRANSACTION_QUORUM_COMMITMENT) {
|
||||
llmq::CFinalCommitment qcTx;
|
||||
llmq::CFinalCommitmentTxPayload qcTx;
|
||||
if (GetTxPayload(tx, qcTx)) {
|
||||
UniValue obj;
|
||||
qcTx.ToJson(obj);
|
||||
|
Loading…
Reference in New Issue
Block a user