Bug: possible to construct a transaction with an output equal to an input
Opened this issue · 0 comments
jevidon commented
Original issue: unchained-capital/caravan#116
Expected Behavior
Should not be able to construct a transaction with an output address equal to an input address.
Current Behavior
It's possible to construct a transaction with an output equal to an input
See also the gif and screenshot:
Note that in the gif I don't sign the transaction but it is possible to do so, see https://blockstream.info/testnet/tx/861c1201d3600adc2b17bc4b1cdb0764aaf1c0d891ca581e2080044a2f33e6c1?expand
Possible Solution
Prevent the above and show an error message.
Steps to Reproduce (for bugs)
- Setup a funded wallet
- Copy an address and note the balance
- Paste the address into the output text field
- Set the amount to the same amount as the address balance
- Click preview transaction
- Note that one of your output addresses is the same as one of your input addresses
Environment
- Where are you running caravan: localhost
- Operating system: Linux
- Browser and version: Chrome
caravan@0.2.0 /home/walden/code/caravan
├── unchained-bitcoin@0.0.13
└─┬ unchained-wallets@0.0.12
└── unchained-bitcoin@0.0.12
npm: 6.14.4
node: v12.16.2
Linux 5.6.13-arch1-1 #1 SMP PREEMPT Thu, 14 May 2020 06:52:53 +0000 x86_64 GNU/Linux