Skip to content

Commit 7696a6f

Browse files
authored
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.
1 parent a173e68 commit 7696a6f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/llmq/quorums_instantsend.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,14 @@ bool CInstantSendManager::ProcessTx(const CTransaction& tx, const Consensus::Par
425425
return true;
426426
}
427427

428-
for (auto& id : ids) {
428+
for (size_t i = 0; i < tx.vin.size(); i++) {
429+
auto& in = tx.vin[i];
430+
auto& id = ids[i];
429431
inputRequestIds.emplace(id);
430-
quorumSigningManager->AsyncSignIfMember(llmqType, id, tx.GetHash());
432+
if (quorumSigningManager->AsyncSignIfMember(llmqType, id, tx.GetHash())) {
433+
LogPrintf("CInstantSendManager::%s -- txid=%s: voted on input %s with id %s\n", __func__,
434+
tx.GetHash().ToString(), in.prevout.ToStringShort(), id.ToString());
435+
}
431436
}
432437

433438
// We might have received all input locks before we got the corresponding TX. In this case, we have to sign the

src/llmq/quorums_signing_shares.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -984,11 +984,6 @@ void CSigSharesManager::CollectSigSharesToAnnounce(std::unordered_map<NodeId, st
984984

985985
bool CSigSharesManager::SendMessages()
986986
{
987-
std::multimap<CService, NodeId> nodesByAddress;
988-
g_connman->ForEachNode([&nodesByAddress](CNode* pnode) {
989-
nodesByAddress.emplace(pnode->addr, pnode->id);
990-
});
991-
992987
std::unordered_map<NodeId, std::unordered_map<uint256, CSigSharesInv, StaticSaltedHasher>> sigSharesToRequest;
993988
std::unordered_map<NodeId, std::unordered_map<uint256, CBatchedSigShares, StaticSaltedHasher>> sigSharesToSend;
994989
std::unordered_map<NodeId, std::unordered_map<uint256, CSigSharesInv, StaticSaltedHasher>> sigSharesToAnnounce;
@@ -1436,8 +1431,8 @@ void CSigSharesManager::Sign(const CQuorumCPtr& quorum, const uint256& id, const
14361431

14371432
sigShare.UpdateKey();
14381433

1439-
LogPrint("llmq-sigs", "CSigSharesManager::%s -- signed sigShare. signHash=%s, id=%s, msgHash=%s, time=%s\n", __func__,
1440-
signHash.ToString(), sigShare.id.ToString(), sigShare.msgHash.ToString(), t.count());
1434+
LogPrint("llmq-sigs", "CSigSharesManager::%s -- signed sigShare. signHash=%s, id=%s, msgHash=%s, llmqType=%d, quorum=%s, time=%s\n", __func__,
1435+
signHash.ToString(), sigShare.id.ToString(), sigShare.msgHash.ToString(), quorum->params.type, quorum->qc.quorumHash.ToString(), t.count());
14411436
ProcessSigShare(-1, sigShare, *g_connman, quorum);
14421437
}
14431438

0 commit comments

Comments
 (0)