Skip to content

Commit

Permalink
Print inputs on which we voted and quorums used for signing (#2907)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
codablock committed May 10, 2019
1 parent a173e68 commit 7696a6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 7 additions & 2 deletions src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions src/llmq/quorums_signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,11 +984,6 @@ void CSigSharesManager::CollectSigSharesToAnnounce(std::unordered_map<NodeId, st

bool CSigSharesManager::SendMessages()
{
std::multimap<CService, NodeId> nodesByAddress;
g_connman->ForEachNode([&nodesByAddress](CNode* pnode) {
nodesByAddress.emplace(pnode->addr, pnode->id);
});

std::unordered_map<NodeId, std::unordered_map<uint256, CSigSharesInv, StaticSaltedHasher>> sigSharesToRequest;
std::unordered_map<NodeId, std::unordered_map<uint256, CBatchedSigShares, StaticSaltedHasher>> sigSharesToSend;
std::unordered_map<NodeId, std::unordered_map<uint256, CSigSharesInv, StaticSaltedHasher>> sigSharesToAnnounce;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 7696a6f

Please sign in to comment.