Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Balance of receiver gets overwritten instead of increased

Open
#319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, sql
Domain
database, payments

Research direction

Start by locating the money transfer logic that uses self.receiver_balance, then inspect how the receiver’s balance is read and written. Verify the fix with a receiver balance of 300 and a transfer of 50; the stored final balance should be 350 rather than 50.

Written by the indexing model from the issue text.

Description

Hi, I found an issue in the money transfer logic.

When transferring money, the receiver’s balance doesn’t get incremented.
Instead, it gets replaced by the transfer amount.

The problem comes from this variable:

self.receiver_balance

It’s initialized to 0 and never updated from the database, so the code ends up doing:

balance = transfer_amount

This means the receiver’s old balance is lost.

Example:
If the receiver originally has 300 and I transfer 50 → the final balance becomes 50, not 350.

Expected:

The balance should increase by the transfer amount.

Suggestion:

Update the DB directly using something like:

UPDATE card SET balance = balance + ? WHERE number = ?

This way the balance is always based on the value stored in the database.

Dominant language
Python
Stars
584
Forks
443
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shahrayar123/Python-Projects

All issues in Shahrayar123/Python-Projects

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.