src/blockchain.c
void bchain_transaction(Blockchain *bchain, Transaction tx)
{
    if (bchain->pending_tx_idx >= NUM_TRANSACTIONS)
    {
        printf("cannot add transaction (dumped): waiting for mining...\n");
        return;
    }

    if (!bchain_verify_tx(bchain, tx))
    {
        printf("cannot add transaction (dumped): invalid\n");
        return;
    }

    /* add new pending transaction */
    bchain->pending_txs[bchain->pending_tx_idx] = tx;
    bchain->pending_tx_idx++;
}
/* add a transaction to the pending list */
add a transaction to the pending list
add a transaction to the pending list
void bchain_transaction(Blockchain *bchain, Transaction tx)
{
    if (bchain->pending_tx_idx >= NUM_TRANSACTIONS)
    {
        printf("cannot add transaction (dumped): waiting for mining...\n");
        return;
    }
    if (!bchain_verify_tx(bchain, tx))
    {
        printf("cannot add transaction (dumped): invalid\n");
        return;
    }
    bchain->pending_txs[bchain->pending_tx_idx] = tx;
    bchain->pending_tx_idx++;
}
void bchain_transaction ( Blockchain * bchain , Transaction tx ) { if ( bchain -> pending_tx_idx >= NUM_TRANSACTIONS ) { printf ( " \n " ) ; return ; } if ( ! bchain_verify_tx ( bchain , tx ) ) { printf ( " \n " ) ; return ; } bchain -> pending_txs [ bchain -> pending_tx_idx ] = tx ; bchain -> pending_tx_idx ++ ; }
add a transaction to the pending list
add a transaction to the pending list
/* add new pending transaction */