Skip to content

Commit 90c7155

Browse files
karalabefjl
authored andcommitted
mobile: accept nil for chainid as homestead signing (#14463)
1 parent df4e7ec commit 90c7155

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎mobile/accounts.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ func (ks *KeyStore) SignHash(address *Address, hash []byte) (signature []byte, _
115115

116116
// SignTx signs the given transaction with the requested account.
117117
func (ks *KeyStore) SignTx(account *Account, tx *Transaction, chainID *BigInt) (*Transaction, error) {
118+
if chainID == nil { // Null passed from mobile app
119+
chainID = new(BigInt)
120+
}
118121
signed, err := ks.keystore.SignTx(account.account, tx.tx, chainID.bigint)
119122
if err != nil {
120123
return nil, err
@@ -132,6 +135,9 @@ func (ks *KeyStore) SignHashPassphrase(account *Account, passphrase string, hash
132135
// SignTxPassphrase signs the transaction if the private key matching the
133136
// given address can be decrypted with the given passphrase.
134137
func (ks *KeyStore) SignTxPassphrase(account *Account, passphrase string, tx *Transaction, chainID *BigInt) (*Transaction, error) {
138+
if chainID == nil { // Null passed from mobile app
139+
chainID = new(BigInt)
140+
}
135141
signed, err := ks.keystore.SignTxWithPassphrase(account.account, passphrase, tx.tx, chainID.bigint)
136142
if err != nil {
137143
return nil, err

0 commit comments

Comments
 (0)