aboutsummaryrefslogtreecommitdiffstats
path: root/ethpipe/js_pipe.go
diff options
context:
space:
mode:
authorCayman Nava <caymannava@gmail.com>2014-09-07 04:51:13 +0800
committerCayman Nava <caymannava@gmail.com>2014-09-10 12:27:34 +0800
commit7dacd7eb7818a336b3be99aea834093cf40a1b08 (patch)
treed2dcc8e7832a3e2c167c064195a3590fc7f43db1 /ethpipe/js_pipe.go
parent6afc16399f9624663579ad72950b4ea3b887db57 (diff)
downloadgo-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar.gz
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar.bz2
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar.lz
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar.xz
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.tar.zst
go-tangerine-7dacd7eb7818a336b3be99aea834093cf40a1b08.zip
add pushtx to api
Previously the software assumed use of an internal private key for use in all broadcasted transactions. This addition lets nodes relay pre-signed transactions originating from sources other than the node itself.
Diffstat (limited to 'ethpipe/js_pipe.go')
-rw-r--r--ethpipe/js_pipe.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ethpipe/js_pipe.go b/ethpipe/js_pipe.go
index eeece5179..47cac2ca2 100644
--- a/ethpipe/js_pipe.go
+++ b/ethpipe/js_pipe.go
@@ -225,6 +225,12 @@ func (self *JSPipe) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr
return NewJSReciept(contractCreation, tx.CreationAddress(), tx.Hash(), keyPair.Address()), nil
}
+func (self *JSPipe) PushTx(txStr string) (*JSReceipt, error) {
+ tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(txStr))
+ self.obj.TxPool().QueueTransaction(tx)
+ return NewJSReciept(tx.CreatesContract(), tx.CreationAddress(), tx.Hash(), tx.Sender()), nil
+}
+
func (self *JSPipe) CompileMutan(code string) string {
data, err := self.Pipe.CompileMutan(code)
if err != nil {