mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
Fixed issue with casting to smaller byte array
This commit is contained in:
parent
e0b6a31613
commit
b15e03acd7
@ -49,6 +49,10 @@ func BigD(data []byte) *big.Int {
|
||||
func BigToBytes(num *big.Int, base int) []byte {
|
||||
ret := make([]byte, base/8)
|
||||
|
||||
if len(num.Bytes()) > base/8 {
|
||||
return num.Bytes()
|
||||
}
|
||||
|
||||
return append(ret[:len(ret)-len(num.Bytes())], num.Bytes()...)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user