Skip to content

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Feb 14, 2018

This is not simply a refactoring, because it touches serialization (including the one on p2p level). Still, changes should be fully backwards compatible.

@UdjinM6 UdjinM6 added this to the 12.3 milestone Feb 14, 2018
@UdjinM6 UdjinM6 changed the title Switch masternode id in Dash data structures from CTxIn to COutpoint Switch masternode id in Dash data structures from CTxIn to COutPoint Feb 14, 2018
| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | ---------- |
| 41 | vin | [CTxIn](#ctxin) | The unspent output which is holding 1000 DASH
| 36 | outpoint | [COutPoint](#coutpoint) | The unspent output which is holding 1000 DASH
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Field name is masternodeOutpoint in most other messages

Copy link
Author

@UdjinM6 UdjinM6 Feb 14, 2018

Choose a reason for hiding this comment

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

Yep, the corresponding class is a child of CMasternode which is a child of masternode_info_t and this field is defined there. Having masternodeOutpoint instead of simply outpoint might look a bit excessive (especially later in code when this field is used) that's why it was vin and not vinMasternode historically. But I'm open to changing it now and unifying the name across all classes/messages :) Let's see what @codablock thinks though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yep. I see what you mean. 👍

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I'll merge it as is now then. We can always fix it later if we change our minds :)

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | ---------- |
| 41 | vin | [CTxIn](#ctxin) | The unspent output which is holding 1000 DASH
| 36 | outpoint | [COutPoint](#coutpoint) | The unspent output which is holding 1000 DASH
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Field name is masternodeOutpoint in most other messages

Copy link
Author

@UdjinM6 UdjinM6 Feb 14, 2018

Choose a reason for hiding this comment

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

Yep, this one is used only temporary in actual code and can be changed to masternodeOutpoint with no consequences to readability, I agree.

Copy link

@nmarley nmarley left a comment

Choose a reason for hiding this comment

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

utACK

{
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vinMasternode;
ss << masternodeOutpoint << uint8_t{} << 0xffffffff;

Choose a reason for hiding this comment

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

Any chance to get rid of this? Or at least add a comment about why it is there (I understand why it's there but only because of the PRs context).

Copy link
Author

Choose a reason for hiding this comment

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

Can't easily get rid of it because this would break the hash and we have to keep votes for a long time. Could have an additional comment mentioning that we write these dummy values for legacy reasons, agree. Will add comments like that in another (cleanup) PR later.

andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…ashpay#1933)

* Switch masternode id in Dash data structures from CTxIn to COutPoint (including p2p level)

* outpoint -> masternodeOutpoint in DSEG
@UdjinM6 UdjinM6 deleted the vintooutpoint branch November 26, 2020 13:29
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.

4 participants