* Throwing recoverable error when transaction amount is too small to pay the MWEB recipient
* Checking ismine filter for pegouts in GetCredit
This commit is contained in:
parent
405b1ec5ca
commit
82ab2849c9
@ -105,6 +105,10 @@ void Transact::AddMWEBTx(InProcessTx& new_tx)
|
||||
recipient_amount -= new_tx.total_fee;
|
||||
}
|
||||
|
||||
if (recipient_amount < 0) {
|
||||
throw CreateTxError(_("The transaction amount is too small to pay the fee"));
|
||||
}
|
||||
|
||||
if (recipient.IsMWEB()) {
|
||||
receivers.push_back(mw::Recipient{recipient_amount, recipient.GetMWEBAddress()});
|
||||
} else {
|
||||
|
||||
@ -1647,7 +1647,7 @@ CAmount CWallet::GetCredit(const CTransaction& tx, const boost::optional<MWEB::W
|
||||
if (!has_my_inputs) {
|
||||
for (const PegOutCoin& pegout : tx.mweb_tx.GetPegOuts()) {
|
||||
LOCK(cs_wallet);
|
||||
if (IsMine(DestinationAddr(pegout.GetScriptPubKey()))) {
|
||||
if (!(IsMine(DestinationAddr(pegout.GetScriptPubKey())) & filter)) {
|
||||
nCredit += pegout.GetAmount();
|
||||
if (!MoneyRange(nCredit))
|
||||
throw std::runtime_error(std::string(__func__) + ": value out of range");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user