Bug fixes for offer_create and offer_cancel.

This commit is contained in:
Arthur Britto
2012-07-13 23:01:26 -07:00
parent bbea33f3c2
commit d3e1b98fe8
9 changed files with 248 additions and 205 deletions

View File

@@ -318,9 +318,15 @@ Transaction::pointer Transaction::setOfferCreate(
mTransaction->setITFieldAmount(sfTakerPays, saTakerPays);
mTransaction->setITFieldAmount(sfTakerGets, saTakerGets);
mTransaction->setITFieldAccount(sfPaysIssuer, saTakerPays.getIssuer());
mTransaction->setITFieldAccount(sfGetsIssuer, saTakerGets.getIssuer());
mTransaction->setITFieldU32(sfExpiration, uExpiration);
if (!saTakerPays.isNative())
mTransaction->setITFieldAccount(sfPaysIssuer, saTakerPays.getIssuer());
if (!saTakerGets.isNative())
mTransaction->setITFieldAccount(sfGetsIssuer, saTakerGets.getIssuer());
if (uExpiration)
mTransaction->setITFieldU32(sfExpiration, uExpiration);
sign(naPrivateKey);
@@ -351,7 +357,7 @@ Transaction::pointer Transaction::setOfferCancel(
const NewcoinAddress& naPrivateKey,
uint32 uSequence)
{
mTransaction->setITFieldU32(sfSequence, uSequence);
mTransaction->setITFieldU32(sfOfferSequence, uSequence);
sign(naPrivateKey);