mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 00:09:31 +01:00
TransactionConfidence: rename getLastBroadcastTime()
method from lastBroadcastTime()
This effectively reverts commit c2cabead9a
.
This commit is contained in:
parent
ff42c49648
commit
6feeb5a1c0
4 changed files with 6 additions and 6 deletions
|
@ -343,11 +343,11 @@ public class TransactionConfidence {
|
||||||
* Return the time the transaction was last announced to us, or empty if unknown.
|
* Return the time the transaction was last announced to us, or empty if unknown.
|
||||||
* @return time the transaction was last announced to us, or empty if unknown
|
* @return time the transaction was last announced to us, or empty if unknown
|
||||||
*/
|
*/
|
||||||
public Optional<Instant> lastBroadcastTime() {
|
public Optional<Instant> getLastBroadcastTime() {
|
||||||
return Optional.ofNullable(lastBroadcastTime);
|
return Optional.ofNullable(lastBroadcastTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated use {@link #lastBroadcastTime()} */
|
/** @deprecated use {@link #getLastBroadcastTime()} */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Nullable
|
@Nullable
|
||||||
public Date getLastBroadcastedAt() {
|
public Date getLastBroadcastedAt() {
|
||||||
|
|
|
@ -399,7 +399,7 @@ public class WalletProtobufSerializer {
|
||||||
.build();
|
.build();
|
||||||
confidenceBuilder.addBroadcastBy(proto);
|
confidenceBuilder.addBroadcastBy(proto);
|
||||||
}
|
}
|
||||||
confidence.lastBroadcastTime().ifPresent(
|
confidence.getLastBroadcastTime().ifPresent(
|
||||||
lastBroadcastTime -> confidenceBuilder.setLastBroadcastedAt(lastBroadcastTime.toEpochMilli())
|
lastBroadcastTime -> confidenceBuilder.setLastBroadcastedAt(lastBroadcastTime.toEpochMilli())
|
||||||
);
|
);
|
||||||
txBuilder.setConfidence(confidenceBuilder);
|
txBuilder.setConfidence(confidenceBuilder);
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class WalletProtobufSerializerTest {
|
||||||
Transaction t1copy = wallet1.getTransaction(t1.getTxId());
|
Transaction t1copy = wallet1.getTransaction(t1.getTxId());
|
||||||
assertArrayEquals(t1.serialize(), t1copy.serialize());
|
assertArrayEquals(t1.serialize(), t1copy.serialize());
|
||||||
assertEquals(2, t1copy.getConfidence().numBroadcastPeers());
|
assertEquals(2, t1copy.getConfidence().numBroadcastPeers());
|
||||||
assertNotNull(t1copy.getConfidence().lastBroadcastTime());
|
assertNotNull(t1copy.getConfidence().getLastBroadcastTime());
|
||||||
assertEquals(TransactionConfidence.Source.NETWORK, t1copy.getConfidence().getSource());
|
assertEquals(TransactionConfidence.Source.NETWORK, t1copy.getConfidence().getSource());
|
||||||
|
|
||||||
Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(myWallet);
|
Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(myWallet);
|
||||||
|
|
|
@ -384,7 +384,7 @@ public class PeerGroupTest extends TestWithPeerGroup {
|
||||||
InventoryMessage inv = InventoryMessage.ofTransactions(tx);
|
InventoryMessage inv = InventoryMessage.ofTransactions(tx);
|
||||||
|
|
||||||
assertEquals(0, tx.getConfidence().numBroadcastPeers());
|
assertEquals(0, tx.getConfidence().numBroadcastPeers());
|
||||||
assertFalse(tx.getConfidence().lastBroadcastTime().isPresent());
|
assertFalse(tx.getConfidence().getLastBroadcastTime().isPresent());
|
||||||
|
|
||||||
// Peer 2 advertises the tx but does not receive it yet.
|
// Peer 2 advertises the tx but does not receive it yet.
|
||||||
inbound(p2, inv);
|
inbound(p2, inv);
|
||||||
|
@ -408,7 +408,7 @@ public class PeerGroupTest extends TestWithPeerGroup {
|
||||||
assertEquals(2, tx.getConfidence().numBroadcastPeers());
|
assertEquals(2, tx.getConfidence().numBroadcastPeers());
|
||||||
assertTrue(tx.getConfidence().wasBroadcastBy(peerOf(p1).getAddress()));
|
assertTrue(tx.getConfidence().wasBroadcastBy(peerOf(p1).getAddress()));
|
||||||
assertTrue(tx.getConfidence().wasBroadcastBy(peerOf(p2).getAddress()));
|
assertTrue(tx.getConfidence().wasBroadcastBy(peerOf(p2).getAddress()));
|
||||||
assertTrue(tx.getConfidence().lastBroadcastTime().isPresent());
|
assertTrue(tx.getConfidence().getLastBroadcastTime().isPresent());
|
||||||
|
|
||||||
tx.getConfidence().addEventListener((confidence, reason) -> confEvent[0] = confidence);
|
tx.getConfidence().addEventListener((confidence, reason) -> confEvent[0] = confidence);
|
||||||
// A straggler reports in.
|
// A straggler reports in.
|
||||||
|
|
Loading…
Add table
Reference in a new issue