aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go4
-rw-r--r--core/types/transaction.go5
2 files changed, 7 insertions, 2 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 7b4695f73..b59044bfc 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -209,7 +209,7 @@ func (self *Block) HashNoNonce() []byte {
}
func (self *Block) String() string {
- return fmt.Sprintf(`BLOCK(%x): Size: %v {
+ return fmt.Sprintf(`BLOCK(%x): Size: %v TD: %v {
Header:
[
%v
@@ -219,7 +219,7 @@ Transactions:
Uncles:
%v
}
-`, self.header.Hash(), self.Size(), self.header, self.transactions, self.uncles)
+`, self.header.Hash(), self.Size(), self.Td, self.header, self.transactions, self.uncles)
}
func (self *Header) String() string {
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 59244adc3..83d76648f 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -2,6 +2,7 @@ package types
import (
"bytes"
+ "crypto/ecdsa"
"fmt"
"math/big"
@@ -139,6 +140,10 @@ func (tx *Transaction) Sign(privk []byte) error {
return nil
}
+func (tx *Transaction) SignECDSA(key *ecdsa.PrivateKey) error {
+ return tx.Sign(crypto.FromECDSA(key))
+}
+
func (tx *Transaction) RlpData() interface{} {
data := []interface{}{tx.AccountNonce, tx.Price, tx.GasLimit, tx.Recipient, tx.Amount, tx.Payload}