mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
Don't crash if a node is deleted.
This commit is contained in:
@@ -182,20 +182,23 @@ void OrderBookDB::processTxn(const SerializedTransaction& stTxn, TER terResult,T
|
|||||||
field=&sfNewFields;
|
field=&sfNewFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
const STObject* previous = dynamic_cast<const STObject*>(node.peekAtPField(*field));
|
if (field)
|
||||||
if(previous)
|
|
||||||
{
|
{
|
||||||
STAmount takerGets = previous->getFieldAmount(sfTakerGets);
|
const STObject* previous = dynamic_cast<const STObject*>(node.peekAtPField(*field));
|
||||||
uint160 currencyOut=takerGets.getCurrency();
|
if(previous)
|
||||||
uint160 issuerOut=takerGets.getIssuer();
|
{
|
||||||
|
STAmount takerGets = previous->getFieldAmount(sfTakerGets);
|
||||||
|
uint160 currencyOut=takerGets.getCurrency();
|
||||||
|
uint160 issuerOut=takerGets.getIssuer();
|
||||||
|
|
||||||
STAmount takerPays = previous->getFieldAmount(sfTakerPays);
|
STAmount takerPays = previous->getFieldAmount(sfTakerPays);
|
||||||
uint160 currencyIn=takerPays.getCurrency();
|
uint160 currencyIn=takerPays.getCurrency();
|
||||||
uint160 issuerIn=takerPays.getIssuer();
|
uint160 issuerIn=takerPays.getIssuer();
|
||||||
|
|
||||||
// determine the OrderBook
|
// determine the OrderBook
|
||||||
BookListeners::pointer book=getBookListeners(currencyIn,currencyOut,issuerIn,issuerOut);
|
BookListeners::pointer book=getBookListeners(currencyIn,currencyOut,issuerIn,issuerOut);
|
||||||
if(book) book->publish(jvObj);
|
if(book) book->publish(jvObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch(...)
|
}catch(...)
|
||||||
|
|||||||
Reference in New Issue
Block a user