aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-01 18:01:26 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:55 +0800
commitbde4a6cc02c6806093d2a49a86463f81358ca3d8 (patch)
treebc3d617f8ff755f6cca5c4fc1dff7b5457845c9f /vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
parent3c0372165e723de9f1bd3ea8dacd579810463f6d (diff)
downloadgo-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar.gz
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar.bz2
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar.lz
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar.xz
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.tar.zst
go-tangerine-bde4a6cc02c6806093d2a49a86463f81358ca3d8.zip
vendor: sync to latest core (#320)
* vendor: sync to latest core * dex, core: fix conflict x
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
index e46b3e9c9..0e847900f 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
@@ -29,3 +29,13 @@ func GenerateRandomBytes() []byte {
}
return randomness
}
+
+// CopyBytes copies byte slice.
+func CopyBytes(src []byte) (dst []byte) {
+ if len(src) == 0 {
+ return
+ }
+ dst = make([]byte, len(src))
+ copy(dst, src)
+ return
+}