Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8AC3DB2A for ; Mon, 8 May 2017 09:38:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.com (mout.gmx.com [74.208.4.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 26916E5 for ; Mon, 8 May 2017 09:38:17 +0000 (UTC) Received: from [213.1.222.238] by 3capp-mailcom-lxa09.server.lan (via HTTP); Mon, 8 May 2017 11:38:16 +0200 MIME-Version: 1.0 Message-ID: From: "DJ Bitcoin" To: bitcoin-dev@lists.linuxfoundation.org Content-Type: text/html; charset=UTF-8 Date: Mon, 8 May 2017 11:38:16 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:KrpcJzQyvtXnnMtS2KeADGsH7TyHRXNUt4r2f0ZICPl IkfiCJI/jFganG3aF6tBxvPhpszIsfyE9Wawpq9TkfPBG6Ew1b 1D71BG3IobYWJlTfrF3aYcjcJkhI/1Tbvth0W/n0KfhYvi0T0V 5oPof20TfGWWI7D5Qt7K1sQUamwxAPKcGVQVrevv5tq3LyHQij wRSM859LpbnNC+MlHRnqXG9UZ214t7+wuBBJR7l9ndFVd6Rs0A p8B62kKKD1fxID1ksjId8oJcUguu/lWjokB1eNvOVI7gGpgHDy kUBgoUIf4FCdd0QFRcVvGVOAOid X-UI-Out-Filterresults: notjunk:1;V01:K0:oPIB9rb/bsU=:kdCfZbFR0seZj7zvqBLj+3 QWsEf/eSeRSXqVgYwL2ctoqaX/ifM3vf20AlFfk4S6FMCsjfjeiJhwxVaQzRAUspSB5SCY0Mu ytSkfRKuF8ADraYGKG+hMhgNycGI68F/3UQikDe7+lP5DB93jHyeHcRZjdhgFaLwmmWd/QLos 7ao9MkSNrLDLqcJ+oghqO6JAGZLjJ6JrSagQkBMPax979bm5Zgv16G7gQsTmYezahb7NkX6qs D16kE7sDdYUetI9yp6hloW0eHD3EpBr6TrvanQddJy2hozhKjOj4amm+Ep7X10aoqItDGcue2 fDZvf4W5sFjur0YbPv/2GMo/T7fyL5vJmRmvXBZK6XBoD2t89Ft+QIYRTatyGtE4J5OWFKMdp Ot5f87X6gU7vaHebQ/HkhX4W1/WTy/a7EwAXaObf9L5Wnmr7azlL2Cx09nio3SFYCeV9luSpY 3RXYm0GImw== X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,MIME_HTML_ONLY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Mon, 08 May 2017 10:54:22 +0000 Subject: [bitcoin-dev] TXMempool and dirty entries X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 09:38:17 -0000
Hi Guys,
 
I have a question about the use of txmempool. find attached the code in txmempool.h
 
 
======================================================
/* Adding transactions from a disconnected block can be very time consuming,
 * because we don't have a way to limit the number of in-mempool descendants.
 * To bound CPU processing, we limit the amount of work we're willing to do
 * to properly update the descendant information for a tx being added from
 * a disconnected block.  If we would exceed the limit, then we instead mark
 * the entry as "dirty", and set the feerate for sorting purposes to be equal
 * the feerate of the transaction without any descendants. */

class CTxMemPoolEntry
{
   private:
   // ...    
   // Information about descendants of this transaction that are in the
   // mempool; if we remove this transaction we must remove all of these
   // descendants as well. if nCountWithDescendants is 0, treat this entry as
   // dirty, and nSizeWithDescendants and nModFeesWithDescendants will not be
   // correct.
   
   int64_t nCountWithDescendants; //!< number of descendant transactions
   // ...
======================================================
 
 
Now, the only place where nCountWithDescendants is modified is the following (txmempool.cpp):
 
 
======================================================
void CTxMemPoolEntry::UpdateDescendantState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount)
{
    nSizeWithDescendants += modifySize;
    assert(int64_t(nSizeWithDescendants) > 0);
    nModFeesWithDescendants += modifyFee;
    nCountWithDescendants += modifyCount;
    assert(int64_t(nCountWithDescendants) > 0);
}
======================================================
 
 
Therefore, nCountWithDescendants is never zero.
Am i missing something? Where is this concept of "dirty" defined?
 
Thanks a lot,
DJ