mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-22 19:19:09 +00:00
cli: fix empty block uploading in util upload-bin
In case of uploading retry already drained bin buffer is returned in `bw.Bytes`, which leads to empty block uploading. Close #3630 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
29bb3ff1cf
commit
e00d7fec7f
1 changed files with 2 additions and 1 deletions
|
@ -164,8 +164,9 @@ func uploadBin(ctx *cli.Context) error {
|
||||||
*object.NewAttribute("timestamp", strconv.FormatUint(blk.Timestamp, 10)),
|
*object.NewAttribute("timestamp", strconv.FormatUint(blk.Timestamp, 10)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objBytes := bw.Bytes()
|
||||||
err = retry(func() error {
|
err = retry(func() error {
|
||||||
return uploadObj(ctx.Context, p, signer, acc.PrivateKey().GetScriptHash(), containerID, bw.Bytes(), attrs, homomorphicHashingDisabled)
|
return uploadObj(ctx.Context, p, signer, acc.PrivateKey().GetScriptHash(), containerID, objBytes, attrs, homomorphicHashingDisabled)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in a new issue