# TransactionPool.Remember: transactionGroup: \[0\] had zero Group but was submitted in a group of 2

**URL:** <https://forum.algorand.co/t/transactionpool-remember-transactiongroup-0-had-zero-group-but-was-submitted-in-a-group-of-2/5296>\
**Category:** Uncategorized\
**Tags:** testnet\
**Created:** [December 3, 2021, 1:14pm UTC](https://forum.algorand.co/t/transactionpool-remember-transactiongroup-0-had-zero-group-but-was-submitted-in-a-group-of-2/5296 "2021-12-03T13:14:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nbellanich](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nbellanich](https://forum.algorand.co/u/nbellanich)\
**Post date:** [December 29, 2021, 7:50pm UTC](https://forum.algorand.co/t/transactionpool-remember-transactiongroup-0-had-zero-group-but-was-submitted-in-a-group-of-2/5296/2 "2021-12-29T19:50:24Z")

</div>

Sorry , could you find something on this? I’m currently running into the same error.

😀 UPDATE : I could solve the problem. It seems that the problem is the order of the code. I just copy [this boilerplate](https://github.com/algorand/docs/blob/staging/examples/atomic_transfers/v2/javascript/atomicTransfer.js) for atomic transfers but I had to do some changes.

Summary:  
1- build transaction with makePaymentTxnWithSuggestedParams  
2- next call algosdk.assignGroupID([transaction1,transaction2]) no necessary to save it into a variable as repo does.  
3- sign both txns  
4- push signed txns into array groupedSignedTxns =   
5- call =\> await algodClient.sendRawTransaction(groupedSignedTxns).do()

I’ll put my code here just to make it even more explicit:

```auto
const algosdk = require('algosdk');

var client = null;
async function setupClient() {
    if (client == null) {
        const token = { 'X-API-key': 'EMgRQXIAN67gCYG9lGQB5aQJmokDqZqc2JM7zsgO' };
        const server = "https://testnet-algorand.api.purestake.io/ps2";
        const port = "";
        let algodClient = new algosdk.Algodv2(token, server, port);
        client = algodClient;
    } else {
        return client;
    }
    return client;
}

function recoverAccount1() {
    var account1_mnemonic = "PUT HERE YOUR MNEMONIC";
    const passphrase = account1_mnemonic;
    let myAccount = algosdk.mnemonicToSecretKey(passphrase);
    return myAccount;
}

function recoverAccount2() {
    var account2_mnemonic = "PUT HERE YOUR MNEMONIC";
    const passphrase = account2_mnemonic;
    let myAccount = algosdk.mnemonicToSecretKey(passphrase);
    return myAccount;
}

// function used to wait for a tx confirmation
const waitForConfirmation = async function (algodclient, txId) {
    let response = await algodclient.status().do();
    let lastround = response["last-round"];
    console.log(`Waiting for transaction confirmation for txn ${txId}`);
    while (true) {
        const pendingInfo = await algodclient.pendingTransactionInformation(txId).do();
        if (pendingInfo["confirmed-round"] !== null && pendingInfo["confirmed-round"] > 0) {
            //Got the completed Transaction
            console.log("Transaction " + txId + " confirmed in round " + pendingInfo["confirmed-round"]);
            break;
        }
        lastround++;
        await algodclient.statusAfterBlock(lastround).do();
    }
    console.log('Transaction confirmed');
};

async function submitGroupTransactions() {

    try {
        const receiver = "GD64YIY3TWGDMCNPP553DZPPR6LDUSFQOIJVFDPPXWEG3FVOJCCDBBHU5A";
        let algodClient = await setupClient();
        let myAccountA = await recoverAccount1();
        let myAccountB = await recoverAccount2();
        console.log("My account B address: %s", myAccountB.addr)
        console.log("My account A address: %s", myAccountA.addr)

        let suggestedParams = await algodClient.getTransactionParams().do();
        
        let transactionAccA = algosdk.makeAssetTransferTxnWithSuggestedParam(myAccountA.addr, receiver, myAccountB.addr, undefined,1000000, undefined, 13300122, suggestedParams)
        let transactionAccB = algosdk.makeAssetTransferTxnWithSuggestedParam(myAccountB.addr, receiver, myAccountA.addr, undefined,1000000, undefined, 13300122, suggestedParams)

        algosdk.assignGroupID([transactionAccA,transactionAccB]);

        let signedTxA = transactionAccA.signTxn(myAccountA.sk)
        let signedTxB = transactionAccB.signTxn(myAccountB.sk)

        let groupedSignedTxns = []
        groupedSignedTxns.push(signedTxA)
        groupedSignedTxns.push(signedTxB)

        let tx = (await algodClient.sendRawTransaction(groupedSignedTxns).do());
        console.log("Transaction : " + tx.txId);

        await waitForConfirmation(algodClient, tx.txId);

    } catch (err) {
        console.log("err", err);
    }
}
submitGroupTransactions();

```

Few last things to take into account:

- remember your addresses need balance to send the txn : [here you can faucet them](https://bank.testnet.algorand.network/)
- boilerplate has a different connection to algoCliento from what’s in the code above

Hope this help you or someone in future!

---

_[View the full topic](https://forum.algorand.co/t/transactionpool-remember-transactiongroup-0-had-zero-group-but-was-submitted-in-a-group-of-2/5296)._
