diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 12:24:23 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 12:24:23 +0800 |
commit | b56e20be2760343147f72ca62a8db8bd216903bf (patch) | |
tree | 494ba55c1bd85839e2620676f33534f42a93777c /xeth | |
parent | 754160afea7fc230c3236d5494beefeb03b94140 (diff) | |
download | dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.gz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.bz2 dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.lz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.xz dexon-b56e20be2760343147f72ca62a8db8bd216903bf.tar.zst dexon-b56e20be2760343147f72ca62a8db8bd216903bf.zip |
Reorg for clarity
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/xeth.go | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 690db5135..3d44e292c 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -70,6 +70,13 @@ type Frontend interface { ConfirmTransaction(tx *types.Transaction) bool } +// dummyFrontend is a non-interactive frontend that allows all +// transactions but cannot not unlock any keys. +type dummyFrontend struct{} + +func (dummyFrontend) UnlockAccount([]byte) bool { return false } +func (dummyFrontend) ConfirmTransaction(*types.Transaction) bool { return true } + type XEth struct { eth Backend blockProcessor *core.BlockProcessor @@ -90,13 +97,6 @@ type XEth struct { messages map[int]*whisperFilter } -// dummyFrontend is a non-interactive frontend that allows all -// transactions but cannot not unlock any keys. -type dummyFrontend struct{} - -func (dummyFrontend) UnlockAccount([]byte) bool { return false } -func (dummyFrontend) ConfirmTransaction(*types.Transaction) bool { return true } - // New creates an XEth that uses the given frontend. // If a nil Frontend is provided, a default frontend which // confirms all transactions will be used. @@ -527,6 +527,28 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt contractCreation bool ) + // TODO if no_private_key then + //if _, exists := p.register[args.From]; exists { + // p.register[args.From] = append(p.register[args.From], args) + //} else { + /* + account := accounts.Get(common.FromHex(args.From)) + if account != nil { + if account.Unlocked() { + if !unlockAccount(account) { + return + } + } + + result, _ := account.Transact(common.FromHex(args.To), common.FromHex(args.Value), common.FromHex(args.Gas), common.FromHex(args.GasPrice), common.FromHex(args.Data)) + if len(result) > 0 { + *reply = common.ToHex(result) + } + } else if _, exists := p.register[args.From]; exists { + p.register[ags.From] = append(p.register[args.From], args) + } + */ + from = common.FromHex(fromStr) data = common.FromHex(codeStr) to = common.FromHex(toStr) |