unchained-capital / caravan

Bitcoin multisig coordination software
https://unchained-capital.github.io/caravan/
MIT License
203 stars 177 forks source link

Bug: : Output is too small when attempting to send change below the dust limit #110

Closed waldenraines closed 6 months ago

waldenraines commented 4 years ago

I'm submitting a…

Expected Behavior

Should be prevented from advancing to the preview transaction page and an error should be shown.

Current Behavior

Peek 2020-04-28 09-50

Uncaught Error: Output amount is too small.
    at unsignedMultisigTransaction (transactions.js:98)
    at finalizeOutputs (transactionReducer.js:268)
    at transactionReducer.js:489
    at combination (redux.js:458)
    at combination (redux.js:458)
    at rootReducer (index.js:51)
    at p (<anonymous>:1:36402)
    at v (<anonymous>:1:36684)
    at <anonymous>:1:40069
    at Object.dispatch (redux.js:212)
    at e (<anonymous>:1:40553)
    at index.js:11
    at Object.dispatch (index.js:23)
    at dispatch (<anonymous>:1:28545)
    at redux.js:475
    at WalletSpend._this.showPreview (WalletSpend.jsx:103)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:454)
    at executeDispatch (react-dom.development.js:584)
    at executeDispatchesInOrder (react-dom.development.js:609)
    at executeDispatchesAndRelease (react-dom.development.js:713)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:722)
    at forEachAccumulated (react-dom.development.js:694)
    at runEventsInBatch (react-dom.development.js:739)
    at runExtractedPluginEventsInBatch (react-dom.development.js:880)
    at handleTopLevel (react-dom.development.js:5807)
    at batchedEventUpdates$1 (react-dom.development.js:24368)
    at batchedEventUpdates (react-dom.development.js:1419)
    at dispatchEventForPluginEventSystem (react-dom.development.js:5898)
    at attemptToDispatchEvent (react-dom.development.js:6014)
    at dispatchEvent (react-dom.development.js:5918)
    at unstable_runWithPriority (scheduler.development.js:818)
    at runWithPriority$2 (react-dom.development.js:12130)
    at discreteUpdates$1 (react-dom.development.js:24384)
    at discreteUpdates (react-dom.development.js:1442)
    at dispatchDiscreteEvent (react-dom.development.js:5885)

Possible Solution

Show error and prevent the user from advancing to the preview transaction page.

Steps to Reproduce (for bugs)

  1. Setup a wallet with a balance
  2. Go to spend page
  3. Enter address and amount less than your balance
  4. Switch to manual mdoe
  5. Edit the change output to be below the dust limit
  6. Increase other output (if applicable)
  7. Click preview transaction
  8. Note error

Environment

caravan@0.2.0 /home/walden/code/alt-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
dylan-thompson commented 6 months ago

I am unable to reproduce this bug. The Output amount is too small error is being caught and displayed properly.