aboutsummaryrefslogtreecommitdiffstats
path: root/dev_console.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-22 06:27:08 +0800
committerobscuren <geffobscura@gmail.com>2014-01-22 06:27:08 +0800
commit3616080db46931202003157bacf10748008bebc0 (patch)
treea2004c7c4c8f6c91999b734b75a57ac31b04cb97 /dev_console.go
parente47230f82da93ef0110faa76211b9b6f13b1060b (diff)
downloadgo-tangerine-3616080db46931202003157bacf10748008bebc0.tar
go-tangerine-3616080db46931202003157bacf10748008bebc0.tar.gz
go-tangerine-3616080db46931202003157bacf10748008bebc0.tar.bz2
go-tangerine-3616080db46931202003157bacf10748008bebc0.tar.lz
go-tangerine-3616080db46931202003157bacf10748008bebc0.tar.xz
go-tangerine-3616080db46931202003157bacf10748008bebc0.tar.zst
go-tangerine-3616080db46931202003157bacf10748008bebc0.zip
Added synchronisation of transactions across remote pools
Diffstat (limited to 'dev_console.go')
-rw-r--r--dev_console.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/dev_console.go b/dev_console.go
index 5340a5f46..d14f019e5 100644
--- a/dev_console.go
+++ b/dev_console.go
@@ -12,15 +12,16 @@ import (
)
type Console struct {
- db *ethdb.MemDatabase
- trie *ethutil.Trie
+ db *ethdb.MemDatabase
+ trie *ethutil.Trie
+ server *Server
}
-func NewConsole() *Console {
+func NewConsole(s *Server) *Console {
db, _ := ethdb.NewMemDatabase()
trie := ethutil.NewTrie(db, "")
- return &Console{db: db, trie: trie}
+ return &Console{db: db, trie: trie, server: s}
}
func (i *Console) ValidateInput(action string, argumentLength int) error {
@@ -43,6 +44,9 @@ func (i *Console) ValidateInput(action string, argumentLength int) error {
case action == "encode" && argumentLength != 1:
err = true
expArgCount = 1
+ case action == "tx" && argumentLength != 2:
+ err = true
+ expArgCount = 2
}
if err {
@@ -105,6 +109,10 @@ func (i *Console) ParseInput(input string) bool {
fmt.Printf("%q\n", d)
case "encode":
fmt.Printf("%q\n", ethutil.Encode(tokens[1]))
+ case "tx":
+ tx := ethutil.NewTransaction(tokens[1], ethutil.Big(tokens[2]), []string{""})
+
+ i.server.txPool.QueueTransaction(tx)
case "exit", "quit", "q":
return false
case "help":