Giter Club home page Giter Club logo

Comments (6)

hkalodner avatar hkalodner commented on June 1, 2024

Hmm. Interesting. I'm not exactly sure what's going wrong here, but I'll see if I can recreate the problem on my end. The internal data field has MAX_INT stored in it if the script has never been spent. When calling script.revealed_tx, it should return None if it stores MAX_INT or a transaction otherwise.

I'll describe how this works in two parts.

  1. Parser: This is where all the data is generated. The main class that handles this is AddressWriter(https://github.com/citp/BlockSci/blob/master/src/parser/address_writer.hpp).

The function,

template<blocksci::AddressType::Enum type>
size_t serialize(const ScriptOutput<type> &output, uint32_t txNum)

is called on each output on the blockchain. For each new output it serialized a chunk of script data described in https://github.com/citp/BlockSci/blob/master/src/blocksci/scripts/script_data.hpp. The txFirstSpent field is initialized to std::numeric_limits<uint32_t>::max().

The function

template<blocksci::AddressType::Enum type>
void serialize(const ScriptInput<type> &input, uint32_t txNum, uint32_t outputTxNum)

is called on each input. On this first usage of that input, it should update the txFirstSpent to be the index of the tx which includes that input.

  1. Analysis Library
    https://github.com/citp/BlockSci/blob/master/src/blocksci/scripts/script.cpp contains the implementation of the getTransactionRevealed function which is called by script.revealed_tx. It checks to see whether the script has been spent. If it hasn't been spent it should return None and otherwise should return the Transaction so this should never produce.

The python library is just a thin wrapped over this so it should have the same behavior.

from blocksci.

hkalodner avatar hkalodner commented on June 1, 2024

I've done a bunch of testing an I haven't been able to recreate this issue on my end including rerunning your original query from the previous issue. I think there's a reasonable chance that this issue is gone in the current (updated) version.

from blocksci.

crypto-perry avatar crypto-perry commented on June 1, 2024

Hmm that must be it. I am using the AMI that u provide so maybe that is not updated to reflect the change.

from blocksci.

hkalodner avatar hkalodner commented on June 1, 2024

We just a released a new version of the AMI this morning running the latest version where everything should be working.

from blocksci.

crypto-perry avatar crypto-perry commented on June 1, 2024

Thanks for this. Also brilliant product and very good features! :)

from blocksci.

hkalodner avatar hkalodner commented on June 1, 2024

I'm glad people are finding it useful!

from blocksci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.