Balance of receiver gets overwritten instead of increased
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shahrayar123/Python-Projects
-
Bug: Program crashes when board is full in Tic Tac Toe gameMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Shahrayar123/Python-Projects#297 · 7 comments ·
-
Read me for paper rock scissor gameMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Shahrayar123/Python-Projects#112 · 8 comments ·
-
Add AI & Agentic AI ProjectsPossibly taken @Reh1t claimed this 15 days ago. OpenAgentic AI enhancement good first issue
Shahrayar123/Python-Projects#332 · 3 comments · 1 assignee ·
-
Update and Improve README DocumentationPossibly taken @Aaqibhafeezkhan claimed this 17 days ago. Opendocumentation good first issue help wanted
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Shahrayar123/Python-Projects#331 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 48/100
Shahrayar123/Python-Projects#320 · 3 comments ·
All issues in Shahrayar123/Python-Projects
Similar issues
-
jobs restart --verify: hotlane restart timeout (10s) shorter than its shutdown (~30s) → false exit 1Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
EtanHey/brainlayer#1072 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
_apply_doc_content: a cancel during the shielded image gather still sends the content batchUpdateOpenenhancement
Difficulty 2/5 Under an hour Newbie friendliness 80/100
khuisman/mcp-gee-sweet#904 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
CORE-HIST-005/006 multi-turn history tests send three different messages with the same messageIdOpen
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
a2aproject/a2a-tck#248 ·