A discharge of bankruptcy is an order of the court that says that the bankrupt person has fulfilled his or her obligations under the bankruptcy proceedings. Either all debts have been paid, or more likely, the property that was available for paying debts was divided up among creditors so that they were paid in part. While a person is undergoing the process and the court has not yet discharged him or her, any surplus income not needed for essentials is paid to the trustee in bankruptcy to be divided among the creditors.
If the person who is in bankruptcy is the beneficiary of an estate of someone who passed away, the bankrupt person's entire share of the estate will go to the trustee in bankruptcy. The trustee will use as much of the inheritance as is needed to pay all of the debts, even if this means the whole inheritance. If the trustee doesn't need all of the inheritance to pay the debts, then the surplus amount will be paid to the bankrupt person.
The bankrupt person can't legally waive his inheritance (i.e. decide he doesn't want it), and he can't assign it to someone else (i.e. say that he wants his inheritance paid to his wife or children or friends etc). The trustee in bankruptcy has complete control over the bankrupt person's incoming money. The executor of the estate has no choice but to send the inheritance cheque to the trustee in bankruptcy.
If the bankrupt person has been discharged by the court and later inherits money, he is free to receive it just like anyone else.