Skip to content

Instantly share code, notes, and snippets.

@matiu
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matiu/3305c42b341916fb7afc to your computer and use it in GitHub Desktop.
Save matiu/3305c42b341916fb7afc to your computer and use it in GitHub Desktop.
Copay: Remove transaction proposals

Remove TxProposals

  • Download a wallet backup in all peers
  • close the wallet
  • delete browser's localStorage (this will delete ALL YOUR WALLETs, be sure to have backups for ALL)
  • go to Import Wallet
  • Add the param: ?skip=txProposals to the URL (e.g: https:/copay.io//#!/import?skip=txProposals) (other possible params are: privateKey, publicKeyRing, separeted with ,)
  • A banner in the page should appear: https://www.evernote.com/shard/s49/sh/ee2282a5-b712-42c7-ae2b-196d5d94c345/6c72c7e59af341d76884dfe0ce08d43a
  • Import the backup. Be sure to do this on all the peers, to prevent txProposals to sync again.

Advanced features

  • add &advanced=1 to #join to be able to enter the master private key (in hex) at #join time.
  • add &advanced=1 to #backup (More tab) to actually see you master private key (in hex), and show other advanced options, as: Scan for funds using derived addresses from your wallet.

Old method

The following is a procedure to completely REMOVE all transaction prosposals from a working wallet. It has to be done OFFLINE, on EVERY PEER of a wallet to prevent the TxProposal to be synced again.

This procedures is aimed for technical users that are debugging the tx proposal syncronization, and it is provided under the MIT Licence.

this is NOT for non-technical users, you can loose your fund using this.

Do this procedure, one peer at time (you should not connect to other peers while doing this)

  1. Open the wallet in Chrome

  2. Open the javascript console

  3. Inspect an element on the html (could be any element), inspect by using the magnifing glass.

  4. After selecting an item, go back to the javascript console and type:

     var w= angular.element($0).scope().wallet; w?'OK':'';
    

should output 'OK' 5. to erase the current proposals (old and pending), run:

w.txProposals.txps=[]; 
w.store();
  1. go to the 'Send' tab, not Tx proposals should be there. If you are already on that tab, try going to other tab and go back. If the procedure worked, you should not see and tx proposal
  2. repeat on all peers, one at time.

Other useful commands

w.setBackupReady();
w._getKeyMap = function(txp) {

  var keyMap = this.publicKeyRing.copayersForPubkeys(txp._inputSignatures[0], txp.inputChainPaths);

  var inSig = JSON.stringify(txp._inputSignatures[0].sort());

  if (JSON.stringify(Object.keys(keyMap).sort()) !== inSig) {
    throw new Error('inputSignatures dont match know copayers pubkeys');
  }

  return keyMap;
};

Retrive master private key

w.privateKey.toObj(). extendedPrivateKeyString

Generate change addresses manually:

w._doGenerateAddress(1); // many times...
w.store();

the logout / login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment