diff --git a/config/version.go b/config/version.go index dc90112..73a22fb 100644 --- a/config/version.go +++ b/config/version.go @@ -20,4 +20,4 @@ import "github.com/blang/semver/v4" // right now it has to be manually changed // do we need to include git commitsha?? -var Version = semver.MustParse("3.4.97-1.DEROHE.STARGATE+26112021") +var Version = semver.MustParse("3.4.98-1.DEROHE.STARGATE+25112021") diff --git a/p2p/chain_sync.go b/p2p/chain_sync.go index 6d573de..26d9a85 100644 --- a/p2p/chain_sync.go +++ b/p2p/chain_sync.go @@ -134,11 +134,11 @@ try_again: switch { case len(request.Block_list) < 20: // 20 blocks raw i++ - case len(request.Block_list) < 100: // 20 block with 5 steps + case len(request.Block_list) < 40: // 20 block with 5 steps i += 5 - case len(request.Block_list) < 1000: // 20 block with 50 steps + case len(request.Block_list) < 60: // 20 block with 50 steps i += 50 - case len(request.Block_list) < 10000: // 20 block with 500 steps + case len(request.Block_list) < 80: // 20 block with 500 steps i += 500 default: i = i * 2 @@ -212,7 +212,7 @@ try_again: var orequest ObjectList var oresponse Objects - //fmt.Printf("inserting blocks %d %x\n", (int64(i) + response.Start_topoheight), response.Block_list[i][:]) + fmt.Printf("inserting blocks %d %x\n", (int64(i) + response.Start_topoheight), response.Block_list[i][:]) orequest.Block_list = append(orequest.Block_list, response.Block_list[i]) fill_common(&orequest.Common) if err := connection.Client.Call("Peer.GetObject", orequest, &oresponse); err != nil { diff --git a/vendor/github.com/deroproject/graviton/node_inner.go b/vendor/github.com/deroproject/graviton/node_inner.go index e549e96..69b8485 100644 --- a/vendor/github.com/deroproject/graviton/node_inner.go +++ b/vendor/github.com/deroproject/graviton/node_inner.go @@ -331,7 +331,7 @@ func (in *inner) MarshalTo(store *Store, buf []byte, bucket string) (int, error) done += tsize tsize = binary.PutUvarint(buf[done:], uint64(len(bucket))) // bucket name length done += tsize - done += copy(buf[done:], []byte(bucket)) // write bucket name + done += copy(buf[done: done+len(bucket)], []byte(bucket)) // write bucket name, panic if buffer is small } @@ -345,7 +345,7 @@ func (in *inner) MarshalTo(store *Store, buf []byte, bucket string) (int, error) lhash, err := in.lhash(store) errors = append(errors, err) - done += copy(buf[done:], lhash) // insert left hash + done += copy(buf[done: done+32], lhash) // insert left hash } switch getNodeType(in.right) { @@ -357,7 +357,7 @@ func (in *inner) MarshalTo(store *Store, buf []byte, bucket string) (int, error) done += tsize rhash, err := in.rhash(store) errors = append(errors, err) - done += copy(buf[done:], rhash) // insert right hash + done += copy(buf[done:done+32], rhash) // insert right hash } buf[0] = byte(done) // prepend with length @@ -427,7 +427,7 @@ func parse_node(level byte, nodetype byte, buf []byte) (node, int, error) { done += tsize if len(buf) < done+HASHSIZE { - return nil, 0, xerrors.Errorf("Probably data corruption, input buffer has incomplete data") + return nil, 0, xerrors.Errorf("Probably data corruption, input buffer has incomplete data len(buf) %d done %d (%s)\n",len(buf),done, string(buf)) } copy(left.hash[:], buf[done:done+HASHSIZE]) diff --git a/vendor/github.com/deroproject/graviton/tree.go b/vendor/github.com/deroproject/graviton/tree.go index 1555a21..3cd040d 100644 --- a/vendor/github.com/deroproject/graviton/tree.go +++ b/vendor/github.com/deroproject/graviton/tree.go @@ -362,7 +362,7 @@ func (t *Tree) commit_inner(gv *Snapshot, specialversion bool, level int, in *in } - var buf [128]byte + var buf [384]byte var done int if done, err = in.MarshalTo(t.store, buf[:], t.treename); err == nil { diff --git a/walletapi/wallet_transfer.go b/walletapi/wallet_transfer.go index e43dbf0..cc5bc8a 100644 --- a/walletapi/wallet_transfer.go +++ b/walletapi/wallet_transfer.go @@ -214,11 +214,15 @@ func (w *Wallet_Memory) TransferPayload0(transfers []rpc.Transfer, ringsize uint topoheight := int64(-1) var block_hash crypto.Hash - { // if wallet has been recently used, increase probability of user's tx being successfully mined + { // if wallet has not been recently used, increase probability of user's tx being successfully mined var zeroscid crypto.Hash - if w.getEncryptedBalanceresult(zeroscid).Topoheight+3 < daemon_topoheight { + if w.getEncryptedBalanceresult(zeroscid).Topoheight+2 <= daemon_topoheight { + topoheight = daemon_topoheight - 2 + } + if w.getEncryptedBalanceresult(zeroscid).Topoheight+3 <= daemon_topoheight { topoheight = daemon_topoheight - 3 } + } _, _, block_hash, self_e, _ := w.GetEncryptedBalanceAtTopoHeight(transfers[0].SCID, topoheight, w.GetAddress().String())