MCPcopy Create free account
hub / github.com/DNAProject/DNA / Deserialization

Method Deserialization

p2pserver/message/types/block.go:48–63  ·  view source on GitHub ↗

Deserialize message payload

(source *common.ZeroCopySource)

Source from the content-addressed store, hash-verified

46
47//Deserialize message payload
48func (this *Block) Deserialization(source *common.ZeroCopySource) error {
49 this.Blk = new(types.Block)
50 err := this.Blk.Deserialization(source)
51 if err != nil {
52 return fmt.Errorf("read Blk error. err:%v", err)
53 }
54
55 eof := false
56 this.MerkleRoot, eof = source.NextHash()
57 if eof {
58 // to accept old node's block
59 this.MerkleRoot = common.UINT256_EMPTY
60 }
61
62 return nil
63}

Callers

nothing calls this directly

Calls 3

ErrorfMethod · 0.80
NextHashMethod · 0.80
DeserializationMethod · 0.65

Tested by

no test coverage detected