From a0871e64b722eea8aa100eef5787abad98d4ac1a Mon Sep 17 00:00:00 2001 From: Captain Dero Date: Sat, 3 Nov 2018 06:29:37 +0100 Subject: [PATCH] Support of 8 bytes Payment ID added in wallet rpc interface. --- config/version.go | 2 +- walletapi/rpc_transfer.go | 2 +- walletapi/rpc_transfersplit.go | 2 +- walletapi/wallet.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.go b/config/version.go index 739cba8..dc82ccb 100644 --- a/config/version.go +++ b/config/version.go @@ -20,4 +20,4 @@ import "github.com/blang/semver" // right now it has to be manually changed // do we need to include git commitsha?? -var Version = semver.MustParse("2.1.5-0.alpha.atlantis+10102018") +var Version = semver.MustParse("2.1.5-1.alpha.atlantis+03112018") diff --git a/walletapi/rpc_transfer.go b/walletapi/rpc_transfer.go index cd5c748..81b8689 100644 --- a/walletapi/rpc_transfer.go +++ b/walletapi/rpc_transfer.go @@ -59,7 +59,7 @@ func (h Transfer_Handler) ServeJSONRPC(c context.Context, params *fastjson.RawMe rlog.Debugf("Len destinations %d %+v", len(p.Destinations), p) payment_id := p.Payment_ID - if len(payment_id) > 0 && len(payment_id) != 64 { + if len(payment_id) > 0 && (len(payment_id) == 64 || len(payment_id) == 16) != true { return nil, jsonrpc.ErrInvalidParams() // we should give invalid payment ID } if _, err := hex.DecodeString(p.Payment_ID); err != nil { diff --git a/walletapi/rpc_transfersplit.go b/walletapi/rpc_transfersplit.go index 4889cdc..fda0d5f 100644 --- a/walletapi/rpc_transfersplit.go +++ b/walletapi/rpc_transfersplit.go @@ -60,7 +60,7 @@ func (h TransferSplit_Handler) ServeJSONRPC(c context.Context, params *fastjson. unlock_time := p.Unlock_time payment_id := p.Payment_ID - if len(payment_id) > 0 && len(payment_id) != 64 { + if len(payment_id) > 0 && (len(payment_id) == 64 || len(payment_id) == 16) != true { return nil, jsonrpc.ErrInvalidParams() // we should give invalid payment ID } if _, err := hex.DecodeString(p.Payment_ID); err != nil { diff --git a/walletapi/wallet.go b/walletapi/wallet.go index bcff43b..7c20482 100644 --- a/walletapi/wallet.go +++ b/walletapi/wallet.go @@ -965,7 +965,7 @@ func (w *Wallet) Clean() { w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(FUNDS_SPENT_WHERE)) w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(FUNDS_BUCKET_OUTGOING)) - w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(RING_BUCKET)) +// w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(RING_BUCKET)) //Improves wallet rescan performance. w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(KEYIMAGE_BUCKET)) w.delete_bucket(BLOCKCHAIN_UNIVERSE, []byte(HEIGHT_TO_BLOCK_BUCKET))