BoAT-X-Framework icon indicating copy to clipboard operation
BoAT-X-Framework copied to clipboard

chainmaker wallet create failed Number of wallets occupied

Open Cavalierliu opened this issue 3 years ago • 0 comments

if (wallet_config_ptr != NULL) { memcpy(boatwalletStore_ptr, wallet_config_ptr, wallet_config_size); wallet_ptr = BoatHlchainmakerWalletInit((BoatHlchainmakerWalletConfig*)wallet_config_ptr);

            if (wallet_ptr != NULL)
            {
                memcpy(boatwalletStore_ptr + wallet_config_size, &((BoatHlchainmakerWallet*)wallet_ptr)->user_cert_prikey_info.prikeyCtx, sizeof(BoatWalletPriKeyCtx));
                if (wallet_name_str != NULL)
                {
                    /* create persistent wallet / Overwrite existed configuration */
                    if (BOAT_SUCCESS != BoatPersistStore(wallet_name_str, boatwalletStore_ptr, wallet_config_size + sizeof(BoatWalletPriKeyCtx)))
                    {
                        BoatLog(BOAT_LOG_NORMAL, "persistent wallet create failed.");
                        g_boat_iot_sdk_context.wallet_list[i].is_used = BOAT_FALSE;
                        BoatFree(boatwalletStore_ptr);
                        return BOAT_ERROR_PERSISTER_STORE_FAIL;
                    }
                }
                else
                {
                    /* create one-time wallet */
                    // nothing to do
                    BoatLog(BOAT_LOG_NORMAL, "onetime wallet create");
                } 
            }   
        }

Cavalierliu avatar Jun 15 '22 06:06 Cavalierliu