changed DenioD's github lightwalletd links to git.hush.is lightwalletd links

This commit is contained in:
jahway603
2020-11-27 22:13:24 -05:00
parent 2824ad752e
commit 0f21f457a6
9 changed files with 49 additions and 52 deletions

View File

@@ -5,16 +5,16 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"regexp"
"strconv"
"strings"
"time"
"regexp"
"github.com/btcsuite/btcd/rpcclient"
"github.com/sirupsen/logrus"
"github.com/DenioD/lightwalletd/common"
"github.com/DenioD/lightwalletd/walletrpc"
"git.hush.is/hush/lightwalletd/common"
"git.hush.is/hush/lightwalletd/walletrpc"
)
var (
@@ -53,16 +53,16 @@ func (s *SqlStreamer) GetLatestBlock(ctx context.Context, placeholder *walletrpc
func (s *SqlStreamer) GetAddressTxids(addressBlockFilter *walletrpc.TransparentAddressBlockFilter, resp walletrpc.CompactTxStreamer_GetAddressTxidsServer) error {
var err error
var errCode int64
var errCode int64
// Test to make sure Address is a single t address
match, err := regexp.Match("^R[a-zA-Z0-9]{33}$", []byte(addressBlockFilter.Address))
if err != nil || !match {
s.log.Errorf("Unrecognized address: %s", addressBlockFilter.Address)
return nil
}
params := make([]json.RawMessage, 1)
// Test to make sure Address is a single t address
match, err := regexp.Match("^R[a-zA-Z0-9]{33}$", []byte(addressBlockFilter.Address))
if err != nil || !match {
s.log.Errorf("Unrecognized address: %s", addressBlockFilter.Address)
return nil
}
params := make([]json.RawMessage, 1)
st := "{\"addresses\": [\"" + addressBlockFilter.Address + "\"]," +
"\"start\": " + strconv.FormatUint(addressBlockFilter.Range.Start.Height, 10) +
", \"end\": " + strconv.FormatUint(addressBlockFilter.Range.End.Height, 10) + "}"
@@ -71,7 +71,6 @@ func (s *SqlStreamer) GetAddressTxids(addressBlockFilter *walletrpc.TransparentA
result, rpcErr := s.client.RawRequest("getaddresstxids", params)
// For some reason, the error responses are not JSON
if rpcErr != nil {
s.log.Errorf("Got error: %s", rpcErr.Error())
@@ -238,7 +237,7 @@ func (s *SqlStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilte
// GetLightdInfo gets the LightWalletD (this server) info
func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*walletrpc.LightdInfo, error) {
saplingHeight, blockHeight, chainName, consensusBranchId, difficulty, longestchain, notarized, err := common.GetSaplingInfo(s.client)
saplingHeight, blockHeight, chainName, consensusBranchId, difficulty, longestchain, notarized, err := common.GetSaplingInfo(s.client)
if err != nil {
s.log.WithFields(logrus.Fields{
@@ -265,7 +264,7 @@ func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*
// GetCoinsupply gets the Coinsupply info
func (s *SqlStreamer) GetCoinsupply(ctx context.Context, in *walletrpc.Empty) (*walletrpc.Coinsupply, error) {
result, coin, height, supply, zfunds,total, err := common.GetCoinsupply(s.client)
result, coin, height, supply, zfunds, total, err := common.GetCoinsupply(s.client)
if err != nil {
s.log.WithFields(logrus.Fields{
@@ -277,16 +276,15 @@ func (s *SqlStreamer) GetCoinsupply(ctx context.Context, in *walletrpc.Empty) (*
// TODO these are called Error but they aren't at the moment.
// A success will return code 0 and message txhash.
return &walletrpc.Coinsupply{
Result: result,
Coin: coin,
Height: uint64(height),
Supply: uint64(supply),
Zfunds: uint64(zfunds),
Total: uint64(total),
Result: result,
Coin: coin,
Height: uint64(height),
Supply: uint64(supply),
Zfunds: uint64(zfunds),
Total: uint64(total),
}, nil
}
// SendTransaction forwards raw transaction bytes to a hushd instance over JSON-RPC
func (s *SqlStreamer) SendTransaction(ctx context.Context, rawtx *walletrpc.RawTransaction) (*walletrpc.SendResponse, error) {
// sendrawtransaction "hexstring" ( allowhighfees )