diff --git a/src/cpp/ripple/ripple_Peer.cpp b/src/cpp/ripple/ripple_Peer.cpp index 650d3435f..850de7b28 100644 --- a/src/cpp/ripple/ripple_Peer.cpp +++ b/src/cpp/ripple/ripple_Peer.cpp @@ -983,7 +983,9 @@ static void checkTransaction(Job&, int flags, SerializedTransaction::pointer stx #endif Transaction::pointer tx; - if ((flags & SF_SIGGOOD) != 0) + if (isSetBit(flags, SF_SIGGOOD)) + tx = boost::make_shared(stx, false); + else { tx = boost::make_shared(stx, true); if (tx->getStatus() == INVALID) @@ -995,10 +997,8 @@ static void checkTransaction(Job&, int flags, SerializedTransaction::pointer stx else theApp->getHashRouter().setFlag(stx->getTransactionID(), SF_SIGGOOD); } - else - tx = boost::make_shared(stx, false); - theApp->getOPs().processTransaction(tx, (flags & SF_TRUSTED) != 0); + theApp->getOPs().processTransaction(tx, isSetBit(flags, SF_TRUSTED)); #ifndef TRUST_NETWORK } @@ -1025,13 +1025,13 @@ void PeerImp::recvTransaction(ripple::TMTransaction& packet, ScopedLock& MasterL int flags; if (! theApp->getHashRouter ().addSuppressionPeer (stx->getTransactionID(), mPeerId, flags)) { // we have seen this transaction recently - if ((flags & SF_BAD) != 0) + if (isSetBit(flags, SF_BAD)) { punishPeer(LT_InvalidSignature); return; } - if ((flags & SF_RETRY) == 0) + if (!isSetBit(flags, SF_RETRY)) return; } WriteLog (lsDEBUG, Peer) << "Got new transaction from peer";