func (db *DB) AddToBalance(pubkey *koblitz.PublicKey, amount uint64, param *coinparam.Params) (err error) {

	var tx *sql.Tx
	if tx, err = db.DBHandler.Begin(); err != nil {
		return
	}

	defer func() {
		if err != nil {
			tx.Rollback()
			err = fmt.Errorf("Error while updating balance: \n%s", err)
			return
		}
		err = tx.Commit()
	}()

	if err = db.AddToBalanceWithinTransaction(pubkey, amount, tx, param); err != nil {
		return
	}

	return
}
// AddToBalance adds to a single balance
AddToBalance adds to a single balance
// AddToBalance adds to a single balance
func (db *DB) AddToBalance(pubkey *koblitz.PublicKey, amount uint64, param *coinparam.Params) (err error) {
	var tx *sql.Tx
	if tx, err = db.DBHandler.Begin(); err != nil {
		return
	}
	defer func() {
		if err != nil {
			tx.Rollback()
			err = fmt.Errorf("Error while updating balance: \n%s", err)
			return
		}
		err = tx.Commit()
	}()
	if err = db.AddToBalanceWithinTransaction(pubkey, amount, tx, param); err != nil {
		return
	}
	return
}
func ( db * DB ) AddToBalance ( pubkey * koblitz . PublicKey , amount uint64 , param * coinparam . Params ) ( err error ) { var tx * sql . Tx if tx , err = db . DBHandler . Begin ( ) ; err != nil { return } defer func ( ) { if err != nil { tx . Rollback ( ) err = fmt . Errorf ( " \n " , err ) return } err = tx . Commit ( ) } ( ) if err = db . AddToBalanceWithinTransaction ( pubkey , amount , tx , param ) ; err != nil { return } return }
AddToBalance adds to a single balance
AddToBalance adds to a single balance