wallet: ensure PublishTransaction handles nil error case

This commit is contained in:
Olaoluwa Osuntokun 2018-04-18 18:34:48 -07:00
parent fbfca5f4ae
commit 620be5821f

View file

@ -2728,6 +2728,9 @@ func (w *Wallet) PublishTransaction(tx *wire.MsgTx) error {
_, err = server.SendRawTransaction(tx, false) _, err = server.SendRawTransaction(tx, false)
switch { switch {
case err == nil:
return nil
// The following are errors returned from btcd's mempool. // The following are errors returned from btcd's mempool.
case strings.Contains(err.Error(), "spent"): case strings.Contains(err.Error(), "spent"):
fallthrough fallthrough