@@ -674,6 +674,7 @@ impl BillBlockchain {
674
674
Ok ( nodes)
675
675
}
676
676
677
+ /// Returns all endorsements for the bill (including anonymous holders)
677
678
pub fn get_endorsements_for_bill ( & self , bill_keys : & BillKeys ) -> Vec < Endorsement > {
678
679
let mut result: Vec < Endorsement > = vec ! [ ] ;
679
680
// iterate from the back to the front, collecting all endorsement blocks
@@ -683,28 +684,26 @@ impl BillBlockchain {
683
684
continue ;
684
685
}
685
686
if let Ok ( Some ( holder_from_block) ) = block. get_holder_from_block ( bill_keys) {
686
- // we ignore blocks with an anonymous holder
687
- if let BillParticipantBlockData :: Ident ( holder_data) = holder_from_block. holder {
688
- result. push ( Endorsement {
689
- pay_to_the_order_of : holder_data. clone ( ) . into ( ) ,
690
- signed : LightSignedBy {
691
- data : holder_from_block. signer . clone ( ) . into ( ) ,
692
- signatory : holder_from_block. signatory . map ( |s| {
693
- LightBillIdentParticipant {
694
- // signatories are always identified people
695
- t : ContactType :: Person ,
696
- name : s. name ,
697
- node_id : s. node_id ,
698
- }
699
- } ) ,
700
- } ,
701
- signing_timestamp : block. timestamp ,
702
- signing_address : match holder_from_block. signer {
703
- BillParticipantBlockData :: Anon ( _) => None ,
704
- BillParticipantBlockData :: Ident ( data) => Some ( data. postal_address ) ,
705
- } ,
706
- } ) ;
707
- }
687
+ let holder_data = holder_from_block. holder ;
688
+ result. push ( Endorsement {
689
+ pay_to_the_order_of : holder_data. clone ( ) . into ( ) ,
690
+ signed : LightSignedBy {
691
+ data : holder_from_block. signer . clone ( ) . into ( ) ,
692
+ signatory : holder_from_block. signatory . map ( |s| {
693
+ LightBillIdentParticipant {
694
+ // signatories are always identified people
695
+ t : ContactType :: Person ,
696
+ name : s. name ,
697
+ node_id : s. node_id ,
698
+ }
699
+ } ) ,
700
+ } ,
701
+ signing_timestamp : block. timestamp ,
702
+ signing_address : match holder_from_block. signer {
703
+ BillParticipantBlockData :: Anon ( _) => None ,
704
+ BillParticipantBlockData :: Ident ( data) => Some ( data. postal_address ) ,
705
+ } ,
706
+ } ) ;
708
707
}
709
708
}
710
709
@@ -729,6 +728,7 @@ impl BillBlockchain {
729
728
result
730
729
}
731
730
731
+ /// Returns past endorsees, which can be recoursed against (no recourse blocks, no anon)
732
732
pub fn get_past_endorsees_for_bill (
733
733
& self ,
734
734
bill_keys : & BillKeys ,
0 commit comments