1
TezosWallet wallet = new TezosWallet(true, "c:\\temp\\Wallet1.txt", "My_PassPhrase");
    wallet.setProvider("https://rpc.hangzhou.tzstats.com");
    wallet.activate(wallet.getPublicKeyHash());

    TezosWallet wallet2 = new TezosWallet(true, "c:\\temp\\Wallet2.txt", "My_PassPhrase");
    wallet2.setProvider("https://rpc.hangzhou.tzstats.com");
    wallet2.activate(wallet2.getPublicKeyHash());

    System.out.println("Loaded the wallet from disk:");

    // Shows loaded wallet data.
    System.out.println("Mnemonic du wallet1: " + wallet.getMnemonicWords());
    System.out.println("PublicKey wallet1: " + wallet.getPublicKeyHash());
    System.out.println("Solde du wallet1: " + wallet.getBalance() + "Tezos");

    // Shows loaded wallet data.
    System.out.println("Mnemonic du wallet2: " + wallet2.getMnemonicWords());
    System.out.println("PublicKey wallet2: " + wallet2.getPublicKeyHash());
    System.out.println("Solde du wallet2: " + wallet.getBalance() + "Tezos");

    BigDecimal amount = new BigDecimal("2.123456");
    BigDecimal fee = new BigDecimal("0.1555");
    JSONObject jsonObject = wallet.send("tz1aKq1jeX1QCSGayt4MNrynsynrHTeSfmvA", "tz1M6BCKeb1hWX7DD8qcKB4T5zJKNpsk5YCc", amount, fee, "", "");
    System.out.println(jsonObject.get("result"));

And the output is :

branch refused (Error:
              Counter 3070118 already used for contract tz1aKq1jeX1QCSGayt4MNrynsynrHTeSfmvA (expected 3070119))'

Where does this error come from, I don't understand? help me please

0

1 Answer 1

0

Some manager operation is stuck in the mempool. Waiting for 60 blocks or restarting the node will solve the issue.

You can also use other RPC.

Check this thread which is about the same thing: stuck transaction error: Pre-validation error

1
  • 1
    thank you very much it works !
    – oriana
    Feb 7, 2022 at 12:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.