diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-05-13 08:00:39 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-05-13 08:00:39 +0800 |
commit | 90c7155ef41900babc5fd736224127f048e5c883 (patch) | |
tree | eb3d527549aed508abef8344605311064d0648f5 /mobile | |
parent | df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6 (diff) | |
download | go-tangerine-90c7155ef41900babc5fd736224127f048e5c883.tar.gz go-tangerine-90c7155ef41900babc5fd736224127f048e5c883.tar.zst go-tangerine-90c7155ef41900babc5fd736224127f048e5c883.zip |
mobile: accept nil for chainid as homestead signing (#14463)
Diffstat (limited to 'mobile')
-rw-r--r-- | mobile/accounts.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mobile/accounts.go b/mobile/accounts.go index fbaa3bf40..f5b7e81aa 100644 --- a/mobile/accounts.go +++ b/mobile/accounts.go @@ -115,6 +115,9 @@ func (ks *KeyStore) SignHash(address *Address, hash []byte) (signature []byte, _ // SignTx signs the given transaction with the requested account. func (ks *KeyStore) SignTx(account *Account, tx *Transaction, chainID *BigInt) (*Transaction, error) { + if chainID == nil { // Null passed from mobile app + chainID = new(BigInt) + } signed, err := ks.keystore.SignTx(account.account, tx.tx, chainID.bigint) if err != nil { return nil, err @@ -132,6 +135,9 @@ func (ks *KeyStore) SignHashPassphrase(account *Account, passphrase string, hash // SignTxPassphrase signs the transaction if the private key matching the // given address can be decrypted with the given passphrase. func (ks *KeyStore) SignTxPassphrase(account *Account, passphrase string, tx *Transaction, chainID *BigInt) (*Transaction, error) { + if chainID == nil { // Null passed from mobile app + chainID = new(BigInt) + } signed, err := ks.keystore.SignTxWithPassphrase(account.account, passphrase, tx.tx, chainID.bigint) if err != nil { return nil, err |