From 7696a6fc89b2063cf968a462c7b62fd58c51ed35 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Fri, 10 May 2019 11:24:04 +0200 Subject: [PATCH] Print inputs on which we voted and quorums used for signing (#2907) * Print inputs on which we voted Also print the corresponding requestId. This makes debugging InstantSend issues easier. * Print quorum hash when signing a share * Remove unused nodesByAddress map in CSigSharesManager::SendMessages Not related to this PR, but a simple cleanup that should have no side effects. --- src/llmq/quorums_instantsend.cpp | 9 +++++++-- src/llmq/quorums_signing_shares.cpp | 9 ++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/llmq/quorums_instantsend.cpp b/src/llmq/quorums_instantsend.cpp index fe81cd324..a2c3e7405 100644 --- a/src/llmq/quorums_instantsend.cpp +++ b/src/llmq/quorums_instantsend.cpp @@ -425,9 +425,14 @@ bool CInstantSendManager::ProcessTx(const CTransaction& tx, const Consensus::Par return true; } - for (auto& id : ids) { + for (size_t i = 0; i < tx.vin.size(); i++) { + auto& in = tx.vin[i]; + auto& id = ids[i]; inputRequestIds.emplace(id); - quorumSigningManager->AsyncSignIfMember(llmqType, id, tx.GetHash()); + if (quorumSigningManager->AsyncSignIfMember(llmqType, id, tx.GetHash())) { + LogPrintf("CInstantSendManager::%s -- txid=%s: voted on input %s with id %s\n", __func__, + tx.GetHash().ToString(), in.prevout.ToStringShort(), id.ToString()); + } } // We might have received all input locks before we got the corresponding TX. In this case, we have to sign the diff --git a/src/llmq/quorums_signing_shares.cpp b/src/llmq/quorums_signing_shares.cpp index 2ab58707b..4e9103d5b 100644 --- a/src/llmq/quorums_signing_shares.cpp +++ b/src/llmq/quorums_signing_shares.cpp @@ -984,11 +984,6 @@ void CSigSharesManager::CollectSigSharesToAnnounce(std::unordered_map nodesByAddress; - g_connman->ForEachNode([&nodesByAddress](CNode* pnode) { - nodesByAddress.emplace(pnode->addr, pnode->id); - }); - std::unordered_map> sigSharesToRequest; std::unordered_map> sigSharesToSend; std::unordered_map> sigSharesToAnnounce; @@ -1436,8 +1431,8 @@ void CSigSharesManager::Sign(const CQuorumCPtr& quorum, const uint256& id, const sigShare.UpdateKey(); - LogPrint("llmq-sigs", "CSigSharesManager::%s -- signed sigShare. signHash=%s, id=%s, msgHash=%s, time=%s\n", __func__, - signHash.ToString(), sigShare.id.ToString(), sigShare.msgHash.ToString(), t.count()); + LogPrint("llmq-sigs", "CSigSharesManager::%s -- signed sigShare. signHash=%s, id=%s, msgHash=%s, llmqType=%d, quorum=%s, time=%s\n", __func__, + signHash.ToString(), sigShare.id.ToString(), sigShare.msgHash.ToString(), quorum->params.type, quorum->qc.quorumHash.ToString(), t.count()); ProcessSigShare(-1, sigShare, *g_connman, quorum); }