Added find name for namereg

This commit is contained in:
obscuren 2014-07-17 22:30:00 +02:00
parent 6a19b62db6
commit 28a146d438
2 changed files with 14 additions and 0 deletions

View File

@ -179,6 +179,19 @@ func FindAddressInNameReg(stateManager *ethchain.StateManager, name string) []by
return nil return nil
} }
func FindNameInNameReg(stateManager *ethchain.StateManager, addr []byte) string {
nameReg := EthereumConfig(stateManager).NameReg()
if nameReg != nil {
addr = ethutil.LeftPadBytes(addr, 32)
reg := nameReg.GetStorage(ethutil.BigD(addr))
return strings.TrimRight(reg.Str(), "\x00")
}
return ""
}
func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, scriptStr string) (*PReceipt, error) { func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, scriptStr string) (*PReceipt, error) {
var hash []byte var hash []byte
var contractCreation bool var contractCreation bool

View File

@ -47,6 +47,7 @@ type PBlock struct {
Transactions string `json:"transactions"` Transactions string `json:"transactions"`
Time int64 `json:"time"` Time int64 `json:"time"`
Coinbase string `json:"coinbase"` Coinbase string `json:"coinbase"`
Name string `json:"name"`
GasLimit string `json:"gasLimit"` GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"` GasUsed string `json:"gasUsed"`
} }