Skip to content

Conversation

@zhengq1
Copy link
Contributor

@zhengq1 zhengq1 commented Aug 7, 2017

Signed-off-by: zhengq1 ljqlyy@gmail.com

func (a *IssueAsset) Deserialize(r io.Reader, version byte) error {
var err error
a.Nonce, err = serialization.ReadUint64(r)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cannot judge to err, return err directly.

}

func (a *IssueAsset) Serialize(w io.Writer, version byte) error {
err := serialization.WriteUint64(w, a.Nonce)
Copy link
Contributor

Choose a reason for hiding this comment

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

Cannot judge to err, return err directly.

return serialization.WriteUint64(w, a.Nonce)

Signed-off-by: zhengq1 <ljqlyy@gmail.com>
@zhengq1
Copy link
Contributor Author

zhengq1 commented Aug 9, 2017

got it.

Copy link
Collaborator

@dreamfly281 dreamfly281 left a comment

Choose a reason for hiding this comment

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

There is already a nonce existed in the Transaction header, it looks duplicate to add another nonce field in the payload

@zhengq1
Copy link
Contributor Author

zhengq1 commented Aug 15, 2017

Nonce in transaction struct is reserved for balance model, if use UTXO model, transaction which need nonce can add it to payload.

@Arbio5zt
Copy link
Member

agree with zhengq1, this nonce is used to allow issuer to create multiple issue transaction with the just same value.

Honglei-Cong pushed a commit to Honglei-Cong/DNA that referenced this pull request Nov 27, 2019
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