diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-17 20:09:22 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-17 20:09:22 +0800 |
commit | ff55c6f5badda7ef11c38ef5d94b71420b14817c (patch) | |
tree | 02c5fa61766a61224e8c33deed0c772b7e49e12b /common | |
parent | b0ebccb31e944e7cb7fabbbecf279a5507e513ab (diff) | |
parent | 9663493ba0d493ec62153e725b5d30340f2aa525 (diff) | |
download | dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.gz dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.bz2 dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.lz dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.xz dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.zst dexon-ff55c6f5badda7ef11c38ef5d94b71420b14817c.zip |
Merge branch 'develop' into conversion
Conflicts:
common/types.go
Diffstat (limited to 'common')
-rw-r--r-- | common/types.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/common/types.go b/common/types.go index 9729378e8..da46db874 100644 --- a/common/types.go +++ b/common/types.go @@ -12,11 +12,6 @@ type ( Address [addressLength]byte ) -var ( - zeroHash Hash - zeroAddress Address -) - func BytesToHash(b []byte) Hash { var h Hash h.SetBytes(b) @@ -41,7 +36,7 @@ func (h *Hash) SetBytes(b []byte) { // reverse loop for i := len(b) - 1; i >= 0; i-- { - h[i] = b[i] + h[hashLength-len(b)+i] = b[i] } } @@ -79,7 +74,7 @@ func (a *Address) SetBytes(b []byte) { // reverse loop for i := len(b) - 1; i >= 0; i-- { - a[i] = b[i] + a[addressLength-len(b)+i] = b[i] } } |