Skip to content

initial commit of metadata on supports#312

Merged
BrannonKing merged 2 commits intomasterfrom
metadata_for_supports
Sep 13, 2019
Merged

initial commit of metadata on supports#312
BrannonKing merged 2 commits intomasterfrom
metadata_for_supports

Conversation

@BrannonKing
Copy link
Copy Markdown
Member

@BrannonKing BrannonKing commented Sep 4, 2019

The nonstandard transactions themselves should be okay in the current code; we just don't want a different hash or trie computation until the fork height.

Fixes #272

Comment thread src/nameclaim.cpp
return false;
}
auto last_drop = OP_DROP;
if (opcode >= 0 && opcode <= OP_PUSHDATA4 && op != OP_CLAIM_NAME)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not look correct or we miss OP_SUPPORT_CLAIM && !allowSupportMetadata it's same as OP_CLAIM_NAME ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch (op) {
    case OP_SUPPORT_CLAIM:
        if (allowSupportMetadata)
        // fallthrough
    case OP_UPDATE_CLAIM: {
        if (opcode < 0 || opcode > OP_PUSHDATA4)
            return false;
        if (!scriptIn.GetOp(pc, opcode))
            return false;
    } // fallthrough
    case OP_CLAIM_NAME:
        if (opcode != OP_2DROP)
           return false;
    break;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand your concern here. The logic is "if not a claim op and have another data chunk", that's fine -- that's what we want. That third data is required on the update op but not required on the support op.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was afraid on op == OP_SUPPORT_CLAIM and allowSupportMetadata == false we can enter in by the condition but opcode is OP_2DROP so it's OK.

@lbry-bot lbry-bot assigned lbrynaut and unassigned BrannonKing Sep 9, 2019
@BrannonKing BrannonKing merged commit f176db0 into master Sep 13, 2019
@BrannonKing BrannonKing deleted the metadata_for_supports branch September 13, 2019 22:18
@BrannonKing BrannonKing restored the metadata_for_supports branch September 14, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add optional metadata for supports

3 participants