bitfinexcom / smidgen

MIT License
43 stars 16 forks source link

Cancel multisig transaction or revert from an invalid state #41

Open joshirio opened 6 years ago

joshirio commented 6 years ago
~/.../IOTAcooler/test >>> ./smidgen-linux multisig transfer 2 TSHSYUAII99NUSFUSQDGSUYLIUWGCYMHTJGPIFQKL9LFDKNWWUVMUJZNFNNVP9IIECKZLDV9PNV9MYRM9JHFKLSRT9 alice multisigfile 
Enter your seed: **wrong seed entered here**
info Successfully signed transfer
info Share multisigfile with 'bob' to continue
~/.../IOTAcooler/test >>> ./smidgen-linux multisig transfer 2 TSHSYUAII99NUSFUSQDGSUYLIUWGCYMHTJGPIFQKL9LFDKNWWUVMUJZNFNNVP9IIECKZLDV9PNV9MYRM9JHFKLSRT9 bob multisigfile 
Enter your seed: **real seed entered here**
info Verifying bundle... Bundle: INVALID
ERR! Bundle is invalid - check your seed/balance/address

If one of the multisig parties enters a wrong seed (but valid seed fromat), smidgen is unable to proceed with any steps, leaving the only option to delete and start over with a new file (losing all states about used addresses).

Is there a way to cancel a non finalized multisig transaction or revert an invalid one (wrong input seeds)?

As a workaround, I'm currently storing a backup of the file in a clean state (ie. no incomplete txs) before each transaction.

robertkowalski commented 6 years ago

There is no auto recover right now, but you could modify the multisigfile - each tx is stored in the multisigfile and smidgen uses this listing and the current tx index to resume at the right tx:

https://github.com/bitfinexcom/smidgen/blob/26f756a999671e47f96a07058fedc2539bcf603b/lib/cmds/multisig.js#L267-L269