InsufficientFundsError -> InsufficientFunds

This commit is contained in:
Josh Rickmar 2014-06-20 12:20:47 -05:00
parent 1163b3065e
commit 3ebc4f3600

View file

@ -37,12 +37,12 @@ import (
// funds from unspent tx outputs for a wallet to create a transaction. // funds from unspent tx outputs for a wallet to create a transaction.
// This may be caused by not enough inputs for all of the desired total // This may be caused by not enough inputs for all of the desired total
// transaction output amount, or due to // transaction output amount, or due to
type InsufficientFundsError struct { type InsufficientFunds struct {
in, out, fee btcutil.Amount in, out, fee btcutil.Amount
} }
// Error satisifies the builtin error interface. // Error satisifies the builtin error interface.
func (e InsufficientFundsError) Error() string { func (e InsufficientFunds) Error() string {
total := e.out + e.fee total := e.out + e.fee
if e.fee == 0 { if e.fee == 0 {
return fmt.Sprintf("insufficient funds: transaction requires "+ return fmt.Sprintf("insufficient funds: transaction requires "+
@ -110,7 +110,7 @@ func selectInputs(eligible []txstore.Credit, amt, fee btcutil.Amount,
} }
} }
if out < amt+fee { if out < amt+fee {
return nil, 0, InsufficientFundsError{out, amt, fee} return nil, 0, InsufficientFunds{out, amt, fee}
} }
return selected, out, nil return selected, out, nil