Skip to content

Commit

Permalink
Slightly refactor ProcessInstantSendLock (#2767)
Browse files Browse the repository at this point in the history
Rewrite `if (var =  func())` in a less confusing way
  • Loading branch information
UdjinM6 committed Mar 13, 2019
1 parent 3a1aeb0 commit 6350adf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,14 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has
if (db.GetInstantSendLockByHash(hash)) {
return;
}
if (otherIsLock = db.GetInstantSendLockByTxid(islock.txid)) {
otherIsLock = db.GetInstantSendLockByTxid(islock.txid);
if (otherIsLock != nullptr) {
LogPrint("instantsend", "CInstantSendManager::%s -- txid=%s, islock=%s: duplicate islock, other islock=%s, peer=%d\n", __func__,
islock.txid.ToString(), hash.ToString(), ::SerializeHash(*otherIsLock).ToString(), from);
}
for (auto& in : islock.inputs) {
if (otherIsLock = db.GetInstantSendLockByInput(in)) {
otherIsLock = db.GetInstantSendLockByInput(in);
if (otherIsLock != nullptr) {
LogPrint("instantsend", "CInstantSendManager::%s -- txid=%s, islock=%s: conflicting input in islock. input=%s, other islock=%s, peer=%d\n", __func__,
islock.txid.ToString(), hash.ToString(), in.ToStringShort(), ::SerializeHash(*otherIsLock).ToString(), from);
}
Expand Down

0 comments on commit 6350adf

Please sign in to comment.