Merge pull request #14824 from karalabe/faucet-ignore-whitespace

cmd/faucet: ignore whitespace in gist content
This commit is contained in:
Péter Szilágyi 2017-07-17 21:19:16 +03:00 committed by GitHub
commit 4d2249773a
1 changed files with 3 additions and 2 deletions

View File

@ -413,8 +413,9 @@ func (f *faucet) apiHandler(conn *websocket.Conn) {
// Iterate over all the files and look for Ethereum addresses
var address common.Address
for _, file := range gist.Files {
if len(file.Content) == 2+common.AddressLength*2 {
address = common.HexToAddress(file.Content)
content := strings.TrimSpace(file.Content)
if len(content) == 2+common.AddressLength*2 {
address = common.HexToAddress(content)
}
}
if address == (common.Address{}) {