aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub/pub.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-15 03:34:30 +0800
committerobscuren <geffobscura@gmail.com>2014-05-15 03:34:30 +0800
commit6efdd21633c1d21f36080754a89ad82c0c244128 (patch)
tree873da7787044997e5590d35e32076ecb7a21dae4 /ethpub/pub.go
parent283f4d8eb3e223f89fd613767e1c6c318ac2bb75 (diff)
parentad4ffdc9474aca48ab1d3d361797398f795a6d31 (diff)
downloadgo-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar.gz
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar.bz2
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar.lz
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar.xz
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.tar.zst
go-tangerine-6efdd21633c1d21f36080754a89ad82c0c244128.zip
Merge branch 'release/poc5-rc6'
Diffstat (limited to 'ethpub/pub.go')
-rw-r--r--ethpub/pub.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go
index 4d1536368..daacb9d78 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -39,10 +39,7 @@ func (lib *PEthereum) GetBlock(hexHash string) *PBlock {
}
func (lib *PEthereum) GetKey() *PKey {
- keyPair, err := ethchain.NewKeyPairFromSec(ethutil.Config.Db.GetKeys()[0].PrivateKey)
- if err != nil {
- return nil
- }
+ keyPair := ethutil.GetKeyRing().Get(0)
return NewPKey(keyPair)
}
@@ -90,7 +87,7 @@ func (lib *PEthereum) IsContract(address string) bool {
}
func (lib *PEthereum) SecretToAddress(key string) string {
- pair, err := ethchain.NewKeyPairFromSec(ethutil.FromHex(key))
+ pair, err := ethutil.NewKeyPairFromSec(ethutil.FromHex(key))
if err != nil {
return ""
}
@@ -115,12 +112,12 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, in
hash = ethutil.FromHex(recipient)
}
- var keyPair *ethchain.KeyPair
+ var keyPair *ethutil.KeyPair
var err error
if key[0:2] == "0x" {
- keyPair, err = ethchain.NewKeyPairFromSec([]byte(ethutil.FromHex(key[0:2])))
+ keyPair, err = ethutil.NewKeyPairFromSec([]byte(ethutil.FromHex(key[0:2])))
} else {
- keyPair, err = ethchain.NewKeyPairFromSec([]byte(ethutil.FromHex(key)))
+ keyPair, err = ethutil.NewKeyPairFromSec([]byte(ethutil.FromHex(key)))
}
if err != nil {