In this line,
// Set sender address or use a default if none specified
var addr common.Address
if args.From == nil {
if wallets := b.AccountManager().Wallets(); len(wallets) > 0 {
if accounts := wallets[0].Accounts(); len(accounts) > 0 {
addr = accounts[0].Address
}
}
} else {
addr = *args.From
}
if the from
is nil, geth uses the first account of the first wallet.
- What if I don't have any wallet/account in account manager?
- Will it surprise the user?
- Why is the
from
parameter optional?