Exemple #1
0
    virtual void startTX(
        const uint8_t *p,
        const uint8_t *hash
    )
    {
        txStart = p;
        nbInputs = 0;
        nbOutputs = 0;
        dump = (txMap.end()!=txMap.find(hash));

        if(dump) {

            struct tm gmTime;
            time_t blockTime = bTime;
            gmtime_r(&blockTime, &gmTime);

            char timeBuf[256];
            asctime_r(&gmTime, timeBuf);

            size_t sz =strlen(timeBuf);
            if(0<sz) timeBuf[sz-1] = 0;

            LOAD(uint32_t, version, p);

            printf("TX = {\n\n");
            printf("    version = %" PRIu32 "\n", version);
            printf("    minted in block = %" PRIu64 "\n", currBlock-1);
            printf("    mint time = %" PRIu64 " (%s GMT)\n", bTime, timeBuf);
            printf("    txHash = ");
            showHex(hash);
            printf("\n\n");
        }
    }
Exemple #2
0
    virtual void endTX(
        const uint8_t *p
    )
    {
        auto i = srcTxMap.find(txHash);
        bool isSrcTX = (srcTxMap.end() != i);

        Number taint = 0;
             if(unlikely(isSrcTX))    taint = 1;
        else if(txTotal>0 && 0<txBad) taintMap[txHash] = taint = txBad/txTotal;

        if(threshold<taint) {
            printNumber(taint);
            showHex(txHash);
            putchar('\n');
        }
    }