mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 05:25:55 +00:00
Fix proposal relaying (RIPD-1057):
Stash the signature so we can relay a proposal later
This commit is contained in:
@@ -1324,7 +1324,7 @@ void LedgerConsensusImp::propose ()
|
||||
Blob const pubKey = mValPublic.getNodePublic ();
|
||||
prop.set_nodepubkey (&pubKey[0], pubKey.size ());
|
||||
|
||||
Blob const sig = mOurPosition->sign (mValPrivate);
|
||||
Blob const& sig = mOurPosition->sign (mValPrivate);
|
||||
prop.set_signature (&sig[0], sig.size ());
|
||||
|
||||
app_.overlay().send(prop);
|
||||
@@ -1650,7 +1650,28 @@ void LedgerConsensusImp::playbackProposals ()
|
||||
if (proposal->isPrevLedger (mPrevLedgerHash) &&
|
||||
peerPosition (proposal))
|
||||
{
|
||||
// FIXME: Should do delayed relay
|
||||
// Now that we know this proposal
|
||||
// is useful, relay it
|
||||
protocol::TMProposeSet prop;
|
||||
|
||||
prop.set_proposeseq (
|
||||
proposal->getProposeSeq ());
|
||||
prop.set_closetime (
|
||||
proposal->getCloseTime ().time_since_epoch().count());
|
||||
|
||||
prop.set_currenttxhash (
|
||||
proposal->getCurrentHash().begin(), 256 / 8);
|
||||
prop.set_previousledger (
|
||||
proposal->getPrevLedger().begin(), 256 / 8);
|
||||
|
||||
auto const pubKey = proposal->getPublicKey().getNodePublic ();
|
||||
prop.set_nodepubkey (&pubKey[0], pubKey.size());
|
||||
|
||||
auto const& signature = proposal->getSignature();
|
||||
prop.set_signature (&signature[0], signature.size());
|
||||
|
||||
app_.overlay().relay (
|
||||
prop, proposal->getSuppressionID ());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user