From c2762c0c9e0404bce52acd36f7c0f94b21e3fccb Mon Sep 17 00:00:00 2001 From: 8lecramm Date: Wed, 27 Jul 2022 00:55:23 +0200 Subject: [PATCH 1/3] don't panic when calling RPC GetTransactions --- blockchain/storetopo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockchain/storetopo.go b/blockchain/storetopo.go index 0ec2e285..0b0edebc 100644 --- a/blockchain/storetopo.go +++ b/blockchain/storetopo.go @@ -279,6 +279,10 @@ func (chain *Blockchain) Find_Blocks_Height_Range(startheight, stopheight int64) } _, topos_end := chain.Store.Topo_store.binarySearchHeight(stopheight) + if topos_start == nil || topos_end == nil { + return + } + lowest := topos_start[0] for _, t := range topos_start { if t < lowest { From d8d1c8582efa7a07990a66826eaa61a56532450b Mon Sep 17 00:00:00 2001 From: 8lecramm <89603217+8lecramm@users.noreply.github.com> Date: Sun, 18 Sep 2022 22:51:20 +0200 Subject: [PATCH 2/3] RPC transfer call with integrated addresses fixed an issue when trying to send a TX with more than 1 integrated address --- walletapi/wallet_transfer.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/walletapi/wallet_transfer.go b/walletapi/wallet_transfer.go index 5170aeb7..f3c4d8cb 100644 --- a/walletapi/wallet_transfer.go +++ b/walletapi/wallet_transfer.go @@ -16,33 +16,35 @@ package walletapi -import "fmt" +import ( + "encoding/hex" + "fmt" + + "github.com/deroproject/derohe/config" + "github.com/deroproject/derohe/cryptography/bn256" + "github.com/deroproject/derohe/cryptography/crypto" + "github.com/deroproject/derohe/rpc" + "github.com/deroproject/derohe/transaction" +) //import "sort" //import "math/rand" //import cryptorand "crypto/rand" //import "encoding/binary" -import "encoding/hex" //import "encoding/json" //import "github.com/vmihailenco/msgpack" -import "github.com/deroproject/derohe/config" -import "github.com/deroproject/derohe/cryptography/crypto" - //import "github.com/deroproject/derohe/crypto/ringct" -import "github.com/deroproject/derohe/transaction" //import "github.com/deroproject/derohe/globals" -import "github.com/deroproject/derohe/rpc" //import "github.com/deroproject/derohe/ddn" //import "github.com/deroproject/derohe/structures" //import "github.com/deroproject/derohe/blockchain/inputmaturity" -import "github.com/deroproject/derohe/cryptography/bn256" /* func (w *Wallet_Memory) Transfer_Simplified(addr string, value uint64, data []byte, scdata rpc.Arguments) (tx *transaction.Transaction, err error) { @@ -302,10 +304,9 @@ func (w *Wallet_Memory) TransferPayload0(transfers []rpc.Transfer, ringsize uint } else { fmt.Printf("integrtated address, but don't know how to process\n") err = fmt.Errorf("integrated address used, but don't know how to process %+v", addr.Arguments) + return } } - - return } var dest_e *crypto.ElGamal From 995d79039ccccf14b6897c083306447a5d0dc5c4 Mon Sep 17 00:00:00 2001 From: 8lecramm <89603217+8lecramm@users.noreply.github.com> Date: Sun, 2 Oct 2022 02:14:20 +0200 Subject: [PATCH 3/3] Show raw TX data for registration --- cmd/dero-wallet-cli/easymenu_post_open.go | 37 ++++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/cmd/dero-wallet-cli/easymenu_post_open.go b/cmd/dero-wallet-cli/easymenu_post_open.go index 218e0560..3afbf12a 100644 --- a/cmd/dero-wallet-cli/easymenu_post_open.go +++ b/cmd/dero-wallet-cli/easymenu_post_open.go @@ -16,27 +16,27 @@ package main -import "io" -import "os" -import "time" -import "fmt" -import "errors" -import "runtime" -import "strings" - -import "path/filepath" -import "encoding/json" - -import "github.com/chzyer/readline" - -import "github.com/deroproject/derohe/rpc" -import "github.com/deroproject/derohe/globals" +import ( + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "runtime" + "strings" + "time" + + "github.com/chzyer/readline" + "github.com/deroproject/derohe/cryptography/crypto" + "github.com/deroproject/derohe/globals" + "github.com/deroproject/derohe/rpc" + "github.com/deroproject/derohe/transaction" +) //import "github.com/deroproject/derohe/address" -import "github.com/deroproject/derohe/cryptography/crypto" -import "github.com/deroproject/derohe/transaction" - // handle menu if a wallet is currently opened func display_easymenu_post_open_command(l *readline.Instance) { w := l.Stderr() @@ -162,6 +162,7 @@ func handle_easymenu_post_open_command(l *readline.Instance, line string) (proce err := wallet.SendTransaction(reg_tx) if err != nil { fmt.Fprintf(l.Stderr(), "sending registration tx err %s\n", err) + fmt.Fprintf(l.Stderr(), "You can register your wallet by sending this RAW tx data to the daemon (DERO.SendRawTransaction):\n%s\n", hex.EncodeToString(reg_tx.Serialize())) } else { fmt.Fprintf(l.Stderr(), "registration tx dispatched successfully\n") }