Commit 6cbb668
Fix multiple bugs in CreateSparkMintTransactions
Bug fixes in sparkwallet.cpp:
1. Fix typo: mapMultiArgs.at("change") -> mapMultiArgs.at("-change")
This would cause std::out_of_range exception when -change arg is used.
2. Add empty check before utxos.second.front() access to prevent
undefined behavior if any entry has an empty vector.
3. Add break after finding matching UTXO entry to avoid unnecessary
iterations and potential issues.
4. Fix missing strFailReason when SelectCoins fails for reasons other
than insufficient funds - now sets "Unable to select coins for minting".
5. Fix missing strFailReason when function fails because valueToMint > 0
at end - now sets descriptive error message.
6. Fix misleading error message: "Signing transaction failed" changed to
"Transaction not allowed in mempool" for mempool rejection.
Bug fix in wallet.cpp:
- Same typo fix for mapMultiArgs.at("change") in CreateLelantusMintTransactions
These bugs could potentially cause crashes (especially #1 and #2) or
make debugging difficult due to missing/wrong error messages.
Co-authored-by: reuben <[email protected]>1 parent 5e45b7a commit 6cbb668
2 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
963 | 962 | | |
964 | 963 | | |
| 964 | + | |
| 965 | + | |
965 | 966 | | |
966 | 967 | | |
967 | 968 | | |
| |||
995 | 996 | | |
996 | 997 | | |
997 | 998 | | |
998 | | - | |
| 999 | + | |
999 | 1000 | | |
1000 | 1001 | | |
1001 | 1002 | | |
| |||
1209 | 1210 | | |
1210 | 1211 | | |
1211 | 1212 | | |
1212 | | - | |
| 1213 | + | |
1213 | 1214 | | |
1214 | 1215 | | |
1215 | 1216 | | |
| |||
1228 | 1229 | | |
1229 | 1230 | | |
1230 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
1231 | 1234 | | |
1232 | 1235 | | |
1233 | 1236 | | |
1234 | 1237 | | |
1235 | | - | |
1236 | 1238 | | |
| 1239 | + | |
1237 | 1240 | | |
1238 | 1241 | | |
1239 | 1242 | | |
| |||
1253 | 1256 | | |
1254 | 1257 | | |
1255 | 1258 | | |
| 1259 | + | |
1256 | 1260 | | |
1257 | 1261 | | |
1258 | 1262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4487 | 4487 | | |
4488 | 4488 | | |
4489 | 4489 | | |
4490 | | - | |
| 4490 | + | |
4491 | 4491 | | |
4492 | 4492 | | |
4493 | 4493 | | |
| |||
0 commit comments